I want to write a simple CSS parser that will extract identifiers from css file. I have a grammar, I compiled it to .cs file and now I need to write Main function. For now I have something like this:
var lex = new css21Lexer(new ANTLRStringStream("}"));
var tokens = new CommonTokenStream(lex);
var parser = new css21Parser(tokens);
parser.styleSheet();
But when I run the program nothing happens. As the input is incorrect I would expect some kind of exception. I also tried to add code to some productions, but that code is not executed. How do I actually use the generated parser?