grammatica-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Grammatica-users] Grammar for expression...?


From: Morten Aune Lyrstad
Subject: [Grammatica-users] Grammar for expression...?
Date: Tue, 19 Dec 2006 15:50:36 +0100
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

I have downloaded Grammatica for use with my scripting language Storyteller. I have serious problems understanding the more advanced grammar. I need to extend the expression grammar you have given in your example:

Expression = Term [ExpressionTail] ;

ExpressionTail = "+" Expression
             | "-" Expression ;

Term = Factor [TermTail] ;
   TermTail = "*" Term
       | "/" Term ;

Factor = Atom
     | "(" Expression ")" ;

Atom = NUMBER
   | IDENTIFIER ;


into one that is capable of handling all of a programming language's common operators, like 'and', 'or', > etc. However, I don't really understand what is going on here, and because of that I cannot extend it. Why are the operators divided into two "tails"? And does this support unary operators? Where should I add my other operators?

I was hoping you could give me a hand?

Thank you,
Morten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]