[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 7819]
This commit is contained in:
parrt 2011-03-07 10:06:29 -08:00
parent 0eccd0f3a7
commit 360bd17f21
4 changed files with 9 additions and 9 deletions

View File

@ -286,7 +286,7 @@ DFADecl(dfa) ::= <<
>>
BitSetDecl(b) ::= <<
public static final LABitSet <b.name>=new LABitSet(new long[]{<b.hexWords:{<it>L};separator=",">}<if(b.fset.EOF)>, true<endif>);
public static final LABitSet <b.name>=new LABitSet(new long[]{<b.hexWords:{it|<it>L};separator=",">}<if(b.fset.EOF)>, true<endif>);
>>
LexerFile(fileName, lexer) ::= <<

View File

@ -305,7 +305,7 @@ TOKEN_NONDETERMINISM(input,conflictingTokens,paths,disabled,hasPredicateBlockedB
<<
<if(paths)>
Decision can match input such as "<input>" using multiple alternatives:
<paths:{ alt <it.alt> via NFA path <it.states; separator=","><\n>}>
<paths:{it | alt <it.alt> via NFA path <it.states; separator=","><\n>}>
<else>
Multiple token rules can match input such as "<input>": <conflictingTokens; separator=", "><\n>
<endif>

View File

@ -5,8 +5,8 @@ import org.antlr.v4.codegen.src.OutputModelObject;
import org.antlr.v4.tool.ErrorType;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.compiler.CompiledST;
import org.stringtemplate.v4.compiler.FormalArgument;
import org.stringtemplate.v4.misc.BlankST;
import java.lang.reflect.Field;
import java.util.*;
@ -44,19 +44,19 @@ public class OutputModelWalker {
String templateName = omo.getClass().getSimpleName();
if ( templateName == null ) {
tool.errMgr.toolError(ErrorType.NO_MODEL_TO_TEMPLATE_MAPPING, omo.getClass().getSimpleName());
return new BlankST();
return new ST();
}
ST st = templates.getInstanceOf(templateName);
if ( st == null ) {
tool.errMgr.toolError(ErrorType.CODE_GEN_TEMPLATES_INCOMPLETE, templateName);
return new BlankST();
return new ST();
}
if ( st.impl.formalArguments == FormalArgument.UNKNOWN ) {
if ( st.impl.formalArguments == null ) {
tool.errMgr.toolError(ErrorType.CODE_TEMPLATE_ARG_ISSUE, templateName, "<none>");
return st;
}
LinkedHashMap<String,FormalArgument> formalArgs = st.impl.formalArguments;
Map<String,FormalArgument> formalArgs = st.impl.formalArguments;
Set<String> argNames = formalArgs.keySet();
Iterator<String> arg_it = argNames.iterator();

View File

@ -92,7 +92,7 @@ public class ErrorManager {
public ErrorManager(Tool tool) {
this.tool = tool;
org.stringtemplate.v4.misc.ErrorManager.setErrorListener(initSTListener);
//org.stringtemplate.v4.misc.ErrorManager.setErrorListener(initSTListener);
// it is inefficient to set the default locale here if another
// piece of code is going to set the locale, but that would
// require that a user call an init() function or something. I prefer
@ -102,7 +102,7 @@ public class ErrorManager {
// the user might have specified one on the command line
// if not, or if the user has given an illegal value, we will fall back to "antlr"
setFormat("antlr");
org.stringtemplate.v4.misc.ErrorManager.setErrorListener(theDefaultSTListener);
//org.stringtemplate.v4.misc.ErrorManager.setErrorListener(theDefaultSTListener);
}
public void resetErrorState() {