Package org.eclipse.imp.pdb.facts

Examples of org.eclipse.imp.pdb.facts.IValue


    private Result<IValue> createVisitedTime(IEvaluator<Result<IValue>> eval, String timePart, org.rascalmpl.ast.JustTime.Lexical x) {
      try {
        timePart.replaceAll(":","");

        StandardTextReader parser = new StandardTextReader();
        IValue result = parser.read(VF, new StringReader("$T" + timePart));
        return makeResult(TF.dateTimeType(), result, eval);
      } catch (FactTypeUseException e) {
        throw new DateTimeSyntax(e.getMessage(), eval.getCurrentAST().getLocation());
      } catch (FactParseError e){
        throw new DateTimeSyntax(e.getMessage(), eval.getCurrentAST().getLocation());
View Full Code Here


   
    return false;
  }
 
  public boolean visit(Assignment node) {
    IValue leftSide = visitChild(node.getLeftHandSide());
    IValue rightSide = visitChild(node.getRightHandSide());
   
    ownValue = constructExpressionNode("assignment", leftSide, values.string(node.getOperator().toString()), rightSide);
   
    return false;
  }
View Full Code Here

  public boolean visit(BlockComment node) {
    return false;
  }
 
  public boolean visit(BooleanLiteral node) {
    IValue booleanValue = values.bool(node.booleanValue());
   
    ownValue = constructExpressionNode("booleanLiteral", booleanValue);
   
    return false;
  }
View Full Code Here

   
    return false;
  }
 
  public boolean visit(BreakStatement node) {
    IValue label = node.getLabel() == null ? values.string("") : values.string(node.getLabel().getFullyQualifiedName());
    ownValue = constructStatementNode("break", label);
   
    return false;
  }
View Full Code Here

   
    return false;
  }
 
  public boolean visit(CastExpression node) {
    IValue type = visitChild(node.getType());
    IValue expression = visitChild(node.getExpression());
   
    ownValue = constructExpressionNode("cast", type, expression);
   
    return false;
  }
View Full Code Here

   
    return false;
  }
 
  public boolean visit(CatchClause node) {
    IValue exception = visitChild(node.getException());
    IValue body = visitChild(node.getBody());
   
    ownValue = constructStatementNode("catch", exception, body);
   
    return false;
  }
View Full Code Here

   
    return false;
  }
 
  public boolean visit(CharacterLiteral node) {
    IValue value = values.string(node.getEscapedValue());
   
    ownValue = constructExpressionNode("characterLiteral", value);
   
    return false;
  }
View Full Code Here

   
    return false;
  }
 
  public boolean visit(ClassInstanceCreation node) {
    IValue expression = node.getExpression() == null ? null : visitChild(node.getExpression());
 
    IValue type = null;
    IValueList genericTypes = new IValueList(values);
    if (node.getAST().apiLevel() == AST.JLS2) {
      type = visitChild(node.getName());
    }
    else {
      type = visitChild(node.getType());
 
      if (!node.typeArguments().isEmpty()) {
        for (Iterator it = node.typeArguments().iterator(); it.hasNext();) {
          Type t = (Type) it.next();
          genericTypes.add(visitChild(t));
        }
      }
    }
 
    IValueList arguments = new IValueList(values);
    for (Iterator it = node.arguments().iterator(); it.hasNext();) {
      Expression e = (Expression) it.next();
      arguments.add(visitChild(e));
    }
 
    IValue anonymousClassDeclaration = node.getAnonymousClassDeclaration() == null ? null : visitChild(node.getAnonymousClassDeclaration());
   
    ownValue = constructExpressionNode("newObject", expression, type, arguments.asList(), anonymousClassDeclaration);
    setAnnotation("typeParameters", genericTypes);
    return false;
  }
View Full Code Here

    setAnnotation("typeParameters", genericTypes);
    return false;
  }
 
  public boolean visit(CompilationUnit node) {
    IValue packageOfUnit = node.getPackage() == null ? null : visitChild(node.getPackage());
   
    IValueList imports = new IValueList(values);
    for (Iterator it = node.imports().iterator(); it.hasNext();) {
      ImportDeclaration d = (ImportDeclaration) it.next();
      imports.add(visitChild(d));
View Full Code Here

    ownValue = constructDeclarationNode("compilationUnit", packageOfUnit, imports.asList(), typeDeclarations.asList());   
    return false;
  }
 
  public boolean visit(ConditionalExpression node) {
    IValue expression = visitChild(node.getExpression());
    IValue thenBranch = visitChild(node.getThenExpression());
    IValue elseBranch = visitChild(node.getElseExpression());
   
    ownValue = constructExpressionNode("conditional", expression, thenBranch, elseBranch);
   
    return false;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.imp.pdb.facts.IValue

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.