Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
leolas952538yWow congratulations! I have always liked this kind of things. How much time did it take you?
-
elazar10308yThe problem with the problem of error reporting is that it is ill-defined. Can you please elaborate on how do you know/define the accuracy of the error reporting? (Of course, intuitive or subjective definition is also useful).
Curiosity aside, sounds like an awesome project. -
0c370t1018yMy slightly messy and underdocumented code can be found on GitHub : https://github.com/Project-Name/...
-
0c370t1018yBecause it's built for an assembly language error reporting is fairly straightforward, but should be extendable. Right now it deconstructs a regular expression based on some standards, and uses that to iterate over the line to locate a problem
-
0c370t1018yNow that I'm awake enough to be a little more clear, the package in question is site.projectname.nicasm, and BetterAssembler is the entry point, if you're looking at the source. Most of the error reporting is handled by site.projectname.err.SyntaxErrorException and it's based on an enum that implements site.projectname.lang.Syntax
-
0c370t1018y@magnusi its written in Java, I'm most familiar with it on a detailed level and the I like data structures it has built in as well as the way exceptions work
-
magnusi5828y@0c370t nice, while I am not much of a fan of Java (in fact, quite the opposite), it's good if it suits your needs the best.
I have also been writing a compiler lately, mine is quite earlier in development though. Parsing and AST cleaning is done with pure C, while only two days ago I began writing some analysis and tree-processing in very unsafe Rust. -
elazar10308ySpecifically for writing compilers, Java is not the ideal language. You will probably want pattern matching and algebraic types.
For code generation Java is probably fine.
Just finished up my first compiler, with accurate extensible error reporting, and the syntax system is generically typed so I can reuse it. Pretty fucking pleased with myself
undefined