Examples of ANTLRFileStream


Examples of org.antlr.runtime.ANTLRFileStream

  public FrontendBeta (String grammarFilePath) throws IOException, RecognitionException, InvalidGrammarException {
   
    //====== Syntax check
    System.err.println("===============");
    System.err.println("Syntax");
    FTLSyntaxLexer lex = new FTLSyntaxLexer(new ANTLRFileStream(grammarFilePath));
        CommonTokenStream tokens = new CommonTokenStream(lex);
        FTLSyntaxParser parser = new FTLSyntaxParser (tokens);
        FTLSyntaxParser.root_return r = parser.root();       
       
    //====== Sort top levels
View Full Code Here

Examples of org.antlr.runtime.ANTLRFileStream

      System.out.println("  (checks pass)");
    }
   
   
        //ALELexer lexer = new ALELexer(new ANTLRFileStream(aleGrammar.replace("_", "USCORE")));
    ALELexer lexer = new ALELexer(new ANTLRFileStream(aleGrammar));
    CommonTokenStream tokens = new CommonTokenStream(lexer);
        ast = new ALEParser(tokens);
        ast.stripFloats = stripFloats;
        ast.root(); //force parse...
       
View Full Code Here

Examples of org.antlr.runtime.ANTLRFileStream

   */
  static CommonTree parseFile(String filename) throws IOException,
      RecognitionException {

    // Create a scanner and parser that reads from the input stream passed to us
    FlumeDeployLexer lexer = new FlumeDeployLexer(new ANTLRFileStream(filename));
    CommonTokenStream tokens = new CommonTokenStream(lexer);
    FlumeDeployParser parser = new FlumeDeployParser(tokens);

    return (CommonTree) parser.deflist().getTree();
  }
View Full Code Here

Examples of org.antlr.runtime.ANTLRFileStream

   */
  static CommonTree parseNodeFile(String filename) throws IOException,
      RecognitionException {

    // Create a scanner and parser that reads from the input stream passed to us
    FlumeDeployLexer lexer = new FlumeDeployLexer(new ANTLRFileStream(filename));
    CommonTokenStream tokens = new CommonTokenStream(lexer);
    FlumeDeployParser parser = new FlumeDeployParser(tokens);

    return (CommonTree) parser.connection().getTree();
  }
View Full Code Here

Examples of org.antlr.runtime.ANTLRFileStream

    }

    private boolean updateModuleVersion(Module module, Map<String,String> updatedModuleVersions) throws IOException,
            RecognitionException {
        String moduleDescriptorPath = module.getUnit().getFullPath();
        CeylonLexer lexer = new CeylonLexer(new ANTLRFileStream(moduleDescriptorPath, encoding));
        TokenRewriteStream tokenStream = new TokenRewriteStream(lexer);
        CeylonParser parser = new CeylonParser(tokenStream);
        Tree.CompilationUnit cu = parser.compilationUnit();
        String v = this.confirm == Confirm.dependencies ? this.newVersion : confirm("update.module.version", module.getNameAsString(), module.getVersion(), this.newVersion);
        if (v == null) {
View Full Code Here

Examples of org.antlr.runtime.ANTLRFileStream

    }

    private boolean updateModuleImports(Module module, Map<String,String> updatedModuleVersions) throws IOException,
            RecognitionException {
        String moduleDescriptorPath = module.getUnit().getFullPath();
        CeylonLexer lexer = new CeylonLexer(new ANTLRFileStream(moduleDescriptorPath, encoding));
        TokenRewriteStream tokenStream = new TokenRewriteStream(lexer);
        CeylonParser parser = new CeylonParser(tokenStream);
        Tree.CompilationUnit cu = parser.compilationUnit();
        List<Tree.ImportModule> moduleImports = findUpdatedImport(cu, updatedModuleVersions);
        for (Tree.ImportModule moduleImport : moduleImports) {
View Full Code Here

Examples of org.antlr.runtime.ANTLRFileStream

            RecognitionException {
        if (isMatch) {
            outputVersion(module);
        } else if (dependencies) {
            String moduleDescriptorPath = module.getUnit().getFullPath();
            CeylonLexer lexer = new CeylonLexer(new ANTLRFileStream(moduleDescriptorPath, encoding));
            CommonTokenStream tokenStream = new CommonTokenStream(lexer);
            CeylonParser parser = new CeylonParser(tokenStream);
            Tree.CompilationUnit cu = parser.compilationUnit();
            List<Tree.ImportModule> moduleImports = findImport(cu);
            for (Tree.ImportModule moduleImport : moduleImports) {
View Full Code Here

Examples of org.antlr.runtime.ANTLRFileStream

      this.filename = filename;
    }
    public void setInputStream(String sourceFile) {

      try {
        input = new ANTLRFileStream(sourceFile);
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
View Full Code Here

Examples of org.antlr.runtime3_3_0.ANTLRFileStream

      e.printStackTrace();
    }
  }
*/
  public void process() throws IOException {
    CharStream input = new ANTLRFileStream(dispelFile);
    DISPEL lexer = new DISPEL(input);
    Token token;
    while ((token = lexer.nextToken()) != Token.EOF_TOKEN) {
      tp.process(token);
    }
View Full Code Here

Examples of org.antlr.v4.runtime.ANTLRFileStream

public class Main {
 

    public static void main(String[] args) throws Exception {
        //String input = "hi";
        CharStream mstream = new ANTLRFileStream("c:\\android\\test.txt");

        MAG1Lexer lexer = new MAG1Lexer(mstream);
        TokenStream mstreaStream = new CommonTokenStream(lexer);
        MAG1Parser parser = new MAG1Parser(mstreaStream);
        //parser.getTrimParseTree();
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.