Adding a lex parsing rule similar to IDENT
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Brian_Lunny
Posted On:   Wednesday, June 5, 2002 06:34 AM

Hi all I'm trying to add a rule to the Lex parser for a type that is similar to IDENT. IDENT options {trueLiterals=true;} :('a'..'z'|'A'..'Z') ('a'..'z'|'A'..'Z'|'0'..'9')* ; An example sequence that I'm parsing is eventInfo = struct org::parlay::services::TpCallEventInfo The rule I have created is desc EQUALS parlay_desc where parlay_desc is defined as parlay_desc :('a'..'z'|'A'..'Z'|':')+ ; This is clashing with IDENT, can anybody suggest how to < rewrite the parlay_desc rule ?    More>>

Hi all


I'm trying to add a rule to the Lex parser for a type that
is similar to IDENT.


IDENT

options {trueLiterals=true;}

:('a'..'z'|'A'..'Z') ('a'..'z'|'A'..'Z'|'0'..'9')*

;


An example sequence that I'm parsing is

eventInfo = struct org::parlay::services::TpCallEventInfo


The rule I have created is

desc EQUALS parlay_desc


where parlay_desc is defined as


parlay_desc

:('a'..'z'|'A'..'Z'|':')+

;



This is clashing with IDENT, can anybody suggest how to <
rewrite the parlay_desc rule ?


Thanks,


Brian.

   <<Less

Re: parlay_desc rule proposition

Posted By:   Lionel_Corgnet  
Posted On:   Thursday, June 6, 2002 12:41 AM

I'd suggest..


parlay_desc

:('a'..'z'|'A'..'Z') (""::"" ('a'..'z'|'A'..'Z')+)*

;


You may need to decompose it.
About | Sitemap | Contact