public expression NewVariable(addressed_value variable, expression var_specifiers, LexLocation loc)
            {
                if (var_specifiers is dot_node)
                {
                    var dn = (dot_node)var_specifiers;
                    dn.left = variable;
                }
                else if (var_specifiers is template_param_list)
                {
                    var tpl = (template_param_list)var_specifiers;
                    ((dot_node)tpl.dereferencing_value).left = variable;
                    parsertools.create_source_context(tpl.dereferencing_value, variable, tpl.dereferencing_value);
                }
                else if (var_specifiers is dereference)
                {
                    ((dereference)var_specifiers).dereferencing_value = variable;
                }
                else if (var_specifiers is ident_with_templateparams)
                {
                    ((ident_with_templateparams)var_specifiers).name = (addressed_value_funcname)variable;
                }

                var_specifiers.source_context = loc;
                return(var_specifiers);
            }
Example #2
0
        private List <statement> ProcessDesugaringForConstPattern(is_pattern_expr isExpression)
        {
            var patternExpressionNode = isExpression.right as const_pattern;

            var statementsToAdd = new List <statement>();
            var equalCalls      = new List <bin_expr>();

            foreach (var patternExpression in patternExpressionNode.pattern_expressions.expressions)
            {
                statementsToAdd.Add(GetTypeCompatibilityCheck(isExpression.left, patternExpression));

                equalCalls.Add(
                    new bin_expr(isExpression.left, patternExpression, Operators.Equal, isExpression.source_context
                                 )
                    );
            }
            typeChecks.AddRange(statementsToAdd);
            expression orPatternCases = equalCalls[0];

            for (int i = 1; i < equalCalls.Count; ++i)
            {
                orPatternCases = bin_expr.LogicalOr(orPatternCases, equalCalls[i]);
            }

            ReplaceUsingParent(isExpression, orPatternCases);
            return(statementsToAdd);
        }
        public statement MyStmt(expression ex, statement st)
        {
            // Проверить, что в ex - целый тип
            // Сделать специальный узел для проверки new semantic_check("Тип проверки",params syntax_node[] ob)
            // Включать этот узел первым для "сахарных" узлов синтаксического дерева
            var sc = new semantic_check("ExprIsInteger", ex);

            var id     = new ident("#my");
            var idlist = new ident_list(id);
            var typ    = new named_type_reference("integer");
            var one    = new int32_const(1);
            var vdef   = new var_def_statement(idlist, typ, one, definition_attribute.None, false, null);
            var vstat  = new var_statement(vdef, null);

            var ass         = new assign(new ident("#my"), one, Operators.AssignmentAddition);
            var stlistwhile = new statement_list(st);

            stlistwhile.Add(ass);

            var bin = new bin_expr(id, ex, Operators.LessEqual);

            var wh = new while_node(bin, stlistwhile, WhileCycleType.While);

            var stlist = new statement_list(sc);

            stlist.Add(vstat);
            stlist.Add(wh);
            return(stlist);
        }
            public for_node NewForStmt(bool opt_var, ident identifier, type_definition for_stmt_decl_or_assign,
                                       expression expr1, for_cycle_type fc_type, expression expr2, token_info opt_tk_do, statement stmt,
                                       LexLocation loc)
            {
                var nfs = new for_node(identifier, expr1, expr2, stmt, fc_type, null, for_stmt_decl_or_assign,
                                       opt_var != false, loc);

                if (opt_tk_do == null)
                {
                    file_position    fp      = expr2.source_context.end_position;
                    syntax_tree_node err_stn = stmt;
                    if (err_stn == null)
                    {
                        err_stn = expr2;
                    }
                    parsertools.errors.Add(new PABCNETUnexpectedToken(parsertools.CurrentFileName,
                                                                      StringResources.Get("TKDO"),
                                                                      new SourceContext(fp.line_num, fp.column_num + 1, fp.line_num, fp.column_num + 1, 0, 0),
                                                                      err_stn));
                }

                if (!opt_var && for_stmt_decl_or_assign == null)
                {
                    parsertools.AddWarningFromResource("USING_UNLOCAL_FOR_VARIABLE", identifier.source_context);
                }
                return(nfs);
            }
Example #5
0
        private void DesugarConstPatternCase(expression matchingExpression, pattern_case patternCase)
        {
            Debug.Assert(patternCase.pattern is const_pattern);
            var patternExpressionNode = patternCase.pattern as const_pattern;

            var statementsToAdd = new List <statement>();
            var equalCalls      = new List <bin_expr>();

            foreach (var patternExpression in patternExpressionNode.pattern_expressions.expressions)
            {
                statementsToAdd.Add(GetTypeCompatibilityCheck(matchingExpression, patternExpression));

                equalCalls.Add(
                    new bin_expr(matchingExpression, patternExpression, Operators.Equal, patternCase.source_context
                                 )
                    );
            }
            typeChecks.AddRange(statementsToAdd);

            expression orPatternCases = equalCalls[0];

            for (int i = 1; i < equalCalls.Count; ++i)
            {
                orPatternCases = bin_expr.LogicalOr(orPatternCases, equalCalls[i]);
            }
            var ifCondition = patternCase.condition == null ? orPatternCases : bin_expr.LogicalAnd(orPatternCases, patternCase.condition);
            var ifCheck     = SubtreeCreator.CreateIf(ifCondition, patternCase.case_action);

            // Добавляем полученные statements в результат
            AddDesugaredCaseToResult(ifCheck, ifCheck);
        }
        public void semantic_check_assign_var_tuple(ident_list vars, expression ex)
        {
            // Проверить, что справа - Tuple
            var expr = convert_strong(ex);

            expr = convert_if_typed_expression_to_function_call(expr);

            var t = ConvertSemanticTypeNodeToNETType(expr.type);

            if (t == null)
            {
                AddError(expr.location, "TUPLE_EXPECTED");
            }

            if (!t.FullName.StartsWith("System.Tuple"))
            {
                AddError(expr.location, "TUPLE_EXPECTED");
            }

            var n = vars.idents.Count();

            if (n > t.GetGenericArguments().Count())
            {
                AddError(get_location(vars), "TOO_MANY_ELEMENTS_ON_LEFT_SIDE_OF_TUPLE_ASSIGNMRNT");
            }
        }
        public override void visit(double_question_node dqn)
        {
            var st = dqn.Parent;

            while (!(st is statement))
            {
                st = st.Parent;
            }
            var tname = "#temp" + UniqueNumStr();
            var tt    = new var_statement(new ident(tname), dqn.left);

            tt.var_def.Parent = tt;
            var l = new List <statement>();

            l.Add(tt);
            l.Add(st as statement);
            expression right = dqn.right;
            var        eq    = new bin_expr(new ident(tname), new nil_const(), Operators.NotEqual, dqn.left.source_context);
            var        qce   = new question_colon_expression(eq, new ident(tname), right, dqn.source_context);

            ReplaceUsingParent(dqn, qce);
            visit(qce);
            ReplaceStatementUsingParent(st as statement, l);
            visit(tt);
        }
Example #8
0
        private expression convert_cast_expression(ICSharpCode.NRefactory.Ast.CastExpression expr)
        {
            type_definition td  = get_type_reference(expr.CastTo);
            expression      exp = get_expression(expr.Expression);

            return(new typecast_node(exp as addressed_value, td, op_typecast.typecast));
        }
Example #9
0
        public statement_list NewLambdaBody(expression expr_l1, LexLocation loc)
        {
            var sl = new statement_list();

            sl.expr_lambda_body = true;
            var id = new ident("result");
            var op = new op_type_node(Operators.Assignment);
            //_op_type_node.source_context = parsertools.GetTokenSourceContext();
            var ass = new assign(id, expr_l1, op.type);

            parsertools.create_source_context(ass, id, expr_l1);             // дурацкая функция - если хотя бы у одного sc=null, то возвращает null
            if (ass.source_context == null)
            {
                if (expr_l1.source_context != null)
                {
                    ass.source_context = expr_l1.source_context;
                }
                else if (id.source_context != null)
                {
                    ass.source_context = id.source_context;
                }
            }
            sl.subnodes.Add(ass);
            sl.source_context = loc;
            return(sl);
        }
Example #10
0
        private void CheckIfCanBeMatched(expression matchedExpression, expression patternExpression)
        {
            var patternNode    = convert_strong(patternExpression);
            var patternType    = patternNode.type;
            var expressionNode = convert_strong(matchedExpression);
            var expressionType = expressionNode.type;

            if (!(patternNode is constant_node))
            {
                AddError(get_location(patternExpression), "MATCHING_WITH_NON_CONST");
            }

            var possible_convertion = type_table.get_convertions(patternType, expressionType);
            var expressionTypeName  = expressionType.BaseFullName;
            var patternTypeName     = patternType.BaseFullName;
            var tupleName           = "System.Tuple";

            if (type_table.is_derived(patternType, expressionType) ||
                type_table.is_derived(expressionType, patternType) ||
                possible_convertion.first != null ||
                AreTheSameType(patternType, expressionType) ||
                (expressionTypeName.StartsWith(tupleName) &&
                 patternTypeName.StartsWith(tupleName) &&
                 int.Parse(expressionTypeName.Substring(tupleName.Length + 1, 1)) ==
                 int.Parse(patternTypeName.Substring(tupleName.Length + 1, 1))) ||
                (expressionType.IsPointer && patternNode is null_const_node) ||
                (patternType.IsPointer && expressionNode is null_const_node))
            {
                return;
            }

            AddError(get_location(matchedExpression), "EXPRESSION_OF_TYPE_{0}_CANNOT_BE_MATCHED_AGAINST_PATTERN_WITH_TYPE_{1}", expressionType.name, patternType.name);
        }
Example #11
0
        static expression[] parseBinary(ParameterExpression eRecord, ParameterExpression eArgument, Expression eLeft, eOperation op, Expression eRight)
        {
            HasParam hp         = new HasParam(eRecord);
            bool     leftParam  = hp.hasParameter(eLeft);
            bool     rightParam = hp.hasParameter(eRight);

            if (!(leftParam ^ rightParam))
            {
                throw new NotSupportedException("Binary expression is not supported: must contain a ESENT column on exactly one side of the comparison");
            }

            MemberInfo            mi;
            Func <object, object> val;

            if (leftParam)
            {
                // The column is on the left of the expression
                mi  = parseColumn(eRecord, eLeft);
                val = parseConstant(eArgument, eRight);
            }
            else
            {
                // The column is on the right of the expression
                mi  = parseColumn(eRecord, eRight);
                val = parseConstant(eArgument, eLeft);
                op  = op.invert();
            }
            var res = new expression(mi, op, val);

            return(new expression[1] {
                res
            });
        }
Example #12
0
        public static ident HasName(expression ex, string varname)
        {
            var v = new ExprHasNameVisitor(varname);

            v.ProcessNode(ex);
            return(v.id);
        }
Example #13
0
    public virtual statement mk_return(type ty, Method m)
    {
        if (m.Type == T.Void)
        {
            return(new empty_statement());
        }
        expression expr = null;

        if (m.Type.FullName == "char")
        {
            expr = new character_literal(new InputElement("'\0'"));
        }
        else if (m.Type.IsNumeric && m.Type != T.Decimal)
        {
            expr = new integer_literal(new InputElement("0"));
        }
        else if (m.Type.IsReferenceType)
        {
            expr = new null_literal(new InputElement("null"));
        }
        else if (m.Type.IsValueType)
        {
            expr = new new_expression(ty, argumentList.New());
        }
        statement stmt = new return_statement(expr);

        stmt.method = m;
        return(stmt);
    }
Example #14
0
        private expression DesugarRecursiveParameters(expression expression, pattern_node pattern)
        {
            List <pattern_parameter> parameters = pattern.parameters;
            expression conjunction = new is_pattern_expr(expression, pattern, pattern.source_context);

            for (int i = 0; i < parameters.Count; i++)
            {
                if (parameters[i] is recursive_pattern_parameter parameter)
                {
                    //var parameterType = (parameter.pattern as deconstructor_pattern).type;
                    var newName = NewGeneralName();
                    pattern_parameter varParameter = null;
                    if (pattern is deconstructor_pattern)
                    {
                        varParameter = new var_deconstructor_parameter(newName, null, false);
                    }
                    else if (pattern is collection_pattern)
                    {
                        varParameter = new collection_pattern_var_parameter(newName, null);
                    }
                    else if (pattern is tuple_pattern)
                    {
                        varParameter = new tuple_pattern_var_parameter(newName, null);
                    }
                    parameters[i]       = varParameter;
                    varParameter.Parent = parameters[i];
                    conjunction         = bin_expr.LogicalAnd(conjunction, DesugarRecursiveParameters(newName, parameter.pattern));
                }
            }
            return(conjunction);
        }
        public expression_node visit(expression expr)
        {
            expr.visit(syntax_tree_visitor);

            /*addressed_expression ad = ret_semantic as addressed_expression;
             * if (ad != null && ad.is_addressed)
             * {
             *  if (convertion_data_and_alghoritms.check_for_constant(ad))
             *      ad.is_addressed = false;
             * }*/

            //Надеюсь, это сильно не скажется на производительности, хотя в другом случае этот же код просто будет разбросан по всем метдам syntax_tree_visitor-а.
            base_function_call bfc = ret_semantic as base_function_call;

            if (bfc != null)
            {
                if (bfc.simple_function_node.compile_time_executor != null)
                {
                    expression_node ex = bfc.simple_function_node.compile_time_executor(bfc.location, bfc.parameters.ToArray());
                    if (ex != null)
                    {
                        return(ex);
                    }
                }
            }

            return(ret_semantic as expression_node);
        }
Example #16
0
 private SyntaxTree.if_node CreateIfElse(expression condition, statement thenBody, statement elseBody)
 {
     SyntaxTree.if_node res = new SyntaxTree.if_node();
     res.condition = condition;
     res.then_body = thenBody;
     res.else_body = elseBody;
     return(res);
 }
Example #17
0
 static expression wrap(expression ast, int count)
 {
     if (count > 1)
     {
         ast = new local_expression(ast);
     }
     return(ast);
 }
 /// <summary>
 /// Создать цикл while
 /// </summary>
 /// <param name="condition">Условие цикла</param>
 /// <param name="body">Тело цикла</param>
 /// <returns></returns>
 public static SyntaxTree.while_node CreateWhile(expression condition, statement body)
 {
     SyntaxTree.while_node res = new SyntaxTree.while_node();
     res.CycleType  = WhileCycleType.While;
     res.expr       = condition;
     res.statements = body;
     return(res);
 }
Example #19
0
    static int TypeArgumentCount(expression ast)
    {
        ArgumentCounter c = new ArgumentCounter();
        ASTVisitor      v = new ASTVisitor(c.fn);

        ast.visit(v);
        return(c.Count);
    }
Example #20
0
 public ReferenceFinder1(expression expr, ScopeSyntax scope, compilation_unit cu, string new_val)
 {
     this.expr    = expr;
     this.cu      = cu;
     global       = scope;
     current      = cu;
     this.new_val = new_val;
 }
Example #21
0
        /// <summary>
        /// Проверяет выражение, сопоставляемое с образцом
        /// </summary>
        /// <param name="matchedExpression"></param>
        private void CheckMatchedExpression(expression matchedExpression)
        {
            var convertedExpression = convert_strong(matchedExpression);

            if (convertedExpression.type.IsPointer)
            {
                AddError(get_location(matchedExpression), "PATTERN_MATCHING_DOESNT_SUPPORT_POINTERS");
            }
        }
Example #22
0
        private expression DesugarDeconstructorPatternParameters(deconstructor_pattern pattern)
        {
            expression paramCheckExpr = null;

            for (int i = 0; i < pattern.parameters.Count; ++i)
            {
                if (pattern.parameters[i] is const_pattern_parameter constPattern)
                {
                    var constParamIdent = new ident(NewDeconstructParamId(), pattern.parameters[i].source_context);

                    var eqParams = new expression_list(
                        new List <expression>()
                    {
                        constPattern.const_param,
                        constParamIdent
                    }
                        );

                    var constParamCheck = new method_call(
                        new dot_node(new ident("object"), new ident("Equals")),
                        eqParams,
                        pattern.source_context
                        );

                    pattern.parameters[i] = new var_deconstructor_parameter(
                        constParamIdent,
                        GetTypeDefinitionForConstParam(constPattern.const_param),
                        false,
                        pattern.parameters[i].source_context);

                    paramCheckExpr = paramCheckExpr == null ? (expression)constParamCheck : bin_expr.LogicalAnd(paramCheckExpr, constParamCheck);
                }

                if (pattern.parameters[i] is wild_card_deconstructor_parameter)
                {
                    var wildCardGeneratedParamIdent = new ident(NewDeconstructParamId(), pattern.parameters[i].source_context);
                    pattern.parameters[i] = new var_deconstructor_parameter(
                        wildCardGeneratedParamIdent,
                        null,
                        false,
                        pattern.parameters[i].source_context);
                }

                if (pattern.parameters[i] is recursive_deconstructor_parameter deconstructor_param)
                {
                    if (deconstructor_param.pattern is deconstructor_pattern deconstructor_pattern)
                    {
                        var recursiveChecks = DesugarDeconstructorPatternParameters(deconstructor_pattern);
                        paramCheckExpr = paramCheckExpr == null ?
                                         recursiveChecks :
                                         bin_expr.LogicalAnd(paramCheckExpr, recursiveChecks);
                    }
                }
            }
            return(paramCheckExpr);
        }
 /// <summary>
 /// Создать цикл for
 /// </summary>
 /// <param name="varName">Имя переменной цикла</param>
 /// <param name="initValue">Начальное значение переменной цикла</param>
 /// <param name="finishValue">Конечное значение переменной цикла</param>
 /// <param name="body">Тело цикла</param>
 /// <param name="type">Тип цикла(to / downto)</param>
 /// <returns></returns>
 public static SyntaxTree.for_node CreateFor(string varName, expression initValue, expression finishValue, statement body, for_cycle_type type)
 {
     SyntaxTree.for_node res = new SyntaxTree.for_node();
     res.loop_variable = new ident(varName);
     res.initial_value = initValue;
     res.finish_value  = finishValue;
     res.statements    = body;
     res.cycle_type    = type;
     return(res);
 }
        public typecast_node NewAsIsConstexpr(expression constterm, op_typecast typecastop, type_definition tdef, LexLocation loc)
        {
            var naic = new typecast_node(constterm as addressed_value, tdef, typecastop, loc);

            if (!(constterm is addressed_value))
            {
                parsertools.errors.Add(new bad_operand_type(parsertools.CurrentFileName, constterm.source_context, naic));
            }
            return(naic);
        }
Example #25
0
        private expression GetCollectionItemsEqualCheckAfterGap(addressed_value matchingExpression,
                                                                List <pattern_parameter> toCompare,
                                                                CollectionDesugaringResult desugaringResult)
        {
            var        elemFromTail = 1;
            expression equalChecks  = null;

            foreach (var param in toCompare)
            {
                var indexerCall = new indexer(
                    matchingExpression,
                    new expression_list(
                        new bin_expr(
                            new method_call(
                                new dot_node(
                                    matchingExpression,
                                    new ident("Count", matchingExpression.source_context)),
                                new expression_list()),
                            new int32_const(elemFromTail, matchingExpression.source_context),
                            Operators.Minus),
                        matchingExpression.source_context),
                    matchingExpression.source_context);

                if (param is const_pattern_parameter constParam)
                {
                    var eqParams = new expression_list(
                        new List <expression>()
                    {
                        indexerCall,
                        constParam.const_param
                    }
                        );

                    var equalCall = new method_call(
                        new dot_node(
                            new ident("object"),
                            new ident("Equals")),
                        eqParams,
                        matchingExpression.source_context
                        );

                    equalChecks = equalChecks == null ? (expression)equalCall : bin_expr.LogicalAnd(equalChecks, equalCall);
                    desugaringResult.ElemTypeChecks.Add(GetTypeCompatibilityCheck(indexerCall, constParam.const_param));
                }

                if (param is collection_pattern_var_parameter varParam)
                {
                    desugaringResult.VarParametersDeclarations.Add(
                        new var_statement(varParam.identifier, indexerCall));
                }

                ++elemFromTail;
            }
            return(equalChecks);
        }
Example #26
0
        private expression convert_binary_expression(ICSharpCode.NRefactory.Ast.BinaryOperatorExpression expr)
        {
            Operators  op    = Operators.Undefined;
            expression left  = convert_expression(expr.Left);
            expression right = convert_expression(expr.Right);

            switch (expr.Op)
            {
            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.Add: op = Operators.Plus; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.Subtract: op = Operators.Minus; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.Multiply: op = Operators.Multiplication; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.Divide: op = Operators.Division; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.LessThan: op = Operators.Less; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.LessThanOrEqual: op = Operators.LessEqual; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.GreaterThan: op = Operators.Greater; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.GreaterThanOrEqual: op = Operators.GreaterEqual; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.Equality: op = Operators.Equal; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.InEquality: op = Operators.NotEqual; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.LogicalAnd: op = Operators.LogicalAND; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.LogicalOr: op = Operators.LogicalOR; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.ExclusiveOr: op = Operators.BitwiseXOR; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.Like: op = Operators.Equal; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.DivideInteger: op = Operators.IntegerDivision; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.Modulus: op = Operators.ModulusRemainder; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.BitwiseAnd: op = Operators.BitwiseAND; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.BitwiseOr: op = Operators.BitwiseOR; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.ReferenceEquality: op = Operators.Equal; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.ReferenceInequality: op = Operators.NotEqual; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.ShiftLeft: op = Operators.BitwiseLeftShift; break;

            case ICSharpCode.NRefactory.Ast.BinaryOperatorType.ShiftRight: op = Operators.BitwiseRightShift; break;
            }
            return(new bin_expr(left, right, op));
        }
        void DesugarDeconstructorPatternCase(expression matchingExpression, pattern_case patternCase)
        {
            Debug.Assert(patternCase.pattern is deconstructor_pattern);

            var isExpression = new is_pattern_expr(matchingExpression, patternCase.pattern);
            var ifCondition  = patternCase.condition == null ? (expression)isExpression : bin_expr.LogicalAnd(isExpression, patternCase.condition);
            var ifCheck      = SubtreeCreator.CreateIf(ifCondition, patternCase.case_action);

            // Добавляем полученные statements в результат
            AddDesugaredCaseToResult(ifCheck, ifCheck);
        }
        /// <summary>
        /// Создать var-выражение
        /// </summary>
        /// <param name="name">Имя переменной</param>
        /// <param name="initialValue">Начальное значение</param>
        /// <returns></returns>
        public static var_def_statement CreateVarDef(string name, expression initialValue)
        {
            ident_list list = new ident_list();

            list.idents.Add(new ident(name));
            var res = new var_def_statement();

            res.inital_value = initialValue;
            res.vars         = list;
            return(res);
        }
Example #29
0
        private void DefaultDesugarPattern(expression matchingExpression, pattern_case patternCase)
        {
            //var paramCheckExpr = DesugarDeconstructorPatternParameters(patternCase.pattern as deconstructor_pattern);

            var isExpression = new is_pattern_expr(matchingExpression, patternCase.pattern, patternCase.source_context);
            var ifCondition  = patternCase.condition == null ? (expression)isExpression : bin_expr.LogicalAnd(isExpression, patternCase.condition);
            var ifCheck      = SubtreeCreator.CreateIf(ifCondition, patternCase.case_action);

            // Добавляем полученные statements в результат
            AddDesugaredCaseToResult(ifCheck, ifCheck);
        }
Example #30
0
 public override void visit(new_expr newExpr)
 {
     if (newExpr.params_list != null && newExpr.params_list.expressions != null)
     {
         for (int i = 0; i < newExpr.params_list.expressions.Count; i++)
         {
             expression expr = newExpr.params_list.expressions[i];
             ProcessNode(expr);
         }
     }
 }
Example #31
0
 public InterpretationPlanCheckCondition(expression.AreAttributesEqual condition, InterpretationPlanEdgeMatcher edgeMatcher, int indexOfCorrespondingEdge)
 {
     this.condition = condition;
     this.edgeMatcher = edgeMatcher;
     this.indexOfCorrespondingElement = indexOfCorrespondingEdge;
     AssignId();
 }
Example #32
0
		public override void visit(expression _expression)
		{
			executer.visit(_expression);
			if (_expression.attributes != null)
				this.visit((dynamic)_expression.attributes);
		}
Example #33
0
		public virtual void post_do_visit(expression _expression)
		{
		}
Example #34
0
		public override void visit(expression _expression)
		{
			DefaultVisit(_expression);
			pre_do_visit(_expression);
			post_do_visit(_expression);
		}
		public virtual void visit(expression _expression)
		{
			DefaultVisit(_expression);
		}
Example #36
0
		public virtual void visit(expression _expression)
		{
		}