Package org.antlr.runtime

Examples of org.antlr.runtime.TokenStream


  public void assignmentStatement_3(){
    try {
      CharStream stream =
          new NoCaseStringStream("self.legs[34] = 7;");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("assignmentStatement completed with " + errors + " errors");
View Full Code Here


  public void simpleMethodInvocationStatement(){
    try {
      CharStream stream =
          new NoCaseStringStream("__PutProperty(17,OLE.VariantI2(Value='Action'));");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("simpleMethodInvocationStatement completed with " + errors + " errors");
View Full Code Here

      CharStream stream =
          new NoCaseStringStream("if a then\n" +
              "x = y;" +
              "end if;");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("ifStatement_1 completed with " + errors + " errors");
View Full Code Here

      CharStream stream =
          new NoCaseStringStream("if a = b then\n" +
              "x = y;" +
              "end if;");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("ifStatement_2 completed with " + errors + " errors");
View Full Code Here

              "        -- This is the one.  Delete it.\n" +
              "        self.PaintingData.DeleteRow(p);\n" +
              "        exit;\n" +
              "      end if;");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("ifStatement_3 completed with " + errors + " errors");
View Full Code Here

      CharStream stream =
          new NoCaseStringStream("if (a = b) and bob then\n" +
//              "x = y;" +
              "end if;");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("ifStatement_4 completed with " + errors + " errors");
View Full Code Here

              "    ReturnObj = PreferenceList[i].Clone(TRUE);\r\n" +
              "    found = TRUE;\r\n" +
              "    exit;\r\n" +
              "  end if;\r\n");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("ifStatement_5 completed with " + errors + " errors");
View Full Code Here

  public void startTaskStatement_simple(){
    try {
      CharStream stream =
          new NoCaseStringStream("start task theBid.StartBid();\n");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("startTaskStatement_simplest completed with " + errors + " errors");
View Full Code Here

              "    bidValue = theBidValue,\n" +
              "    lastBidTime = theLastBidTime,\n" +
              "    bidInProgress = theBidInProgress)\n" +
              "  where completion = event;\n");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("startTaskStatement_simple completed with " + errors + " errors");
View Full Code Here

              "    bidValue = self.theBidValue,\n" +
              "    lastBidTime = self.theLastBidTime,\n" +
              "    bidInProgress = self.theBidInProgress)\n" +
              "  where completion = event, transaction = dependent;\n");
        ForteLexer lexer = new ForteLexer(stream);
        TokenStream tokenStream = new CommonTokenStream(lexer);
        ForteParser parser = new ForteParser(tokenStream);
        parser.statement();
        int errors = parser.getNumberOfSyntaxErrors();
        if (errors > 0){
          Assert.fail("startTaskStatement completed with " + errors + " errors");
View Full Code Here

TOP

Related Classes of org.antlr.runtime.TokenStream

Copyright © 2018 www.massapicom. 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.