Package dtool.ast.definitions.DefUnit

Examples of dtool.ast.definitions.DefUnit.ProtoDefSymbol


  }
 
  protected NodeResult<DefinitionConstructor> parseDefinitionConstructor_atThis(DefParseHelper parse) {
    consumeLookAhead(DeeTokens.KW_THIS);
   
    ProtoDefSymbol defId = defSymbol(lastLexElement()); // TODO: mark this as special DefSymbol
    return parse_FunctionLike(parse, true, null, defId).upcastTypeParam();
  }
View Full Code Here


    }
   
    // Note that there are heavy similarites between this code and var/function declaration parsing
    ArrayView<Attribute> attributes = null;
    Reference ref = null;
    ProtoDefSymbol defId = null;
    Reference cstyleSuffix = null;
    ArrayList<AliasVarDeclFragment> fragments = null;
   
    parsing: {
      ParserState savedParserState = saveParserState();
View Full Code Here

    return parse.resultConclude(
      new DefinitionAliasFunctionDecl(comments, attributes, ref, defId, fnParams, fnAttributes));
  }
 
  protected AliasVarDeclFragment parseAliasVarDeclFragment() {
    ProtoDefSymbol fragId = parseDefId();
    return conclude(fragId.nameSourceRange, new AliasVarDeclFragment(fragId));
  }
View Full Code Here

    Token[] comments = parse.parseEndDDocComments();
    return parse.resultConclude(new DefinitionAlias(comments, arrayView(fragments)));
  }
 
  public DefinitionAliasFragment parseAliasFragment() {
    ProtoDefSymbol defId = parseDefId();
    ArrayView<TemplateParameter> tplParams = null;
    Reference ref = null;
   
    ParseHelper parse = new ParseHelper(defId.nameSourceRange.getStartPos());
   
View Full Code Here

    if(lookAhead() == DeeTokens.IDENTIFIER
        && (lookAhead(1) == DeeTokens.OPEN_PARENS || lookAhead(1) == DeeTokens.ASSIGN)) {
      return parseDefinitionEnumVar_afterId(parse);
    }
   
    ProtoDefSymbol defId = parseDefId();
    Reference type = null;
    EnumBody body = null;
   
    parsing : {
      if(tryConsume(DeeTokens.COLON)) {
View Full Code Here

    parse.consumeRequired(DeeTokens.SEMICOLON);
    return parse.resultConclude(new DefinitionEnumVar(arrayView(fragments)));
  }

  public DefinitionEnumVarFragment parseEnumVarFragment() {
    ProtoDefSymbol defId = parseDefId();
    ArrayView<TemplateParameter> tplParams = null;
    IInitializer initializer = null;
   
    ParseHelper parse = new ParseHelper(defId.nameSourceRange.getStartPos());
   
View Full Code Here

   
    NodeResult<Reference> tplInstanceResult = parseTypeReference_ToMissing();
    Reference tplInstance = tplInstanceResult.node;
   
    if(!tplInstanceResult.ruleBroken && lookAhead() == DeeTokens.IDENTIFIER) {
      ProtoDefSymbol defId = parseDefId();
      parse.consumeRequired(DeeTokens.SEMICOLON);
      Token[] comments = parse.parseEndDDocComments();
      return parse.resultConclude(new DefinitionMixinInstance(comments, defId, tplInstance));
    } else {
      parse.consumeRequired(DeeTokens.SEMICOLON);
View Full Code Here

    restoreOriginalState(savedParserState);
    return parseParenthesesExp();
  }
 
  protected NodeResult<ExpSimpleLambda> parseSimpleLambdaLiteral_start() {
    ProtoDefSymbol defId = parseDefId();
    consumeLookAhead(DeeTokens.LAMBDA);
   
    ParseHelper parse = new ParseHelper(defId.getStartPos());
    Expression bodyExp = parse.checkResult(parseAssignExpression_toMissing(true, RULE_EXPRESSION));
   
    SimpleLambdaDefUnit lambdaDefId = conclude(defId.nameSourceRange, new SimpleLambdaDefUnit(defId));
    return parse.resultConclude(new ExpSimpleLambda(lambdaDefId, bodyExp));
  }
View Full Code Here

      if(parse.consumeRequired(DeeTokens.OPEN_PARENS).ruleBroken) break parsing;
     
      typeRef = parseTypeReference_ToMissing().node;
     
      if(lookAhead() == DeeTokens.IDENTIFIER) {
        ProtoDefSymbol defId = parseDefId();
        isExpDefUnit = concludeNode(srOf(lastLexElement(), new StaticIfExpIsDefUnit(defId)));
      }
     
      if(tryConsume(DeeTokens.COLON)) {
        specKind = ExpIsSpecialization.TYPE_SUBTYPE;
View Full Code Here

   
    successfulParsing: {
      ParseHelper parse = new ParseHelper(lookAheadElement());
     
      Reference type;
      ProtoDefSymbol defId;
     
      if(lookAhead() == DeeTokens.KW_AUTO) {
        type = parseAutoReference();
        defId = parseDefId(); // Parse a SimpleVariableDef even if id is missing
      } else {
        NodeResult<Reference> typeResult = parseTypeReference();
        type = typeResult.node;
        if(typeResult.ruleBroken) {
          if(revertIfInvalid) break successfulParsing;
          defId = parseMissingDefIdNoError();
        } else {
          defId = parseDefId();
          if(revertIfInvalid && defId.isMissing()) break successfulParsing;
        }
      }
     
      Expression defaultValue = null;
      parse.consumeRequired(DeeTokens.ASSIGN);
View Full Code Here

TOP

Related Classes of dtool.ast.definitions.DefUnit.ProtoDefSymbol

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.