[antlr-interest] Common prefixes

Monty Zukowski monty at codetransform.com
Tue Sep 7 08:54:28 PDT 2004


Look into lexer multiplexing.  
http://www.antlr.org/doc/lexer.html#Lexical_States

Monty


On Sep 7, 2004, at 8:43 AM, sofa_chef wrote:

> Hi,
> I spent some time looking for a way to solve this but I failed. I'll
> appreciate some advice.
>
> I want to parse lines of text. The lines include all kinds of words,
> numbers, expressions etc.
>
> I need to distinguish the lines according the first letter of the
> first word. This letter determines the format of the rest of the
> line. Identifying the first character will allow to use the correct
> set of tokens.
>
> The problem is that these first letters that identify the line
> format, can appear any place else in the lines. My standard word
> token includes these characters as well. This causes ambiguities and
> parsing errors.
>
> Example:
> Mline p1 p2 p3 p4 a=12 g=34 sdf sdf
> Rline p1 p2 asd=23 sdf
> Yline p1 p2
> etc.
>
> How do you suggest I approach this problem?
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>



 
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