learning compiler: lexer, parser, whatever
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Heiko Hübscher e0ca155d65 [js] add unary operator 8 months ago
js [js] add unary operator 8 months ago
.editorconfig [js] arithmetic expression parser and interpreter 8 months ago
.gitignore [js] arithmetic expression parser and interpreter 8 months ago
Main.hs [haskell] add rule for left associativity for three terms 8 months ago
makefile [js] arithmetic expression parser and interpreter 8 months ago
package-lock.json [js] arithmetic expression parser and interpreter 8 months ago
package.json [js] arithmetic expression parser and interpreter 8 months ago
readme.md [js] add unary operator 8 months ago

readme.md

javascript

stack:

  • web packer parcel, includes babel
  • test runner/framework/assertions/foo: jest

quick start:

npm install
npm test
npm test -- --coverage
npm test -- --watch

implements input stream, token stream (lexer), parser (recursive descent) and interpreter for arithmetic expressions following tutorial how to implement a programming language in javascript.

steps:

  • input stream, token stream
  • parser, interpreter
    • literals
    • left-to-right vs right-to-left
    • operator precedence
    • paren precedence
    • unary operator

haskell

following tutorial

:l Main
expression "2+4"