[antlr-interest] One step further but still error when checking grammar

Mikael Petterson mikael.petterson at ericsson.com
Tue Sep 9 06:57:49 PDT 2008


Hi,

I added as suggested a:
@header{
package net.sourceforge.clearcase.commandline.parser;

import net.sourceforge.clearcase.ClearCase;
import net.sourceforge.clearcase.ClearCaseElementState;
import net.sourceforge.clearcase.ClearCaseElementStateStream;
import net.sourceforge.clearcase.ClearCaseException;
}

options {
output=AST;
}


@lexer::header{
package net.sourceforge.clearcase.commandline.parser;
}


At least this is what I think you suggested.  Correct me if I am wrong,
which I probably is ;-)

Then I try to ceck my grammar again. Still unknown errors, at least for
me as a newbie.

15:53:50] Checking Grammar...
[15:53:50] error(100): CleartoolOutput.g:13:1: syntax error: antlr:
CleartoolOutput.g:13:1: unexpected token: options {
[15:53:50] warning(149): CleartoolOutput.g:0:0: rewrite syntax or
operator with no output option; setting output=AST
[15:53:50] error(150):  grammar file CleartoolOutput.g has no rules
[15:53:50] error(100): CleartoolOutput.g:0:0: syntax error:
assign.types: <AST>:0:0: unexpected end of subtree
[15:53:50] error(100): CleartoolOutput.g:0:0: syntax error: define:
<AST>:0:0: unexpected end of subtree
[15:53:50] java.lang.NullPointerException
	at
org.antlr.tool.DefineGrammarItemsWalker.trimGrammar(DefineGrammarItemsWa
lker.java:93)
	at
org.antlr.tool.DefineGrammarItemsWalker.finish(DefineGrammarItemsWalker.
java:76)
	at
org.antlr.tool.DefineGrammarItemsWalker.grammar(DefineGrammarItemsWalker
.java:205)
	at org.antlr.tool.Grammar.defineGrammarSymbols(Grammar.java:651)
	at
org.antlr.tool.CompositeGrammar.defineGrammarSymbols(CompositeGrammar.ja
va:350)
	at org.antlr.tool.Grammar.setGrammarContent(Grammar.java:564)
	at
org.antlr.works.grammar.antlr.ANTLRGrammarEngineImpl.createNewGrammar(Un
known Source)
	at
org.antlr.works.grammar.antlr.ANTLRGrammarEngineImpl.createParserGrammar
(Unknown Source)
	at
org.antlr.works.grammar.antlr.ANTLRGrammarEngineImpl.createCombinedGramm
ar(Unknown Source)
	at
org.antlr.works.grammar.antlr.ANTLRGrammarEngineImpl.createGrammars(Unkn
own Source)
	at
org.antlr.works.grammar.antlr.ANTLRGrammarEngineImpl.analyze(Unknown
Source)
	at
org.antlr.works.grammar.engine.GrammarEngineImpl.analyze(Unknown Source)
	at org.antlr.works.grammar.CheckGrammar.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:595)

cheers,

//mike


Mikael Petterson
Software Designer


Ericsson AB, Stockholm, Sweden
Visiting address: Isafjordsgatan 15, Kista
Phone: +46 70 2673044 
E-mail: mikael.petterson at ericsson.com 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080909/1da4c884/attachment.html 


More information about the antlr-interest mailing list