Пример #1
0
        private AssignNode createIndexAccumulator(VariableIdNode idNode, Dictionary <string, IProperty> symbolTable, Token token)
        {
            AssignNode accumulator = new AssignNode(idNode, symbolTable, token);

            BinOpNode accumulationOperation = new BinOpNode(token);

            accumulationOperation.Operation = TokenType.BINARY_OP_ADD;
            accumulationOperation.AddExpression(idNode);
            accumulationOperation.AddExpression(new IntValueNode(1, token));

            accumulator.ExprNode = accumulationOperation;

            return(accumulator);
        }
Пример #2
0
        public BinOpNode CreateBinOpNode(IExpressionContainer parent, IExpressionNode leftHandSide, Token operation)
        {
            BinOpNode binOp = new BinOpNode(parent.Token);

            binOp.AddExpression(leftHandSide);
            binOp.Operation = operation.Type;
            parent.AddExpression(binOp);

            return(binOp);
        }