A portable lexer frontend to lib-lexin.
Lexin is a portable lexer frontend to lib-lexin that can easily be packaged with any application and has is able to lex all kinds of syntax's.
These Dependencies are only required when building.
- rustc
- cargo
- python
- Clone the repository
git clone https://github.com/proxin187/lexin
- Run the build script
python build.py
- Create a lex file see lex section
- The program is executed the way shown below
Usage: lexin [config(*.lex)] [target] [options]
Options:
-format: [formats] defaults to python
formats:
json: output tokens in json format
python: output tokens in python format
Lexin uses a .lex file to input keywords and symbols to the lexer
Syntax: _keywords [value]*
Example:
_keywords "fn" "if" "else" "match" "use"
Syntax: _symbols [value]*
Example:
_symbols "+" "-" "*" "/" "{" "}" "[" "]" "(" ")" "<" ">" ";" ":"
Syntax: _sections [[start] - [end] [name]]*
Example:
_sections
"/*" - "*/" "comment"
Names only apply to symbols
Syntax: _name [[value] [name]]*
Example:
_name
"+" "Plus"
"-" "Minus"
Currently there is no bound checking on the indexing which means that unfinished statements in the lex file may cause a panic.
Contributors names and contact info
- 0.2
- README.md updates
- See commit change or See release history
- 0.1
- Initial Release
Currently there is no license, this may change in the future