Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Sequential parser

sanity edited this page · 2 revisions

LastCalc's parser is very sophisticated and has many components, but fortunately SequentialParser.java provides a very friendly high-level interface to it, which is used at various points through LastCalc's user-facing code.

Here is a simple usage example:

final SequentialParser sp = SequentialParser.create();
sp.parseNext("a=49+3");
final TokenList res = sp.parseNext("a+1");
System.out.println(res);

This will print "53".

You can see many other usage examples in SequentialParserTest.java - which also serves as a suite of integration tests for all of LastCalc's parsing code.

Something went wrong with that request. Please try again.