Yttrium Parser: Grammar Preview

Like Math.NET Classic, Yttrium will provide a parser to construct a system from an infix string. During the last two days I've begun writing the parser, based on the new more systematic parsing infrastructure introduced in (never released) Symbolics Classic v0.19. Porting to Yttrium has shown to be astonishingly easy and quickly even though the completely different target. I could reuse about 80% of the code directly - looks like for once the modular architecture really made sense. Remember that due to the dynamic and configurable behavior the grammar is (at least in my opinion) not suitable for EBNF-like parser generators. The Language is not context-free, at least not in the strict textbook sense.

Some samples how the new Yttrium language will look like (most of it is already realized in code and working, but still easy modifiable - feedback is very welcome):

Concurrent signal assignment

Procedural assignments we know from classic imperative languages don't exist:

1: 
2: 
res <- a + b*c;
projection <- <vec,orthonormalBase[1]>;

Instantiation

Ports may define multiple outputs:

1: 
instantiate + in a,b out c;

Defining new entities and architectures

1: 
2: 
3: 
4: 
define entity Work.Test "test" function in x,c out y;
define architecture Work.TestArch Work.Test { y <- x * c; };
instantiate Work.Test in x->a,c->a*b out res;
res2 <- test(a*b,b);

Signal forwarding to the application

Other operations like signal assignments return signals as well:

1: 
2: 
3: 
res2;
a*sin(b);
derive(a*b,a);

Signal properties

This part is not fix yet:

1: 
2: 
3: 
4: 
assume m is Constant,PositiveInteger;
assume m is not Std.Constant;
assume m remove Std.PositiveInteger;
assume m remove all;

Feedback?

val sin : value:'T -> 'T (requires member Sin)

Full name: Microsoft.FSharp.Core.Operators.sin
val not : value:bool -> bool

Full name: Microsoft.FSharp.Core.Operators.not