This project has moved and is read-only. For the latest updates, please go here.


Nov 21, 2009 at 11:29 AM


i need some help.

i would parse this structur:


class test

Content is free text.

I do it with this definition:

var compilation_unit = new NonTerminal("compilation_unit");
var class_declaration = new NonTerminal("class_declaration");
var class_body = new NonTerminal("class_body");
var freeTextLiteral = new FreeTextLiteral("freeTextLiteral", "\n", "\r", Environment.NewLine);
var description = new NonTerminal("description");
IdentifierTerminal identifier = TerminalFactory.CreateCSharpIdentifier("Identifier");

KeyTerm Lbr = ToTerm("{");
KeyTerm Rbr = ToTerm("}");

this.Root = compilation_unit;
compilation_unit.Rule=  class_declaration;
class_declaration.Rule = "class" + identifier + Lbr +  class_body + Rbr;
class_body.Rule = description;
description.Rule = Empty | freeTextLiteral;

But it doesnt work.
The error is: "Syntax error, expected: freeTextLiteral. }"

The Testdata is:
class test

Can someone help me?

Nov 22, 2009 at 2:01 AM

Try with the latest source version, I've fixed some bugs related to FreeTextLiteral

Also look at this thread:

Follow the example at the end.