The parser and the AST are mostly used by all tools.
The parser
is the tool that transform source-files into abstract syntax trees (AST) (see parser_nodes
)
While the AST is a higher abstraction than blob of text, the AST is still limited and represents only What the programmer says.
Classes of nodes of the AST starts with the letter A
(for most things, eg. AClassdef
) or T
(for token eg. TId
), there is no real reason except historical that might be solved with a new parser.
Variable names of the AST usually starts with n
(for node). This is also historical but some names with a a
(to mimic the class name) remains.
Most files in this directory are generated from a grammar for sablecc3 ( http://www.sablecc.org ). In order to generate nit parser, you need the alternate SableCC3 generator ( http://www.mare.ee/indrek/sablecc/ ).
Moreover, the Nit language description file extends the standard SableCC3 syntax and includes parametric productions to factorize the description of the language.
In order to simplify the development of the Nit tools, files produced by the parser generator are committed in the repository; therefore Java and SableCC3 is only required to alter the Nit syntax.
make java
rule to build it.The following are generated but present to avoid the need of sablecc3:
Other temp files produced by the Makefile:
nitc > interpreter > dynamic_loading_ffi
This group implement a partial support for the Nit FFI in the interpreter.nitc > interpreter > dynamic_loading_ffi
This group implement a partial support for the Nit FFI in the interpreter.