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

Composite Grammar #27

Open
oddg opened this issue Oct 16, 2014 · 1 comment
Open

Composite Grammar #27

oddg opened this issue Oct 16, 2014 · 1 comment

Comments

@oddg
Copy link

oddg commented Oct 16, 2014

I would like to build a grammar from several lexer files so to warm up I tried the following:

//Root.g
grammar Root;
options { language = Ruby; }
import Delegate;
a : 'int' ID ;

//Delgate.g
lexer grammar Delegate;
options { language = Ruby; }
ID : 'a'..'z'+ ;
INT : '0'..'9'+ ;
WS : (' '|'\n')+ {skip();} ;

and got the following messages:

me@mycomputer:~$ antlr4ruby Root.g
warning(24): template error: context [/outputFile /rootGrammarOutputFile /lexer /_sub155 /delegateLexerRule] 3:94 no such property or can't access: null.attributes

It seems that antrl3.2 does not support composite grammar for ruby.

me@mycomputer:~$ antlr3 Root.g
error(10): internal error: group Ruby does not satisfy interface ANTLRCore: mismatched arguments on these templates [treeParser(grammar, name, scopes, tokens, tokenNames, globalAction, rules, numRules, bitsets, labelType, ASTLabelType, superClass, members, filterMode)]

So what options do I have?

@davestevens
Copy link

I've just run into this problem too.
It looks like its not actually an issue though, the file RootParser.rb seems to be created with the correct variables.
I found an issue on stackoverflow that suggests it was a problem in 3.5.

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

2 participants