Exemple #1
0
        public ExtendExpression ParseExtendExpression()
        {
            NextToken();
            var id  = ((IdentifierExpression)ParseIdentifierExpression()).Identifier;
            var exp = new ExtendExpression(id, ParseObjectExpression());

            return(exp);
            //var condition = ParseCondition();
            //var body = ParseBlock();
            //List<Expression> elseBody = null;
            //if (_currentToken.TokenType == AphidTokenType.elseKeyword)
            //{
            //    NextToken();
            //    elseBody = ParseBlock();
            //}
            //return new IfExpression(condition, body, elseBody);
        }
        public static ExtendExpression Create(
            AphidExpressionContext context_aphidExpressionContext,
            IdentifierExpression extendType_identifierExpression,
            ObjectExpression object_objectExpression,
            int value_i,
            int value_i1
            )
        {
            ExtendExpression extendExpression
                = new ExtendExpression(context_aphidExpressionContext,
                                       extendType_identifierExpression, object_objectExpression);

            ((AphidExpression)extendExpression).Index  = value_i;
            ((AphidExpression)extendExpression).Length = value_i1;
            return(extendExpression);

            // TODO: Edit factory method of ExtendExpression
            // This method should be able to configure the object in all possible ways.
            // Add as many parameters as needed,
            // and assign their values to each field by using the API.
        }
Exemple #3
0
 private void InterpretExtendExpression(ExtendExpression expression)
 {
     var obj = InterpretObjectExpression(expression.Object);
     TypeExtender.Extend(this, expression.ExtendType, obj);
 }
 public ExtendExpression ParseExtendExpression()
 {
     NextToken();
     var id = ((IdentifierExpression)ParseIdentifierExpression()).Identifier;
     var exp = new ExtendExpression(id, ParseObjectExpression());
     return exp;
     //var condition = ParseCondition();
     //var body = ParseBlock();
     //List<Expression> elseBody = null;
     //if (_currentToken.TokenType == AphidTokenType.elseKeyword)
     //{
     //    NextToken();
     //    elseBody = ParseBlock();
     //}
     //return new IfExpression(condition, body, elseBody);
 }