public int size() { return input.size(); }
public int size() { return input.size(); }
@Override public String getText() { if ( text!=null ) { return text; } if ( input==null ) { return null; } int n = input.size(); if ( start<n && stop<n) { return input.substring(start,stop); } else { return "<EOF>"; } }
@Override public String getText() { if ( text!=null ) { return text; } if ( input==null ) { return null; } int n = input.size(); if ( start<n && stop<n) { return input.substring(start,stop); } else { return "<EOF>"; } }
@Override public String getText() { if ( text!=null ) { return text; } if ( input==null ) { return null; } int n = input.size(); if ( start<n && stop<n) { return input.substring(start,stop); } else { return "<EOF>"; } }
@Override public String getText() { if ( text!=null ) { return text; } if ( input==null ) { return null; } int n = input.size(); if ( start<n && stop<n) { return input.substring(start,stop); } else { return "<EOF>"; } }
@Override public String getText() { if ( text!=null ) { return text; } if ( input==null ) { return null; } int n = input.size(); if ( start<n && stop<n) { return input.substring(start,stop); } else { return "<EOF>"; } }
public void displayRecognitionError(String[] tokenNames, RecognitionException e) { final StringBuilder buffer = new StringBuilder(); buffer.append("[").append(getErrorHeader(e)).append("] "); buffer.append(getErrorMessage(e, tokenNames)); if(e.input!=null && e.input instanceof CharStream) { final CharStream stream = (CharStream) e.input; int size = stream.size(); if(size>0) { buffer.append("\n").append(stream.substring(0, size-1)); } } throw new SqlJetParserException(buffer.toString(), e); }
public void reportError(RecognitionException e) { StringBuilder errorMessage = new StringBuilder("Syntax error at position ").append(e.charPositionInLine).append(": "); if (e instanceof NoViableAltException) { int index = e.charPositionInLine; String error = this.input.substring(index, index); String statement = this.input.substring(0, this.input.size() - 1); errorMessage.append("unexpected \"").append(error).append("\" for `").append(statement).append("`."); } else { errorMessage.append(this.getErrorMessage(e, this.getTokenNames())); } throw new RuntimeException(errorMessage.toString()); }
public void displayRecognitionError(String[] tokenNames, RecognitionException e) { final StringBuilder buffer = new StringBuilder(); buffer.append("[").append(getErrorHeader(e)).append("] "); buffer.append(getErrorMessage(e, tokenNames)); if(e.token!=null) { final CharStream stream = e.token.getInputStream(); if(stream!=null) { int size = stream.size(); if(size>0) { buffer.append("\n").append(stream.substring(0, size-1)); } } } throw new SqlJetParserException(buffer.toString(), e); }
@Override public CompiledST loadTemplateFile(String prefix, String unqualifiedFileName, CharStream templateStream) { String template = templateStream.substring(0, templateStream.size() - 1); String templateName = Misc.getFileNameNoSuffix(unqualifiedFileName); String fullyQualifiedTemplateName = prefix + templateName; CompiledST impl = new Compiler(this).compile(fullyQualifiedTemplateName, template); CommonToken nameT = new CommonToken(STLexer.SEMI); // Seems like a hack, best I could come up with. nameT.setInputStream(templateStream); rawDefineTemplate(fullyQualifiedTemplateName, impl, nameT); impl.defineImplicitlyDefinedTemplates(this); return impl; } }
@Override public CompiledST loadTemplateFile(String prefix, String unqualifiedFileName, CharStream templateStream) { String template = templateStream.substring(0, templateStream.size() - 1); String templateName = Misc.getFileNameNoSuffix(unqualifiedFileName); String fullyQualifiedTemplateName = prefix + templateName; CompiledST impl = new Compiler(this).compile(fullyQualifiedTemplateName, template); CommonToken nameT = new CommonToken(STLexer.SEMI); // Seems like a hack, best I could come up with. nameT.setInputStream(templateStream); rawDefineTemplate(fullyQualifiedTemplateName, impl, nameT); impl.defineImplicitlyDefinedTemplates(this); return impl; } }
@Override public CompiledST loadTemplateFile(String prefix, String unqualifiedFileName, CharStream templateStream) { String template = templateStream.substring(0, templateStream.size() - 1); String templateName = Misc.getFileNameNoSuffix(unqualifiedFileName); String fullyQualifiedTemplateName = prefix + templateName; CompiledST impl = new Compiler(this).compile(fullyQualifiedTemplateName, template); CommonToken nameT = new CommonToken(STLexer.SEMI); // Seems like a hack, best I could come up with. nameT.setInputStream(templateStream); rawDefineTemplate(fullyQualifiedTemplateName, impl, nameT); impl.defineImplicitlyDefinedTemplates(this); return impl; } }
@Override public CompiledST loadTemplateFile(String prefix, String unqualifiedFileName, CharStream templateStream) { String template = templateStream.substring(0, templateStream.size() - 1); String templateName = Misc.getFileNameNoSuffix(unqualifiedFileName); String fullyQualifiedTemplateName = prefix + templateName; CompiledST impl = new Compiler(this).compile(fullyQualifiedTemplateName, template); CommonToken nameT = new CommonToken(STLexer.SEMI); // Seems like a hack, best I could come up with. nameT.setInputStream(templateStream); rawDefineTemplate(fullyQualifiedTemplateName, impl, nameT); impl.defineImplicitlyDefinedTemplates(this); return impl; } }
@Override public CompiledST loadTemplateFile(String prefix, String unqualifiedFileName, CharStream templateStream) { String template = templateStream.substring(0, templateStream.size() - 1); String templateName = Misc.getFileNameNoSuffix(unqualifiedFileName); String fullyQualifiedTemplateName = prefix + templateName; CompiledST impl = new Compiler(this).compile(fullyQualifiedTemplateName, template); CommonToken nameT = new CommonToken(STLexer.SEMI); // Seems like a hack, best I could come up with. nameT.setInputStream(templateStream); rawDefineTemplate(fullyQualifiedTemplateName, impl, nameT); impl.defineImplicitlyDefinedTemplates(this); return impl; } }