aboutsummaryrefslogtreecommitdiff
path: root/compiler/compiler.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use new parser and DFA compilerRyo Nihei2021-12-101-31/+152
|
* Remove --debug option from compile commandRyo Nihei2021-09-231-36/+1
|
* Keep the order of AST nodes constantRyo Nihei2021-09-221-1/+12
|
* Add name field to the lexical specificationRyo Nihei2021-09-181-0/+1
|
* Change APIsRyo Nihei2021-08-011-48/+64
| | | | | | | | | | | | | | | | | | | | | | Change fields of tokens, results of lexical analysis, as follows: - Rename: mode -> mode_id - Rename: kind_id -> mode_kind_id - Add: kind_id The kind ID is unique across all modes, but the mode kind ID is unique only within a mode. Change fields of a transition table as follows: - Rename: initial_mode -> initial_mode_id - Rename: modes -> mode_names - Rename: kinds -> kind_names - Rename: specs[].kinds -> specs[].kind_names - Rename: specs[].dfa.initial_state -> specs[].dfa.initial_state_id Change public types defined in the spec package as follows: - Rename: LexModeNum -> LexModeID - Rename: LexKind -> LexKindName - Add: LexKindID - Add: StateID
* Add unique kind IDs to tokensRyo Nihei2021-08-011-0/+38
|
* Add fragment expressionRyo Nihei2021-05-251-7/+17
| | | | A fragment entry is defined by an entry whose `fragment` field is `true`, and is referenced by a fragment expression (`\f{...}`).
* Add --compression-level option to compile commandRyo Nihei2021-05-111-7/+57
| | | | --compression-level specifies a compression level. The default value is 2.
* Add CLI optionsRyo Nihei2021-05-081-3/+3
|
* Add transition table compressorRyo Nihei2021-05-071-2/+51
|
* Add lex modeRyo Nihei2021-05-041-2/+82
| | | | | | | | | | lex mode is a feature that separates transition tables per each mode. The lexer starts from an initial state indicated by `initial_state` field and transitions between modes according to `push` and `pop` fields. The initial state will always be `default`. Currently, maleeni doesn't provide the ability to change the initial state. You can specify the modes of each lex entry using `modes` field. When the mode isn't indicated explicitly, the entries have `default` mode.
* Add validation of lexical specs and improve error messagesRyo Nihei2021-04-171-2/+8
|
* Add logging to compile commandRyo Nihei2021-04-081-9/+71
| | | | | compile command writes logs out to the maleeni-compile.log file. When you use compiler.Compile(), you can choose whether the lexer writes logs or not.
* Add types of lexical specificationsRyo Nihei2021-02-161-3/+23
| | | | APIs of compiler and driver packages use these types. Because CompiledLexSpec struct a lexer takes has kind names of lexical specification entries, the lexer sets them to tokens.
* Add compilerRyo Nihei2021-02-141-0/+9
The compiler takes a lexical specification expressed by regular expressions and generates a DFA accepting the tokens. Operators that you can use in the regular expressions are concatenation, alternation, repeat, and grouping.