[antlr-interest] [BUG] in 2.7.2a2
mzukowski at yci.com
mzukowski at yci.com
Thu Oct 10 14:24:41 PDT 2002
You need to have your parser import the vocabulary from the lexer. See
http://www.antlr.org/doc/vocab.html and
http://www.antlr.org/doc/options.html#importVocab
Monty
> -----Original Message-----
> From: Ruslan Zasukhin [mailto:sunshine at public.kherson.ua]
> Sent: Thursday, October 10, 2002 1:17 PM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] [BUG] in 2.7.2a2
> Importance: High
>
>
> Hi Terrence,
>
> Please add this bug to your Notebook.
>
> 1) if put grammars of Lexer and Parser into different 2 files
>
> 2) and in Parser make rule that define imaginary tokens, e.g.
>
> ImaginaryTokens
> : SQL_STATEMENT
> | COLUMN_DEF
> ;
>
> Then on generation of parser from parser grammar
> ANLT not correctly assign values for these tokens and corrupt existed
> vocabulary of tokens created by lexer.
>
> For example, if lexer create
>
> DQUOTE = 4
> QUOTE = 5,
> STAR = 6,
> DOT = 7
>
> Then after parser.g compilation we get
>
> SQL_STATEMENT= 4
> COLUMN_DEF = 5,
> STAR = 6,
> DOT = 7
>
> I.e. Tokens DQUOTE and QUOTE simply disappear. :-(
>
> ------------------------
> 3) if put lexer.g into the same file where parser is, then
> this problem not
> happens.
>
> 4) it is never mind who first is compiled.
> At first we can compile parser.g, get vocabulary, but later lexer.g on
> compilation will corrupt it.
>
> 5) this Problematic tokens always start eat numbers from 4
>
>
> --
> Best regards,
> Ruslan Zasukhin [ I feel the need...the need for speed ]
> -------------------------------------------------------------
> e-mail: ruslan at paradigmasoft.com
> web: http://www.paradigmasoft.com
>
> To subscribe to the Valentina mail list
> send a letter to valentina-on at lists.macserve.net
> -------------------------------------------------------------
>
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list