Search the web
Sign In
New User? Sign Up
GOLDParser · GOLD Parsing System
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Hyphen in identifier   Message List  
Reply | Forward Message #3434 of 3473 |
Re: [GOLD Parser] Hyphen in identifier

I ended up doing this:

{ID Head} = {Letter} + [_] - [:.]
{ID Tail} = {AlphaNumeric} + [_-] - [:.]


Identifier = {ID Head} {ID Tail}*

My Identifier can not start with a number.

I think the - [:.] part may not be needed but I will include it for clarity.

Thanks for the help.

Truman

--- In GOLDParser@yahoogroups.com, "Devin Cook" <GOLD-Admin@...> wrote:
>
> You define your Identifier set as:
>
>
>
> {ID} = {Letter} + {Digit} + [_-] - [:]
>
>
>
> Which includes the single dash. You also defined your identifier terminal
> as:
>
>
>
> Identifier = {ID}
>
>
>
> This means that your identifier will contain one character from the {ID}
> set. You can remove the dash from the {ID} set. The set also contains the
> digit set, so it includes 0.9. This means that that your identifier can also
> be a number such as 9. I would recommend changing your definitions to:
>
>
>
> {ID} = {Letter} + {Digit} + [_]
>
>
>
> Identifier = {Letter}{ID}+
>
>
>
>
>
> - Devin
>
>
>
>
>
> _____
>
> From: GOLDParser@yahoogroups.com [mailto:GOLDParser@yahoogroups.com] On
> Behalf Of lacktrum
> Sent: Friday, April 03, 2009 5:20 PM
> To: GOLDParser@yahoogroups.com
> Subject: [GOLD Parser] Hyphen in identifier
>
>
>
> I am new to this and I am trying to parse a conditional and math script that
> I am developing.
>
> I am failing on hyphens in the Identifiers and the math -.
>
> Failing on:
> Line / State 34 Reduce-Reduce Conflict
>
> My grammar:
>
> "Name" = 'Operation'
> "Author" = 'Truman Lackey'
> "Version" = '0.01'
> "About" = 'Comparison and mathematical operators'
>
> "Start Symbol" = <Statement>
>
> ! ------------------------------------------------- Sets
>
> {ID} = {Letter} + {Digit} + [_-] - [:]
> {String Ch} = {Printable} - ["]
> {Char Ch} = {Printable} - ['']
> {Hex Digit} = {Digit} + [abcdef] + [ABCDEF]
>
> ! ------------------------------------------------- Terminals
>
> Identifier = {ID}
> MemberName = '.' {ID}
> DecLiteral = {Digit}+ ( [UuLl] | [Uu][Ll] | [Ll][Uu] )?
> HexLiteral = '0'[xX]{Hex Digit}+ ( [UuLl] | [Uu][Ll] | [Ll][Uu] )?
> RealLiteral = {Digit}*'.'{Digit}+
> StringLiteral = '"'( {String Ch} | '\'{Printable} )* '"'
> CharLiteral = '' ( {Char Ch} | '\'{Printable} )''
>
> <Valid ID>
> ::= Identifier
>
> <Qualified ID>
> ::= <Valid ID> <Member List>
>
> <Member List>
> ::= <Member List> MemberName
> | !Zero or more
>
> <Literal>
> ::= true
> | false
> | DecLiteral
> | HexLiteral
> | RealLiteral
> | CharLiteral
> | StringLiteral
> | null
>
> ! ------------------------------------------------- Rules
>
> <Expression>
> ::= <Conditional Exp> '=' <Expression>
> | <Conditional Exp> '+=' <Expression>
> | <Conditional Exp> '-=' <Expression>
> | <Conditional Exp> '*=' <Expression>
> | <Conditional Exp> '/=' <Expression>
> | <Conditional Exp> '^=' <Expression>
> | <Conditional Exp> '&=' <Expression>
> | <Conditional Exp> '|=' <Expression>
> | <Conditional Exp> '%=' <Expression>
> | <Conditional Exp> '<<=' <Expression>
> | <Conditional Exp> '>>=' <Expression>
> | <Conditional Exp>
>
> <Conditional Exp>
> ::= <Or Exp> '?' <Or Exp> ':' <Conditional Exp>
> | <Or Exp>
>
> <Or Exp>
> ::= <Or Exp> '||' <And Exp>
> | <And Exp>
>
> <And Exp>
> ::= <And Exp> '&&' <Logical Or Exp>
> | <Logical Or Exp>
>
> <Logical Or Exp>
> ::= <Logical Or Exp> '|' <Logical Xor Exp>
> | <Logical Xor Exp>
>
> <Logical Xor Exp>
> ::= <Logical Xor Exp> '^' <Logical And Exp>
> | <Logical And Exp>
>
> <Logical And Exp>
> ::= <Logical And Exp> '&' <Equality Exp>
> | <Equality Exp>
>
> <Equality Exp>
> ::= <Equality Exp> '==' <Compare Exp>
> | <Equality Exp> '!=' <Compare Exp>
> | <Compare Exp>
>
> <Compare Exp>
> ::= <Compare Exp> '<' <Shift Exp>
> | <Compare Exp> '>' <Shift Exp>
> | <Compare Exp> '<=' <Shift Exp>
> | <Compare Exp> '>=' <Shift Exp>
> | <Shift Exp>
>
> <Shift Exp>
> ::= <Shift Exp> '<<' <Add Exp>
> | <Shift Exp> '>>' <Add Exp>
> | <Add Exp>
>
> <Add Exp>
> ::= <Add Exp> '+' <Mult Exp>
> | <Add Exp> '-' <Mult Exp>
> | <Mult Exp>
>
> <Mult Exp>
> ::= <Mult Exp> '*' <Unary Exp>
> | <Mult Exp> '/' <Unary Exp>
> | <Mult Exp> '%' <Unary Exp>
> | <Unary Exp>
>
> <Unary Exp>
> ::= '!' <Unary Exp>
> | '~' <Unary Exp>
> | '-' <Unary Exp>
> | '++' <Unary Exp>
> | '--' <Unary Exp>
> | <Negate Exp>
>
> <Negate Exp>
> ::= '-' <Primary>
> | <Primary>
>
> <Primary>
> ::= <Qualified ID>
> | <Literal>
>
> <Statement>
> ::= <Expression>
>
> Help in fixing this would be appreciated.
>
> Thanks,
>
> Truman
>
>
>
>
>
> [Non-text portions of this message have been removed]
>





Mon Apr 6, 2009 4:39 pm

lacktrum
Offline Offline
Send Email Send Email

Forward
Message #3434 of 3473 |
Expand Messages Author Sort by Date

I am new to this and I am trying to parse a conditional and math script that I am developing. I am failing on hyphens in the Identifiers and the math -. ...
lacktrum
Offline Send Email
Apr 5, 2009
9:24 pm

You define your Identifier set as: {ID} = {Letter} + {Digit} + [_-] - [:] Which includes the single dash. You also defined your identifier terminal as: ...
Devin Cook
GOLD-Admin@...
Send Email
Apr 6, 2009
5:55 am

I ended up doing this: {ID Head} = {Letter} + [_] - [:.] {ID Tail} = {AlphaNumeric} + [_-] - [:.] Identifier = {ID Head} {ID Tail}* My...
lacktrum
Offline Send Email
Apr 6, 2009
8:00 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help