meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
new_settings_in_javacc_21 [2020/05/10 12:32] – created revusky | new_settings_in_javacc_21 [2022/02/15 01:49] – chamberlain | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | * **LEGACY_API** If you turn on this setting, the tool generates code that is more compatible with legacy JavaCC. For example, JavaCC 21 removes publicly visible fields like Token.kind and Token.image and replaces them with getter/ | + | Here is a list of settings |
- | * **TABS_TO_SPACES** This is an integer | + | |
- | * **PRESERVE_LINE_ENDINGS** This is true by default (though this could change in the future based on user feedback. If you turn this setting off, all Windows/DOS style line endings (\r\n) are converted | + | * **BASE_NAME** This option |
- | * **HUGE_FILE_SUPPORT** Since we believe that the normal usage of the tool is simply to build a tree, it makes little sense to have any qualms about reading in the entire input into memory. So this is the default. This option allows you to turn on the legacy behavior of only maintaining a (fairly small) buffer in memory | + | |
* **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 // | ||
- | * **SMART_NODE_CREATION** This is the default | + | * **CONSTANTS_CLASS** This option |
+ | * **DEACTIVATE_TOKENS** This setting allows | ||
+ | * **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 | ||
+ | * **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. | ||
+ | * **LEXER_CLASS** This option sets the name of the generated lexer file instead of using the default file name based on the grammar filename. This option also sets the name of the NFA data file to use this same prefix. For example, LEXER_CLASS=" | ||
+ | * **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 '' | ||
+ | * **SPECIAL_TOKENS_ARE_NODES** This sets whether to add so-called " | ||
+ | * **TABS_TO_SPACES** This is an integer (typically from 1 to 8, in practice) that defines how many spaces a tab stop is. This is now set to 8 by default. (Until very recently, the default was that the option was off.) This means that all TAB characters (\t) are converted to spaces when the file is read in. Note that, if you turn this off, all reported error locations simply treat a tab character as one horizontal offset. If you want JavaCC to report errors as if a TAB stop is 4 spaces, say, you need to set TAB_SPACES=4 in your settings. | ||
+ | * **TOKENS_ARE_NODES** This sets whether we add Tokens as terminal nodes to the AST. By default, it is true. | ||
+ | |||
+ | See [[deprecated settings]] for a list of legacy JavaCC options that no longer exist in JavaCC 21. |