Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gold Grammar Sample not working #21

Open
mywyb2 opened this issue May 2, 2015 · 2 comments
Open

Gold Grammar Sample not working #21

mywyb2 opened this issue May 2, 2015 · 2 comments

Comments

@mywyb2
Copy link

mywyb2 commented May 2, 2015

I tried the sample from http://goldparser.org/doc/grammars/, but this gives me a KeyNotFoundException:

            var grammar = new GoldGrammar().Build(@"
Id = {Letter}{AlphaNumeric}*


<Statement> ::= if Id then <Statement>
              | if Id then <Then Stm> else <Statement>
              | Id ':=' Id


<Then Stm>  ::= if Id then <Then Stm> else <Then Stm>
              | Id ':=' Id
");
@cwensley
Copy link
Member

cwensley commented May 3, 2015

That looks like an incomplete grammar. You are required to include the "Start Symbol" property. E.g.

"Start Symbol" = <Statement>

See http://goldparser.org/doc/grammars/define-properties.htm for a list of gold grammar properties

@mywyb2
Copy link
Author

mywyb2 commented May 3, 2015

Thanks, I didn't know that. However, after adding the required line, I still get the same KeyNotFoundException. I also tried the "Simple" grammar from http://www.goldparser.org/grammars/index.htm - again the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants