[LLVMdev] Rolling my own LLVM assembly language parser

jstanier j.stanier at sussex.ac.uk
Wed Mar 25 08:59:24 PDT 2009


Hi everyone,

I'm currently in the first year of my PhD, and I'm going to be looking at an
experimental IR for my thesis. After looking at a variety of research
compilers I've come to the conclusion that LLVM is the nicest to work with
for my purposes. I was considering writing the code to construct this
experimental IR from LLVM assembly, and then at the end of the process (i.e.
new optimisations and transformations, etc.) I'll translate back into LLVM
assembly to allow compilation to continue. This keeps everything modular,
means I can work with "real" languages rather than toy ones, and so on.

I was thinking of generating my own lexer and parser for LLVM assembly. I'm
aware that between the specification here:

http://llvm.org/docs/LangRef.html

and also the comments in LLParser.cpp there is information about the grammar
for .ll files, but is there any documentation that simply states the full
grammar, much in the style of this C grammar:

http://www.lysator.liu.se/c/ANSI-C-grammar-y.html

or this Python grammar?

http://www.python.org/doc/2.5.2/ref/grammar.txt

Does anyone have any thoughts or experience with parsing .ll files? I'd like
to add that if I've managed to somehow miss the document I'm looking for,
then I'm willing to make a paper dunce hat and wear it for the rest of the
week.

Best,

James
-- 
View this message in context: http://www.nabble.com/Rolling-my-own-LLVM-assembly-language-parser-tp22704803p22704803.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list