Package dtool.ast.expressions

Examples of dtool.ast.expressions.Expression


      if(!isOptional) {
        return conclude(srToPosition(getSourcePosition(), new MissingParenthesesExpression()));
      }
      return null;
    } else {
      Expression exp = parseExpression_toMissing();
      parse.consumeRequired(DeeTokens.CLOSE_PARENS);
      return exp;
    }
  }
View Full Code Here


    if(tryConsume(DeeTokens.KW_TYPEID) == false)
      return null;
    ParseHelper parse = new ParseHelper();
   
    Reference ref = null;
    Expression exp = null;
    parsing: {
      if(parse.consumeRequired(DeeTokens.OPEN_PARENS).ruleBroken) break parsing;
      Resolvable resolvable = nullTypeOrExpToParseMissing(parseTypeOrExpression(true).node);
      if(resolvable instanceof Reference) {
        ref = (Reference) resolvable;
View Full Code Here

  public NodeResult<? extends Expression> parseNewExpression() {
    if(!tryConsume(DeeTokens.KW_NEW))
      return nullResult();
    ParseHelper parse = new ParseHelper();
   
    Expression outerClass = null;
    return parseNewExpression_do(parse, outerClass);
  }
View Full Code Here

      return null;
    ParseHelper parse = new ParseHelper();
   
    Reference type = null;
    CastQualifiers qualifier = null;
    Expression exp = null;
   
    parsing: {
      if(parse.consumeRequired(DeeTokens.OPEN_PARENS).ruleBroken) break parsing;
     
      qualifier = parseCastQualifier();
View Full Code Here

    assertEquals(fullName, expectedFullName);
  }
 
  // TODO: cleanup these two methods
  protected static void testExpressionResolution(String source, String... expectedResults) {
    Expression exp = parseSourceAndPickNode(source, source.indexOf("/*X*/"), Expression.class);
    assertNotNull(exp);
    INamedElement expType = getSingleElementOrNull(exp.resolveTypeOfUnderlyingValue(new NullModuleResolver()));
   
    testResolveSearchInMembersScope(expType, expectedResults);
  }
View Full Code Here

    INamedElement expType = getSingleElementOrNull(exp.resolveTypeOfUnderlyingValue(new NullModuleResolver()));
   
    testResolveSearchInMembersScope(expType, expectedResults);
  }
  protected static void testExpressionResolution2(String source, String... expectedResults) {
    Expression exp = new DeeTestsChecksParser(source).parseExpression().getNode();
    INamedElement expType = getSingleElementOrNull(exp.resolveTypeOfUnderlyingValue(new NullModuleResolver()));
   
    testResolveSearchInMembersScope(expType, expectedResults);
  }
View Full Code Here

    setToEParseBroken(result.ruleBroken);
    return result.node;
  }
 
  protected Expression parseTypeOrExpression_start(InfixOpType precedenceLimit) {
    Expression prefixExp;
    Resolvable prefixExpResolvable = parsePrimaryExpression();
    if(prefixExpResolvable == null || prefixExpResolvable instanceof Expression) {
      prefixExp = (Expression) prefixExpResolvable;
    } else {
      Reference ref = (Reference) prefixExpResolvable;
View Full Code Here

  protected Expression parseUnaryExpression() {
    return parseTypeOrExpression_start(InfixOpType.NULL);
  }
 
  protected Resolvable parsePrimaryExpression() {
    Expression simpleLiteral = parseSimpleLiteral();
    if(simpleLiteral != null) {
      return simpleLiteral;
    }
   
    switch (lookAhead()) {
    case KW_ASSERT:
      return expConclude(parseAssertExpression());
    case KW_MIXIN:
      return expConclude(parseMixinExpression());
    case KW_IMPORT:
      return expConclude(parseImportExpression());
    case KW_TYPEID:
      return expConclude(parseTypeIdExpression());
    case KW_NEW:
      return expConclude(parseNewExpression());
    case KW_CAST:
      return expConclude(parseCastExpression());
    case KW_IS:
      return expConclude(parseIsExpression());
    case KW___TRAITS:
      return expConclude(parseTraitsExpression());
    case AND:
    case INCREMENT:
    case DECREMENT:
    case STAR:
    case MINUS:
    case PLUS:
    case NOT:
    case CONCAT:
    case KW_DELETE: {
      LexElement prefixExpOpToken = consumeLookAhead();
      PrefixOpType prefixOpType = PrefixOpType.tokenToPrefixOpType(prefixExpOpToken.type);
     
      Expression exp = parseUnaryExpression();
      if(exp == null) {
        exp = parseMissingExpression(RULE_EXPRESSION);
        setToEParseBroken(true);
      }
     
View Full Code Here

        consumeLookAhead(DeeTokens.DOT);
        consumeLookAhead(DeeTokens.KW_NEW);
        return expConclude(parseNewExpression_do(parse, exp));
      }
     
      final Expression qualifier = exp;
      exp = null;
      if(qualifier instanceof ExpReference) {
        ExpReference expReference = (ExpReference) qualifier;
        if(expReference.ref instanceof RefQualified) {
          assertTrue(((RefQualified) expReference.ref).isExpressionQualifier);
View Full Code Here

    // If lower precedence it can't be parsed to right expression,
    // instead this expression must become left children of new parent
    if(infixOpAhead.precedence < precedenceLimit.precedence)
      return leftExp;
   
    Expression exp = parseInfixOperator(leftExp, infixOpAhead);
    if(shouldReturnToParseRuleTopLevel(exp)) {
      return exp;
    }
   
    return parseInfixOperators(precedenceLimit, exp);
View Full Code Here

TOP

Related Classes of dtool.ast.expressions.Expression

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.