[antlr-interest] lexer: compound keywords with a twist

向秦贤 fyaoxy at gmail.com
Sun Aug 19 18:03:49 PDT 2007


Hi,
As a just now newbie of antlr, my advice is just not let me faraway, closer
and closer to tutorials.
and as to language, do you real think that selection is necesary?
for parameter consideration, the way is good, but not necessary in my sight.
just IMHO:)

2007/8/20, Edwards, Waverly <Waverly.Edwards at genesys.com>:
>
>
> Hello,
>
> I'm a first time ANTLR user and I have some questions that I need some
> assistanc with.
> I am replicating an existing procedural BASIC dialect language compiler.
> I actually have
> multiple issues to overcome but this is the first one.  The language has
> *hundreds* of keywords.
> Many of the keywords are actually compound keywords
>
> Edit = numericVar
> Edit Field
> Edit Field Close
> Edit Menu
> Edit Text
> Compile Long If
>
> 1.  How would you define compound keywords?  The keyword "Edit" has 5
> different starts
> and the longest usage is a combination of three words
>
> 2.  Is it possible to deal with variable length keywords at the lexer
> level.
>
> stringVar = Edit$( vNumParam )
> Edit$( vNumParam ) = stringVar
>
> I have two instances where Edit$ ( different from Edit ) can be used.  One
> as a function
> and the other a procedure.  If Edit$ is on the left side of a variable
> it's a procedure and
> if on the right it's a function.  The perform different tasks.  Is there a
> way at the lexer
> level that I can pass the parser something like EditStatement vs
> EditFunction depending
> on what the lexer sees first.
>
> Thank you,
>
> W.
>



-- 
致敬
向秦贤
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070820/af2642a2/attachment.html 


More information about the antlr-interest mailing list