canna71 / jacob Goto Github PK
View Code? Open in Web Editor NEWA lexer and parser generator in JavaScript for DSL and custom languages in the browser and Node.js
A lexer and parser generator in JavaScript for DSL and custom languages in the browser and Node.js
I'm working on a single page web app where I would love to include Jacob as a client side service. The current code contains a lot of requires (node includes). I do not require filesystem - just generating compilers/interpreters from grammar strings on the fly. Is this technical possible or is this waste of time if I try to delete all node.js dependencies?
Hi, I just recently discovered Jacob and the world of lexers/parsers so I don't know many about them.
I have a parser that allows me to parse a function call that looks like that:
exec myfunc(myvar)
exec myfunc("mytext")
Expression = 'DEFINED' 'ID' 'LBRACE' ('ID'|'MESSAGE') 'RBRACE' function(defined, id, _){console.log(defined, id, [...arguments].slice(3, -1));}
however, this parser only allow me to have one argument. I tried using regex to allow more but got rejected by the compiler.
Is it possible? Is there another way I didn't think of?
Hi,
I spoted a bug in the Lexer:
This example expose the issue:
If we have those tree rules:
<> abc {console.log(`abc = ${this.jjtext}`);}
<> a {console.log(`a = ${this.jjtext}`);}
<> b {console.log(`b = ${this.jjtext}`);}
And we set the input : "abcab"
We expect to get:
abc = abc
a = a
b = b
But we get:
abc = abc
a = ab
Jacob is, in my oppignion, the best parser generator avalible for the platform if this bug could be fixed it would be awesome.
Cheers
Calling jacob from the the command line gives this:
/usr/bin/env 'node\r' : No such file or directory
This is because there's an extra \r in the file:
jacob/cmd/cmd.js
At first line, when it tries to use the shebang:
#! /usr/bin/env node
If anybody has this issue, you can fix it with vim:
:set ff=unix
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.