meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
convention_over_configuration [2020/04/25 18:15] – external edit 127.0.0.1 | convention_over_configuration [2020/10/22 18:19] (current) – revusky | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Convention over Configuration (when possible) ====== | ====== Convention over Configuration (when possible) ====== | ||
- | It is our considered view that a tool having a plethora of configuration options can it make it far less usable. Or, at the very least, if there are a lot of configuration options, the neophyte user should be able to ignore them for the most part. One key aspect of this is having sensible defaults that correspond to the typical usage scenarios. Another aspect is simply having naming conventions so that the tool can infer the names of files and their locations, etcetera. | + | It is our considered view that a tool having a plethora of configuration options can make it far less usable. Or, at the very least, if there are a lot of configuration options, the neophyte user should be able to ignore them for the most part. One key aspect of this is having sensible defaults that correspond to the typical usage scenarios. Another aspect is simply having naming conventions so that the tool can infer the names of files and their locations, etcetera. |
===== Naming and Source Code Organization Conventions in JavaCC21 ===== | ===== Naming and Source Code Organization Conventions in JavaCC21 ===== | ||
Line 9: | Line 9: | ||
* The name of the generated parser class will be '' | * The name of the generated parser class will be '' | ||
- | * The generated lexer (a.k.a. *tokenizer*) class will be named '' | + | * The generated lexer (a.k.a. *tokenizer*) class will be named '' |
- | options { | ||
| | ||
... | ... | ||
- | } | ||
| | ||
However, for people who never used legacy JavaCC, this would have no bearing and we assume that most people would prefer the shorter name '' | However, for people who never used legacy JavaCC, this would have no bearing and we assume that most people would prefer the shorter name '' | ||
Line 20: | Line 18: | ||
The generated constants interface will be called '' | The generated constants interface will be called '' | ||
- | If not specified otherwise, all classes will be generated with no package (the default package) in the same directory as the grammar file. However, in this instance, it is strongly recommended that, at least for non-trivial projects, you should specify a package using the PARSER_PACKAGE option and also a base source directory using the new '' | + | If not specified otherwise, all classes will be generated with no package (the default package) in the same directory as the grammar file. However, in this instance, it is strongly recommended that, at least for non-trivial projects, you should specify a package using the PARSER_PACKAGE option and also a base source directory using the new '' |
===== Putting your AST Nodes in their own package ===== | ===== Putting your AST Nodes in their own package ===== |