i´m working with antlrworks 1.4.2 i have the following, extremly simple grammar (combined lexer and parser): * public sqlfile : commands* EOF ;
commands: STARTWORD (options { greedy=false; } : .*) SEM ; STARTWORD : ('SELECT'|'INSERT'|'UPDATE'|'DELETE') ; SEM : ';' ; COMMENT : '/*' ( options { greedy=false; } : .*) '*/' { $channel = 2; } ; SHARP : '#' ( options { greedy=false; } : .*) NL { $channel = 2; } ; SINGLELINECOMMENT : '--' ( options { greedy=false; } : .*) NL { $channel = 2; } ; WS : (' '|'\t')+ { $channel = 5; } ; NL : ('\r' '\n'? | '\n') { $channel = 5; } ; * i´ve debugged it in antlrworks and works fine (as expected). i used this test-string: *-- -- SQL to create the guestbook table -- CREATE TABLE `guestbook` ( `id` int(11) NOT NULL auto_increment, `TimeStamp` int(11) default '0', `Email` varchar(60) default NULL, `Name` varchar(100) NOT NULL default '', `Website` varchar(60) default NULL, `Title` varchar(255) default NULL, `Message` text, `Verified` smallint(1) NOT NULL default '0', `Code` varchar(40) NOT NULL default '', UNIQUE KEY `id` (`id`) ) TYPE=MyISAM AUTO_INCREMENT=6 ; * then i build against csharp3-target and used the parser in my c#-application. while executing the parser.sqlfile()-Method 317 Exceptions (MissmatchToken and NoViableAlt) are thrown! now i wonder why, because my grammar is REALLY simple and should match, like it in the java-target did (no error in antlrworks-console). In the C#-Output the exceptions are thrown at the line STARTWORD1=(IToken)Match(input,STARTWORD,Follow._STARTWORD_in_commands135); in commands()-Rule where is my mistake? List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to il-antlr-inter...@googlegroups.com. To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.