X-Git-Url: http://nitlanguage.org diff --git a/src/parser/README.md b/src/parser/README.md index 3595aa7..73ebcd0 100644 --- a/src/parser/README.md +++ b/src/parser/README.md @@ -1,6 +1,6 @@ Parser and AST for the Nit language -The parser ans the AST are mostly used by all tools. +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*. @@ -14,6 +14,10 @@ Variable names of the AST usually starts with `n` (for node). This is also histo 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. + ## Contents * fact_parser.pl: Script used to factorize parser.nit @@ -23,7 +27,7 @@ In order to generate nit parser, you need the alternate SableCC3 generator ( htt * parser_nodes.nit: token and nodes classes hierarchy used by the parser and the lexer * tables.nit, tables_nit.h: Interfaces to access the tables needed by the parser and the lexer * xss/*.xss: alternate SableCC3 template files for the Nit language - +* org/nitlanguage/gen: A Nit parser in Java, used for tests. use the `make java` rule to build it. The following are generated but present to avoid the need of sablecc3: @@ -39,4 +43,3 @@ Other temp files produced by the Makefile: * .nit.sablecc3: Sablecc3 grammar after processing * .nit.sablecc3.dump: Dump of the grammar to improve sablecc3 multiple runs * .parser-nofact.nit: The parser generated by SableCC3 before factorization by fact_parser.pl -