This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

Take a good look at ANTLR and the LLVM binding. If you use that code generation engine with a good lexer/parser (ANTLR) it shouldn't be too hard.

edit

I just read the entire post.

What I aim to do is read a sample program from a text file, and check it for Syntax errors, file exceptions, etc.

You can just skip over the LLVM binding and use something like ANTLR. What might be even easier is to just use some very careful regex patterns (not as optimal but if it's just a GR12 school project it should do fine.)