[antlr-interest] Overloaded Lexemes!

John D. Mitchell johnm-antlr at non.net
Sat May 1 10:43:42 PDT 2004


>>>>> "Steve" == Steve Taplin <steve_taplin at yahoo.co.uk> writes:
[...]

> Out of interest, the language I am parsing is quite poorly behaved.  That
> is, the string literals are not really identified syntactically (only
> semantically).  E.g.

> COMMENT TEXT(The next line prints an unblinking text string "My
> label")\r\n PRINT XCOORD(10 + X) YCOORD(20 + Y) LABEL(My label)
> BLINK(N)\r\n

> The language follows pattern of:

> COMMAND (PARAMETER)* '\r''\n'

Given your examples, isn't that more like:

COMMAND ( PARAMETER_NAME "(" parameter_data ")" )* "\r\n"


> Clearly, some values within the parentheses will need to be tokenised
> further whereas string literals need to be sent as tokens there and then.

Are the types of the "parameter data" based on the name of the
parameter?  If so, are the types of the parameter names fixed (i.e., are
they keywords) or do you only know them semantically (i.e., are they only
known dynamically)?

Take care,
	John


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list