A set of tools that includes a programming language for generating lexers and parsers for other languages.
- Install the CLI:
npm i @xcheme/cli
- Create the Hello World parser.
skip ' ' | '\t' | '\r' | '\n';
token <auto> T_KWD as uncase map {
<10> HELLO as 'hello',
<11> WORLD as 'world'
};
token <auto> T_SYM as map {
<12> EXC as '!',
<13> PRD as '.'
};
node <auto> N_KWD as map {
<20> T_KWD.HELLO & T_KWD.WORLD & opt (T_SYM.EXC | T_SYM.PRD)
};
- Create the input file.
Hello World!
heLo WoRlD.
- Run the parser by using the CLI:
xcm -s ./example.xcm -t ./input.txt --run --tokens --nodes
Learn more about XCHEME.
Take a look at the samples and learn even more.
See each package for more information.
- Core - Where the magic happens.
- Lang - Woah, a language for building languages.
- CLI - Put all these amazing things together.
All the packages and extensions in this project are covered by their respective licenses.
All other files are covered by the MIT license, see LICENSE.