atorstling / bychan Goto Github PK
View Code? Open in Web Editor NEWA Pratt (TDOP) Expression Parser Library for Java
License: MIT License
A Pratt (TDOP) Expression Parser Library for Java
License: MIT License
This library is absolutely a wonderful treasure I've found. Thank you.
The solution might already exist, if that's the case, then I couldn't find it. Perhaps writing a documentation would attract more people using it?
Anyway, Is there a way to elegantly abort evaluation with a runtime error message similar to parser.abort()
? For example, divide-by-zero error or arithmetic errors. I just don't want to see a log from Java. Or do I have to extend Repl
? In any case, I think it would be a good thing to have a switch on whether or not to dump the whole error log while running Repl.
So no more TokenType
Perhaps a method on parseresult? parsedAllTokens ()
Does it work satisfactory?
I just checked out the minilang example and read through the code. When I saw the StatementNode
, I was struggling to find a way to add an ending semicolon for conventional purpose. In your example, the ;
is used to separate statements, but there isn't a way to end a script with the last statement ending with a ;
because the parser isn't able to parse the end and would result in:
'Premature end reached' @ position ..., current lexeme is END ...
Is there a way to check whether the next token is the END
or is what I'm thinking incorrect and looking ahead isn't the right thing to do and that there are other ways?
Such as those with level-1
What happens if you input the empty string to parse?
Make sure we get nice errors
Do not group all params but group to get (previous, lexeme, parser)
V2 introduces unwanted cross-dependencies.
previous -> left?
bindingpower should be consistently named
infix, suffix -> nud, led?
same infix and suffix iface?
Make an automatic repl with Language.repl().run()
Also check if there are non-registered tokens which are being referred (tokens not belonging to current lang).
Both mem and cpu
Rename "parent" to "scope"? Which type? New type param?
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.