A few fixes

This commit is contained in:
Peter Boyer 2015-12-14 17:30:46 -05:00
parent e19f0e8564
commit 625ff2ee55
1 changed files with 3 additions and 7 deletions

View File

@ -88,13 +88,11 @@ func (l <file.grammarName>Visitor) visit<lname; format="cap">(ctx) {
fileHeader(grammarFileName, ANTLRVersion) ::= <<
// Generated from <grammarFileName; format="java-escape"> by ANTLR <ANTLRVersion>
package <file.grammarName>
>>
Parser(parser, funcs, atn, sempredFuncs, superClass) ::= <<
package <file.grammarName>
<if(superClass)>
// TODO var <superClass> = require('./<superClass>').<superClass>;
@ -105,18 +103,16 @@ grammarFileName := "<parser.grammarFileName; format="java-escape">";
<atn>
deserializer := new(antlr4.atn.ATNDeserializer)
atn := deserializer.deserialize(serializedATN)
deserializedAtn := deserializer.deserialize(serializedATN)
// decisionsToDFA := atn.decisionToState.map( function(ds, index) { return });
// decisionsToDFA := deserializedAtn.decisionToState.map( function(ds, index) { return });
var decisionToDFA []Foo //TODO
for index, ds := range atn.decisionToState {
for index, ds := range deserializedAtn.decisionToState {
decisionToDFA[index] = ds
}
sharedContextCache := new(PredictionContextCache)
literalNames := [ <parser.literalNames:{t | <t>}; null="null", separator=", ", wrap, anchor> ];