Next: , Previous: , Up: Overview   [Contents][Index]


Compiler

Compiler

The coNCePTuaL compiler is written in Python and is based on the PLY (Python Lex–Yacc) compiler framework. Compiler execution follows a basic pipeline structure. Compilation starts with the top-level file ( ncptl.py), which processes the command line then transfers control to the lexer ( ncptl_lexer.py). The lexer inputs coNCePTuaL source code and outputs a stream of tokens ( ncptl_token.py). Next, the parser ( ncptl_parser.py) finds structure in those tokens based on coNCePTuaL’s grammatical rules and outputs an abstract syntax tree ( ncptl_ast.py ). Finally, the code generator ( codegen_language_library.py) that was designated on the command line walks the abstract syntax tree, converting it to code in the target language and for the target communication library.

Scott Pakin, pakin@lanl.gov