EasyCC-CPP
EasyCC-CPP copied to clipboard
Auto detection of new line format in lexical analyzer
Option 1: Add the option to AUTO detect new line format in user input file: CR, LF, CRLF, instead of manually specifying it in the lexical JSON config.
{
"newline": "AUTO",
"..."
}
Enhancement:
- Add
AUTOoption inEasyCC-CPP/src/lexical/Lexical.cppfunctionLexical::generateLexicalTokens()
Docs:
- https://amirbawab.github.io/EasyCC-CPP/lexical/#ii-lexical-configuration
Edit:
- Added Option 1
Option2: Allow user to execute an action function while traversing the state machine. An action function can increment the line number when a \n character is consumed.