Package wyvern.tools.typedAST.interfaces

Examples of wyvern.tools.typedAST.interfaces.TypedAST


        "match(y):                      \n" +
        "  X => 15                     \n" +
        "  Y => 23                     \n" +
        "  default => 50               \n";
   
    TypedAST ast = getAST(input);
    evaluateExpecting(ast, 23);
  }
View Full Code Here


        "  X => 15                     \n" +
        "  Y => 23                     \n" +
        "  Y => 34                     \n" // Y given twice; error
        "  default => 50               \n";
       
    TypedAST res = getAST(input);
   
    typeCheckfailWith(res, ErrorMessage.DUPLICATE_TAG);
  }
View Full Code Here

        "  X => 15                     \n" +
        "  Y => 23                     \n" +
        "  Z => 34                     \n" // Z is not declared anywhere; error
        "  default => 50               \n";
       
    TypedAST res = getAST(input);
   
    typeCheckfailWith(res, ErrorMessage.UNKNOWN_TAG);
  }
View Full Code Here

        "  X => 15                     \n" +
        "  Y => 23                     \n" +
        "  Z => 34                     \n" // Z is declared but not a tagged type; error
        "  default => 50               \n";
       
    TypedAST ast = getAST(input);
   
    typeCheckfailWith(ast, ErrorMessage.NOT_TAGGED);
  }
View Full Code Here

        "match(x):                      \n" +
        "  X => 15                     \n" +
        "  default => 23               \n" +
        "  Y => 50                     \n";
       
    TypedAST res = getAST(input);
   
    typeCheckfailWith(res, ErrorMessage.DEFAULT_NOT_LAST);
  }
View Full Code Here

        "  X => 15                     \n" +
        "  default => 23               \n" +
        "  Y => 50                     \n" +
        "  default => 23               \n";
       
    TypedAST res = getAST(input);
   
    typeCheckfailWith(res, ErrorMessage.MULTIPLE_DEFAULTS);
  }
View Full Code Here

      "match(i):                                                   \n" +
      "  DynInt => 10                                             \n" +
      "  DynChar => 15                                            \n";
    // DynByte not specified; error
   
    TypedAST res = getAST(input);
 
    typeCheckfailWith(res, ErrorMessage.DEFAULT_NOT_PRESENT);
  }
View Full Code Here

        "  DynByte => 20                                            \n" +
        "   Dyn     => 25                                            \n" +
        "  default => 30                                            \n";
      // default specified with exhaustive search; error
       
      TypedAST ast = getAST(input);
      typeCheckfailWith(ast, ErrorMessage.DEFAULT_PRESENT);
  }
View Full Code Here

      "  DynChar => 15                             \n" +
      "  Dyn => 5                                  \n" +
      "  default => 20                             \n";
   
   
    TypedAST res = getAST(input);
   
    typeCheckfailWith(res, ErrorMessage.DEFAULT_PRESENT);
  }
View Full Code Here

      "match(i):                                    \n" +
      "  DynInt => 10                              \n" +
      "  DynChar => 15                             \n" +
      "  default => 15                             \n";
   
    TypedAST ast = getAST(input);
   
    // Should be 15 because D is a subclass of B and will match that
    evaluateExpecting(ast, 15);
  }
View Full Code Here

TOP

Related Classes of wyvern.tools.typedAST.interfaces.TypedAST

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.