[antlr-interest] Problem creating CSharp output

Christian Ulrich christianhofmann_de at yahoo.de
Mon Apr 9 06:41:45 PDT 2007


Hello,

I'm new to ANTLR and AntlrWorks.
So, I've tried a very simple grammar by scratch.
Using the java code generation from the command line
and from Antlrworks the tool generates the java
output. 
By switching to CSharp code generation the tool won't
generate any output.
Does anyone know why this problem occure?
Any help is appreciated.
Thanks

Here's the grammar:
grammar BarcodeValidator;

options {
	language=CSharp;
	k=1;
}

@header {
}

/* class BarcodeLexer extends Lexer; */

BEGIN_SECTION : '['
	;
	
END_SECTION : ']'
	;
	
EQUAL	: '='
	;
		
WS      : (' ' | '\t' | '\n' {newline();} | '\r')+
/*	  { $setType(Token.SKIP); } */
        ;
		
HEADER 	: 'HEADER'
	;
	
INT	: ('0'..'9')+	
	;	
	
DOCUMENT : 'DOC' ('0'..'9')+
	;	

BLOCKID : 'CF_' ('0'..'9')+
	;
	
BLOCKID_KEY :	'BLOCKID'
	;
		
/* class BarcodeParser extends Parser; */

header_section 	: head_sec
	;
	
protected 
head_sec : BEGIN_SECTION HEADER END_SECTION
	 BLOCKID_KEY EQUAL (BLOCKID|)
	;
	

and here are the error message(s):
no such locale file
org/antlr/tool/templates/messages/languages/de.stg
retrying with English locale ANTLR Parser Generator 
Version 3.0b6 (Jan 31, 2007)  1989-2007
error(10):  internal error: group CSharp does not
satisfy interface ANTLRCore: missing templates
[lexerRulePropertyRef_start,
lexerRulePropertyRef_stop]

error(10):  internal error: group CSharp does not
satisfy interface ANTLRCore: mismatched arguments on
these templates [outputFile(LEXER, PARSER,TREE_PARSER,
actionScope, actions, docComment, recognizer, name,
tokens, tokenNames, rules, cyclicDFAs, bitsets,
buildTemplate, buildAST, rewrite, profile,
backtracking, synpreds, memoize, numRules, fileName,
ANTLRVersion, generatedTimestamp, trace, scopes,
superClass, literals), listLabel(label, elem)]

error(10):  internal error: BarcodeValidator.g :
java.util.NoSuchElementException: no such attribute:
buildAST in template context [outputFile]
org.antlr.stringtemplate.StringTemplate.rawSetAttribute(StringTemplate.java:739)

org.antlr.stringtemplate.StringTemplate.setAttribute(StringTemplate.java:600)
org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:342)
org.antlr.Tool.processGrammar(Tool.java:329)
org.antlr.Tool.process(Tool.java:266)
org.antlr.Tool.main(Tool.java:69)



		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de


More information about the antlr-interest mailing list