Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ codegen template incomplete: generation fails for $start, $stop #2207

Open
2 tasks done
azrdev opened this issue Jan 23, 2018 · 1 comment
Open
2 tasks done

C++ codegen template incomplete: generation fails for $start, $stop #2207

azrdev opened this issue Jan 23, 2018 · 1 comment

Comments

@azrdev
Copy link

azrdev commented Jan 23, 2018

test.g4:

grammar test;

test
	@after{ print( $stop.text); }
	:
	'foo'
	'bar'
	{ print( $start.text ); }
	'baz'
	;

What happens?

$ antlr4 -o /tmp/antlr/gen -Dlanguage=Cpp test.g4
error(33):  missing code generation template ThisRulePropertyRef_startHeader
error(33):  missing code generation template ThisRulePropertyRef_stopHeader

Versions:

$ antlr4
ANTLR Parser Generator  Version 4.7.1
[...]
$ java -version
openjdk version "1.8.0_144"
OpenJDK Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)
@azrdev
Copy link
Author

azrdev commented Jan 23, 2018

I get no error and the generated Parser.cpp looks fine when using instead $ctx.start.text etc.

azrdev added a commit to azrdev/coco_to_antlr that referenced this issue Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant