meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

settings [2023/04/17 18:49] – created revuskysettings [2023/04/17 18:53] (current) revusky
Line 33: Line 33:
 for short. (All these boolean-valued settings can be set to true by just writing them with no value.       for short. (All these boolean-valued settings can be set to true by just writing them with no value.      
                  
-===== Options Relating to Niggling Whitespace Issues =====       +====== Options Relating to Niggling Whitespace Issues ======       
  
 By default, CongoCC //normalizes// newlines to a lone line-feed character,i.e. converts CR or CR-LF to LF, i.e \n. If you want to preserve the newlines as they were in the input you can write: By default, CongoCC //normalizes// newlines to a lone line-feed character,i.e. converts CR or CR-LF to LF, i.e \n. If you want to preserve the newlines as they were in the input you can write:
Line 48: Line 48:
 In the above case, the hex ''1A'' is tacked on if it is not there. That is a CTRL-Z control character. But the terminating string can be anything you specify. By the way: ''ENSURE_FINAL_EOL;'' is the exact same thing as: ''TERMINATING_STRING="\n";''.   In the above case, the hex ''1A'' is tacked on if it is not there. That is a CTRL-Z control character. But the terminating string can be anything you specify. By the way: ''ENSURE_FINAL_EOL;'' is the exact same thing as: ''TERMINATING_STRING="\n";''.  
          
-===== Settings relating to Lexical Processing =====+====== Settings relating to Lexical Processing ======
  
 If you want certain token types to be inactive by default (though presumably turned on at key spots) you can use the **DEACTIVATE_TOKENS** setting. If you want certain token types to be inactive by default (though presumably turned on at key spots) you can use the **DEACTIVATE_TOKENS** setting.
Line 61: Line 61:
  
  
-====== Settings related to Token class generation =====+====== Settings related to Token class generation ======
  
 One feature that is //sometimes// useful is //token chaining//. You can insert a synthetic token into the chain of tokens. This is actually a very tricky, error-prone usage pattern that is off by default. And we recommend that you only turn it on if you really need it! If you examine the included Python grammar, you will see this in use. You turn it on via: One feature that is //sometimes// useful is //token chaining//. You can insert a synthetic token into the chain of tokens. This is actually a very tricky, error-prone usage pattern that is off by default. And we recommend that you only turn it on if you really need it! If you examine the included Python grammar, you will see this in use. You turn it on via:
Line 67: Line 67:
 Conversely, you can turn on the **MINIMAL_TOKEN** setting to generate a minimal token. With that turned on, ''Token'' does not have an ''image'' field. It has a ''getImage()'' method that uses its ''beginOffset/endOffset'' to get its string image on demand. But there is no ''setImage()'' method. There are some (possibly tricky) coding patterns that involve setting a token's String image to a different value from what was read in. But if you don't need that, you can use **MINIMAL_TOKEN** and this also reduces the memory footprint of your token objects. Conversely, you can turn on the **MINIMAL_TOKEN** setting to generate a minimal token. With that turned on, ''Token'' does not have an ''image'' field. It has a ''getImage()'' method that uses its ''beginOffset/endOffset'' to get its string image on demand. But there is no ''setImage()'' method. There are some (possibly tricky) coding patterns that involve setting a token's String image to a different value from what was read in. But if you don't need that, you can use **MINIMAL_TOKEN** and this also reduces the memory footprint of your token objects.
  
-====== Settings related to generating a fault-tolerant parser =====+====== Settings related to generating a fault-tolerant parser ======
  
 You can set You can set