meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
new_settings_in_javacc_21 [2021/12/20 15:01] – revusky | new_settings_in_javacc_21 [2022/02/15 01:49] – chamberlain | ||
---|---|---|---|
Line 1: | Line 1: | ||
Here is a list of settings that exist in JavaCC 21 but are not (and never were) present in the legacy JavaCC tool: | Here is a list of settings that exist in JavaCC 21 but are not (and never were) present in the legacy JavaCC tool: | ||
+ | * **BASE_NAME** This option is used to set the name of the parser, lexer, constants, and NFA data files instead of using the default naming convention that prefixes these files with the name of the grammar file. If this option is set to an empty string (BASE_NAME=""; | ||
* **BASE_SRC_DIR** This supersedes the older OUTPUT_DIRECTORY setting. Files are generated // | * **BASE_SRC_DIR** This supersedes the older OUTPUT_DIRECTORY setting. Files are generated // | ||
+ | * **CONSTANTS_CLASS** This option is used to set the name of the generated constants file instead of using the default file name based on the grammar filename. | ||
* **DEACTIVATE_TOKENS** This setting allows you to indicate that certain token types are de-activated by default when you instantiate the parser. Something like: '' | * **DEACTIVATE_TOKENS** This setting allows you to indicate that certain token types are de-activated by default when you instantiate the parser. Something like: '' | ||
* **ENSURE_FINAL_EOL** With this setting turned on (it is off by default) the generated parser ensures that the input file ends with a newline character. (It tacks one on if it is not present.) This is a nitpicking detail but it is surprisingly difficult to write certain grammars (ones that are very line-oriented) if you cannot be sure that every line (including the last one!) ends with a newline. | * **ENSURE_FINAL_EOL** With this setting turned on (it is off by default) the generated parser ensures that the input file ends with a newline character. (It tacks one on if it is not present.) This is a nitpicking detail but it is surprisingly difficult to write certain grammars (ones that are very line-oriented) if you cannot be sure that every line (including the last one!) ends with a newline. | ||
* **EXTRA_TOKENS** This setting allows you to indicate some additional token types that are not defined with regular expressions in the lexical grammar. This can be useful particularly in token hook routines. | * **EXTRA_TOKENS** This setting allows you to indicate some additional token types that are not defined with regular expressions in the lexical grammar. This can be useful particularly in token hook routines. | ||
* **FAULT_TOLERANT** This turns on the experimental support for building a [[fault tolerant]] parser. It is off by default. | * **FAULT_TOLERANT** This turns on the experimental support for building a [[fault tolerant]] parser. It is off by default. | ||
- | * **PRESERVE_LINE_ENDINGS** This is true by default | + | * **LEXER_CLASS** This option sets the name of the generated lexer file instead of using the default |
+ | * **PARSER_CLASS** This option is used to set the name of the generated parser file instead of using the default file name based on the grammar filename. | ||
+ | * **PRESERVE_LINE_ENDINGS** This is now off by default. That means that all Windows/DOS style line endings (\r\n) are converted to UNIX/MacOS style (\n) internally when the file is read in. Note, by the way, that one advantage of this and the TABS_TO_SPACES option is that if you convert tabs to spaces and line endings to \n then your grammar' | ||
* **SMART_NODE_CREATION** This is the default behavior, so you would have to explicitly turn it off. It means that if no JJTree-style tree-building annotation is used, then a new Node will be created if there are more than one Nodes on the stack. So, a production like '' | * **SMART_NODE_CREATION** This is the default behavior, so you would have to explicitly turn it off. It means that if no JJTree-style tree-building annotation is used, then a new Node will be created if there are more than one Nodes on the stack. So, a production like '' | ||
* **SPECIAL_TOKENS_ARE_NODES** This sets whether to add so-called " | * **SPECIAL_TOKENS_ARE_NODES** This sets whether to add so-called " |