Close to Boot Strapping Oilexer

Rating: No reviews yet
Downloads: 31
Change Set: 111564
Released: Jul 12, 2015
Updated: Jul 12, 2015 by AlexanderMorou
Dev status: Alpha Help Icon

Recommended Download

Application Oilexer Pre-Pre-Pre-Alpha (x64)
application, 4855K, uploaded Jul 12, 2015 - 31 downloads

Release Notes

This is a debug build of the most recent release (as of commit 111564.) I built this by downloading the commit and extracting it (and Abstraction) and building from Abstraction.

To export a series of .cs files for the Oilexer sample grammar, use the following command (from a command prompt):
OILexer.exe "Samples\Oilexer\Oilexer.oilexer" -ex:cs

The other supported export is 't-html' which will build the result as a set of traversable HTML files if you prefer to look at the source, for whatever reason, sample command (from a command prompt):
OILexer.exe "Samples\Oilexer\Oilexer.oilexer" -ex:t-html

Also included in samples is a Command Line Argument parser, if you wanted to easily identify the components of a set of command line args. Later I'll add a 'StringStream' for simpler parsers like this, but in my own testing it seems to work well.

The final test grammar is a very simple left-recursive calculator grammar that supports Addition, Subtraction, Multiplication, Division and the Modulus operator. This supports proper order of operations, but a caveat: it does not evaluate because OILexer provides no semantic predicates to understand the parse, it's just supposed to do the heavy lifting of order of operations, scanning, and parsing. There is a provided Visitor model that supports a type-parameter TResult that you might be able to build a functioning calculator without too much trouble.

Note
If you saw the previous release, a few minutes ago, it was removed due to a logic error that had to be fixed. Last minute issues always hit. :)

You can see the StringStream here, if you want to test the command-line parser:
https://oilexer.codeplex.com/SourceControl/latest#Parsers/OILexer/StringStream.cs

Note on Command Line Argument Parser
This sample is intended to make it easy to parse the command line if you need to pull data out of the arguments usually sent into the Main(string[] args), you wouldn't parse the arguments from that but rather Environment.CommandLine, and skip the first arg (the executable name).

Note 2
There is no error recovery at this time, that's the current task. Followed by 'Follow ambiguities for reductions within predictions', which is as fun as it sounds.

Reviews for this release

No reviews yet for this release.