[antlr-interest] Problem using scopes in C Target
Jim Idle
jimi at temporal-wave.com
Thu Aug 5 09:55:06 PDT 2010
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: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Dagi.Troegner at dlr.de
> Sent: Thursday, August 05, 2010 4:53 AM
> To: antlr-interest at antlr.org
> 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
More information about the antlr-interest
mailing list