Scope provider stops working with UPPER_CASE_ID terminal rule [message #1016159] |
Tue, 05 March 2013 10:01 |
Neeraj Bhusare Messages: 177 Registered: July 2009 Location: Canada |
Senior Member |
|
|
Hi,
I have two DSL's below. In the Entity DSL, if I change the Attribute rule to [0], the scope provider in the Function DSL stops returning me the list of Entity attributes. Is there a way I could fix this ? I am going through the implementation of the Scopes class, but so far I haven't found a solution. Any thoughts ?
[0]
Attribute:
name=UPPER_CASE_ID ':' type=DataType
-------------------Function DSL------------------------------------------------------
....
....
Function:
'func' name=ID '('parameters+=Parameter (',' parameters+=Parameter)* ')' '{'
body += Body (';' body += Body)*
'}'
;
Body:
object=[Parameter] tail=AttributeReference?
;
Parameter:
name=ID ':' type=[entity::Entity]
;
AttributeReference:
'.' attribute=[entity::Attribute]
;
---------------------------Entity DSL------------------------------------------------
....
....
Attribute:
name=ID ':' type=DataType
terminal UPPER_CASE_ID : '^'?('A'..'Z'|'_') ('A'..'Z'|'_'|'0'..'9')*;
-------------------------------------------------------------------------------------
Thanks in advance,
Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
[Updated on: Tue, 05 March 2013 10:03] Report message to a moderator
|
|
|
|
Re: Scope provider stops working with UPPER_CASE_ID terminal rule [message #1016845 is a reply to message #1016159] |
Thu, 07 March 2013 21:15 |
Neeraj Bhusare Messages: 177 Registered: July 2009 Location: Canada |
Senior Member |
|
|
Hi Christian,
Thanks for the reply. Yes, the grammar is incomplete. I had posted only the relevant parts of it.
1) I am aware that the UPPER_CASE_ID rule shadows/collides with the ID rule in some cases. For example, in the above dsl, if I was to define function name with all upper case, I would see the error - mismatched input 'FUNTIONFOO' expecting RULE_ID. Out of curiosity, is there a way we could fix this issue ?
2) xx=[Type|UPPER_CASE_ID] worked.
Thanks for the help.
Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
[Updated on: Thu, 07 March 2013 21:16] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03844 seconds