You will get that if you follow a rule path that does not create a scope on the stack, but then try to access the stack anyway. There is nothing magic that will prevent you doing that and nothing different about the generated C than any other C. If you are using Linux, then use kcachegrind/valgrind and you should see where your error is.
Jim > -----Original Message----- > From: [email protected] [mailto:antlr-interest- > [email protected]] On Behalf Of [email protected] > Sent: Thursday, August 05, 2010 4:53 AM > To: [email protected] > Subject: [antlr-interest] Problem using scopes in C Target > > > > Hi, > > > > I have a problem in using global or rule-based scopes in my C Target Parser. I > tried the following with a rule-based scope: > > > > constraint > > > > scope { > > pANTLR3_STRING oclContext; > > } > > : contextDeclaration {oclContext = $contextDeclaration.text;} > > ((('static')? 'def' (NAME)? COLON (defExpression)*) > > | (stereotype (NAME)? COLON oclExpression) > > )+ > > ; > > > > The Grammar is correct and the Parser and Lexer in C are compilable without > any error reporting. The problem is that I get an access violation when the > starting rule of the parser is called. I get that exception as well when I try the > same with a global scope. I would appreciate any help! Thanks a lot! > > > > Best regards, > > Dagi > > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your- > email-address 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
