Giter Club home page Giter Club logo

zen-parser's Introduction

Sup everyone

My name is Alexander Churbakov, I am Fullstack JS/TS developer with more than 8 years of experience.

Interests

Leeetcode

I love to solve leetcode tasks. I've already solved 110 of them. Check out

Chess

My rating on lichess: Blitz: 1177, Rapid: 1223, Puzzle: 1612. Play with me

zen-parser's People

zen-parser's Issues

Prepare 0.1.0 release ๐Ÿ•’ 2.6

Description

Prepare 0.1.0 release to make zen-parser usable on my another project.

Tasks

  • Make correct errors throwing ๐Ÿ•’ 1.0
  • Remove typo bug in isMachinDone ๐Ÿ•’ 0.1
  • Refactor things ๐Ÿ•’ 1.0
  • Update Readme ๐Ÿ•’ 0.5

Add whitespace

Error: Parsing Error expected $, semicolon, but got equal, at 27,expected $, semicolon, but got equal, at 27

Correct errors throwing

I can't see the way to do it now. It seems like it's impossible with current parser organization to say what's an error.

My suggestion is: if no rules full match and no rules part match - there is a mistake.

Add caching

Make every rule cacheable with state handling like this:

match: {
  cache: (function () {
    let state = 'nope';
    return function (token) {
      if (state === 'nope' && token.type === 'fist-token-in-grammar') {
        state = 'first-token-found';
        return 'part';
      } else { ... }
    };
  })()
}

and remove other modes, let's make only stream mode

Add Lexer

Better we do it like stream mode

So we just take a symbol and do the same as we did for grammar

Overlaying rules bug

Problem

  [ 
    rule(['word', 'function-definition', 'raw'] ... ),
    rule(['word'] ... ),
  ]

Anyway whatever algorythm we choose, one of those rules will never apply.

Solution

We can extend rules to take N next tokens. And we can add recalculation.

Better solution

Switch to GLR algorythm.

Improve Errors

Remove non terminals from syntax error output.

For this we need to rework lexer to make terminals accessible from parser

Prepare 1.0.0 release

Description

Prepare a full stable release for zen-parser

Tasks

  • Add Stream Mode support

Attempt to realize Kumir

It should support:

  • movement commands
  • paint/unpaint
  • function definitions (with parameters)
  • cycles
  • branching
  • variables
  • walls checking
  • cycles break
  • returns
  • is checking (==) and > and < and >= and <=
  • bool and string and number types
  • comments

For example:

down
while wall on the bottom and not wall on the right
  right
  paint
down
paint

if wall on the left
  return

declare goUntilWall (direction) ->
  if direction is 'right'
    while not wall on the right
      right

Check performance

I think I can compare it to jison on some synthetic examples e.g. Jade, HTML, JSON, brainfuck and Thue

  • Test across those langs
  • Test with errors
  • Test with big auto generated data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.