[antlr-interest] [BUG] in 2.7.2a2

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Oct 10 15:45:31 PDT 2002


on 10/11/02 12:24 AM, mzukowski at yci.com at mzukowski at yci.com wrote:

> 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

I believe I have made this, otherwise how antlr could find EXISTED
vocabulary to corrupt it? :-)

PLEASE note, that there is no problem with new tokens that add parser if
they just literals:

    "create" "table"

Then Parser simply add to vocabulary

    LITERAL_create
    LITERAL_table

All right.

Problem happens only if add dummy rule, where simply list imaginary tokens.
Here ANTLR fails.


> 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.   :-(

-- 
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/ 



More information about the antlr-interest mailing list