EasyCC-CPP icon indicating copy to clipboard operation
EasyCC-CPP copied to clipboard

Auto detection of new line format in lexical analyzer

Open amirbawab opened this issue 8 years ago • 1 comments

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 AUTO option in EasyCC-CPP/src/lexical/Lexical.cpp function Lexical::generateLexicalTokens()

Docs:

  • https://amirbawab.github.io/EasyCC-CPP/lexical/#ii-lexical-configuration

Edit:

  • Added Option 1

amirbawab avatar Sep 09 '17 20:09 amirbawab

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.

amirbawab avatar Jan 29 '18 20:01 amirbawab