Skip to content
/ xcheme Public

A set of tools that includes a new programming language to generate lexers and parsers for other languages.

License

Notifications You must be signed in to change notification settings

sbalmt/xcheme

Repository files navigation

XCHEME Logo

ts license

A set of tools that includes a programming language for generating lexers and parsers for other languages.

Get started

  1. Install the CLI:
npm i @xcheme/cli
  1. 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)
};
  1. Create the input file.
Hello World!
heLo WoRlD.
  1. Run the parser by using the CLI:
xcm -s ./example.xcm -t ./input.txt --run --tokens --nodes

Documentation

Learn more about XCHEME.

Samples

Take a look at the samples and learn even more.

Packages

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.

License

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.