Examples of ANTLRInputStream


Examples of com.dotcms.repackage.org.antlr.runtime.ANTLRInputStream

 
  public SQLQueryFactory(String sql) throws ValidationException {
   
    CharStream input;
    try {
      input = new ANTLRInputStream(new ByteArrayInputStream(sql.getBytes("UTF-8")));
    } catch (Exception e) {
      Logger.error(SQLQueryFactory.class,e.getMessage(),e);
      throw new DotRuntimeException(e.getMessage(), e);
    }
        TokenSource lexer = new CmisSqlLexer(input);
View Full Code Here

Examples of org.antlr.runtime.ANTLRInputStream

    catch (MalformedURLException me) {
      errMgr.runTimeError(null, null, 0, ErrorType.INVALID_TEMPLATE_NAME,
                me, root + unqualifiedFileName);
      return null;
    }
    ANTLRInputStream fs;
    try {
      fs = new ANTLRInputStream(f.openStream(), encoding);
      fs.name = unqualifiedFileName;
    }
    catch (IOException ioe) {
      if ( verbose ) System.out.println(root+"/"+unqualifiedFileName+" doesn't exist");
      //errMgr.IOError(null, ErrorType.NO_SUCH_TEMPLATE, ioe, unqualifiedFileName);
View Full Code Here

Examples of org.antlr.runtime.ANTLRInputStream

    private Tree parse(String expression)
    {
        InputStream is = new ByteArrayInputStream(expression.getBytes());

        ANTLRInputStream ais;

        try
        {
            ais = new ANTLRInputStream(is);
        }
        catch (IOException ex)
        {
            throw new RuntimeException(ex);
        }
View Full Code Here

Examples of org.antlr.runtime.ANTLRInputStream

  private RutaModule loadScriptIS(String scriptLocation) throws IOException, RecognitionException {
    InputStream scriptInputStream = getClass().getClassLoader().getResourceAsStream(scriptLocation);
    if (scriptInputStream == null) {
      throw new FileNotFoundException("No script found in location [" + scriptLocation + "]");
    }
    CharStream st = new ANTLRInputStream(scriptInputStream, scriptEncoding);
    RutaLexer lexer = new RutaLexer(st);
    CommonTokenStream tokens = new CommonTokenStream(lexer);
    RutaParser parser = new RutaParser(tokens);
    parser.setExternalFactory(factory);
    parser.setResourcePaths(resourcePaths);
View Full Code Here

Examples of org.antlr.runtime.ANTLRInputStream

  private CommandReader() {}

  public static List<TrainCommand> parse(String message) {
    try {
      ANTLRInputStream input =
        new ANTLRInputStream(new StringBufferInputStream(message));

      CommandLexer commandLexer =
        new CommandLexer(input);

      CommonTokenStream tokens =
View Full Code Here

Examples of org.antlr.runtime.ANTLRInputStream

  private PushTrainReader() {}

  public static PushTrain parse(String pushTrainString) {
    try {
      ANTLRInputStream input =
        new ANTLRInputStream(new StringBufferInputStream(pushTrainString));

      PushTrainLexer pushTrainLexer =
        new PushTrainLexer(input);

      CommonTokenStream tokens = new CommonTokenStream(pushTrainLexer);
View Full Code Here

Examples of org.antlr.runtime.ANTLRInputStream

    public abstract void onTextWord(String word);
    public abstract void onTextPhrase(String phrase);

    // convenience method because everybody needs this piece of code
    public static CmisQueryWalker getWalker(String statement) throws UnsupportedEncodingException, IOException, RecognitionException {
        CharStream input = new ANTLRInputStream(new ByteArrayInputStream(statement.getBytes("UTF-8")));
        TokenSource lexer = new CmisQlStrictLexer(input);
        TokenStream tokens = new CommonTokenStream(lexer);
        CmisQlStrictParser parser = new CmisQlStrictParser(tokens);
        CommonTree parserTree; // the ANTLR tree after parsing phase
View Full Code Here

Examples of org.antlr.runtime.ANTLRInputStream

        }
    }

    private DRLParser getParser( final InputStream is, final String encoding ) {
        try {
            ANTLRInputStream antlrInputStream;
            if (encoding != null) {
                antlrInputStream = new ANTLRInputStream(is, encoding);
            } else {
                antlrInputStream = new ANTLRInputStream(is);
            }
            lexer = new DRLLexer(antlrInputStream);
            DRLParser parser = new DRLParser( new CommonTokenStream( lexer ) );
            return parser;
        } catch ( final Exception e ) {
View Full Code Here

Examples of org.antlr.runtime.ANTLRInputStream

        NodeTestDSLParser parser = new NodeTestDSLParser( new CommonTokenStream( lexer ) );
        return parser;
    }

    private static NodeTestDSLParser getParser(final InputStream is) throws IOException {
        NodeTestDSLLexer lexer = new NodeTestDSLLexer( new ANTLRInputStream( is ) );
        NodeTestDSLParser parser = new NodeTestDSLParser( new CommonTokenStream( lexer ) );
        return parser;
    }
View Full Code Here

Examples of org.antlr.runtime.ANTLRInputStream

        NodeTestDSLParser parser = new NodeTestDSLParser( new CommonTokenStream( lexer ) );
        return parser;
    }

    private static NodeTestDSLParser getParser(final InputStream is) throws IOException {
        NodeTestDSLLexer lexer = new NodeTestDSLLexer( new ANTLRInputStream( is ) );
        NodeTestDSLParser parser = new NodeTestDSLParser( new CommonTokenStream( lexer ) );
        return parser;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.