commits

date

comment

94877
by Project Collectio...
(108 downloads)
Oct 1, 2012
10:38 PM

Upgrade: New Version of LabDefaultTemplate.xaml. To upgrade your build definitions, please visit the following link: http://go.microsoft.com/fwlink/?LinkId=254563

94876
by Project Collectio...
(0 downloads)
Oct 1, 2012
10:31 PM

Checked in by server upgrade

17706
by jeffmoser
(268 downloads)
Sep 22, 2008
11:57 PM

Added "Markup" project based off discussion question by nblumhardt on Codeplex. See http://www.codeplex.com/ometasharp/Thread/View.aspx?ThreadId=36146

17578
by jeffmoser
(4 downloads)
Sep 16, 2008
3:03 AM

Moved CalculatorParser to be siblings with the Calculator example.

17577
by jeffmoser
(1 download)
Sep 16, 2008
2:57 AM

Removed excess directories

17576
by jeffmoser
(1 download)
Sep 16, 2008
2:54 AM

Very initial check-in of some noticable restructuring of the entire project. Based off some good comments by Nicholas Blumhardt, I decided to do some re-arranging of the folders to improve the distinction between the core runtime, host languages, examples, and then unit tests. In addition, I created a console based interpreter playground where you can experiment with each grammar that you create. For example, if you set "Calculator" as your startup project and then run it, you can see a very primitive calculator in action :)

In addition, I put some work into the Prolog interpreter to make it handle basic queries via the console.

Each project has sample input and responses that are shown right when you start the project so you get a feel for what's expected.

Finally, the "README" project basically does what the previous unit test runner did (e.g. compile all grammars and run most tests).

I'd love to hear feedback if you download the code. My contact info is on my blog at http://www.moserware.com/

(NOTE: Since I did some heavy moving in the source code, there might be some problems synchronizing everything in TFS. It might take another changeset to remove extra files)

17196
by jeffmoser
(7 downloads)
Sep 8, 2008
2:00 AM

Added first glimpse of ideas for syntax sugar in the host semantic actions. I started with a simple list cons. This allows you to say { "add", x, y } instead of "Sugar.Cons("add", x, y)". This notably simplified CalculatorParser and NullOptimization grammars.

The eventual goal is that "Sugar" wouldn't have to be explicitly referenced in an action but would rather rely on the CSharpRecgonizer to convert the nicer syntax to a Sugar usage. The nicer syntax should play nice with the overal goals of C#.

16907
by jeffmoser
(1 download)
Sep 1, 2008
9:15 PM

Small update to Meta-FizzBuzz grammar by using C#'s type aliasing ability (e.g. "using E = System.Func<object>") to make the code less verbose. I'm not sure if this is best long term for readability/comprehension, but I do like how it makes things more compact.

16784
by jeffmoser
(7 downloads)
Aug 29, 2008
2:52 AM

Implemented support for automatic casting of a type in the semantic action and host expression part of a grammar (e.g. the C# part) based on a grammar default ("ometa Factorial<int, ***int***>") or by specifying the type by the variable capture. The former allows you to get a notably simpler Calculator, Factorial, LittleTypeChecker, and NumberParser (take a peek at their new version in this changesteThe latter allows "Super(Digit):d<int>".

The focus on this release is therefore less typing. Hopefully with a few more iterations will bring us closer to the compactness similar to what can occur in a dynamic language like JavaScript but being strongly typed.

16572
by jeffmoser
(10 downloads)
Aug 25, 2008
10:41 AM

Added a Meta-FizzBuzz implementation and two versions of FizzBuzz written in it.

16467
by jeffmoser
(3 downloads)
Aug 22, 2008
2:27 AM

Added support for defining overrides in a grammar via the ^ character.

For example, the Calculator grammar now has

Digit ^= Super(Digit):d -> { d.ToDigit() },

since it is overriding the "Digit" rule in its base grammar. This now generates an "override" in the C# code. With this extension, I can now emit enough information to get rid of the warning about unverifiable code from using a base class reference in an anonymous method. I do this by storing the reference to a local variable "__baseRule__".

For the first time, the entire OMeta project compiles without any warnings.

16203
by jeffmoser
(3 downloads)
Aug 15, 2008
3:45 AM

More syntax updates. I now make inheritance look more C++/C#-ish of "MyClass : BaseClass" instead of "MyClass <: BaseClass".

This was driven by another change that I made where I add types to the grammar definition to specify what goes in (e.g. "ometa OMetaTranslator<HostExpression> : Parser<HostExpression>").

This annotation used to be done in the tests themselves. Now it's right in the grammar itself (by default I assume a char input).

You can also define the "default" type as in "ometa Calculator<char, int> : Parser<char> {". My thought is that in an upcoming change I can dramatically simplify the calculator grammar (among others) by making it unnecessary to do all those .As<int>() and have that be automatic if you define a default.

16095
by jeffmoser
(0 downloads)
Aug 12, 2008
2:50 AM

Added preliminary support for namespaces. You can now use "using" statements like C# as well as specify a namespace prefix to your grammar name. If you don't specify one, defaults will be provided.

This is the first noticable addition to the grammar to make it more .NET friendly.

16066
by jeffmoser
(1 download)
Aug 11, 2008
1:48 AM

Added Prolog library and grammar that I translated based off of the ones on the OMeta/JS project. This shows a symbiosis of OMeta# for the language aspects and C# for other logic (e.g. Prolog's unification concept)

15986
by jeffmoser
(1 download)
Aug 9, 2008
3:50 AM

Removed about 30 lines from OMetaTranslator.ometacs by introducing a Format option to CodeGen. Slowly trying to get cleaner syntax.

15985
by jeffmoser
(0 downloads)
Aug 9, 2008
2:24 AM

Got rid of manually created grammar-ish code. Most notable is that the manual translator is out. The OMeta# one is quite a bit easier to understand.

This is symbolic of OMeta#'s future of more of it being written in itself. This requires removing the hints of the past where we had to manually bootstrap ourself :-)

15984
by jeffmoser
(0 downloads)
Aug 9, 2008
2:14 AM

Updated OMetaParser's HostExpr and C# recognizer so that a HostExpr is

Expr = ParenExpr | Spaces (StringLiteral | FunctionCall | BasicName)

This finally allows for less ()'s

Compare

Block = EverythingInside(("{"), ("}"))

With

Block = EverythingInside("{", "}")

15954
by jeffmoser
(2 downloads)
Aug 8, 2008
2:52 AM

OMeta# now bootstraps itself!

Added a OMetaTranslator written in OMeta# to make this happen. This involved a new grammar (OMetaTranslator.ometacs). As of this check-in, no manually "parsed" grammar-ish code is used and thus the code generates the code that generates the code.

This is a notable milestone in this project because the recognizer -> parser -> translator chain is a reasonably complex grammar and is a good proof of concept.

This will probably be the last changeset that has the manually created code in it. I'll use TFS to preserve the roots of where it came from so that the main project isn't littered with it.

The next major step is to clean things up in preparation of CTP 1.


15766
by jeffmoser
(5 downloads)
Aug 2, 2008
5:50 PM

OMeta# now has an optimzer that was written in OMeta#!

Most of the code was just a port of the OMeta/JS optimizer. See the NullOptimization.ometacs, AndOrOptimization.ometacs, and OMetaOptimizer.ometacs grammars for more details.

One of the most fascinating lines of OMeta# is this one:

OptimizeRule = :r (Foreign((typeof(AndOrOptimization)), ("Optimize"), (r)):r)* -> { r }

This basically keeps optimizing a rule until it can't be optimized any further. Very neat way of expressing it.

The optimizer is making a noticable improvement in generated code. Average savings is around 15% for simple grammars and 40% for more complicated ones. For example, the OMetaParser.cs generated code shrank from 3022 lines to 1843 lines with the optimizer turned on. A savings of 1179 lines or 39%.

The next piece of optimization will be to eliminate unnecessary wrapped functions from And expressions. That is, if the MetaRules.Apply(...) is the only function, then just generate the inner scope instead of wrapping it.

I'll defer this this last major optimization until after the code generator is rewritten into OMeta#.

15748
by jeffmoser
(4 downloads)
Aug 2, 2008
2:52 AM

Fixed the RegularString rule. Forgot to implode the list of EscapedChar's

15710
by jeffmoser
(0 downloads)
Aug 1, 2008
3:31 AM

Oops. Forgot to actually turn on OMetaParser. Previous version was using ManualOMetaParser. This exposed a bug in my implementation of RegularString that I'll need to fix soon.

15493
by jeffmoser
(5 downloads)
Jul 27, 2008
11:23 PM

Did work on CSharpRecognizer.ometacs so that it works properly. This required some changes in other spots to fix up a few problems.

Now OMeta# can parse itself and the C# recognizer. Furthermore, the generated parser now uses the generated C# recognizer.

15383
by jeffmoser
(0 downloads)
Jul 26, 2008
2:17 AM

OMetaParser.ometacs is feature complete! It can be used to generate a parser that parses itself. All internal non-manual tests are now using that parser instead of the ManualOMetaParser.

It's definitely getting neater :-)

There are still some issues with the C# recognizer not imploding things correctly. Additionally, inline comments in grammars seems to be troublesome.

15349
by jeffmoser
(0 downloads)
Jul 25, 2008
12:18 PM

Added Args, Application, SemAction , and SemPred to OMetaParser.ometacs

15341
by jeffmoser
(0 downloads)
Jul 25, 2008
3:47 AM

Updated OMetaParser.ometacs to support calling into the C# recognizer foreign grammar. This discovered some glitches with my generated C# recognizer not imploding strings correctly (e.g. converting a list of characters into a single string). This will need to get fixed soon.