Пример #1
0
        // Generate a codedom return statement.
        public static CodeStatement Emit(Return r)
        {
            var codeMethodReturnStatement = new CodeMethodReturnStatement();

            // Attach the expression to return, if any.
            if(r.ChildExpressions.Count > 0)
                codeMethodReturnStatement.Expression = CodeDomEmitter.EmitCodeExpression(r.ChildExpressions[0]);

            return codeMethodReturnStatement;
        }
Пример #2
0
        // Build a return statement that returns a value
        void BuildReturnValue(IronyParser parser, Root root, Expression parentExpression, ParseTreeNode currentNode)
        {
            Return e = new Return(parentExpression, currentNode.FindToken().Convert());
            parentExpression.ChildExpressions.Add(e);
            e.ParentExpression = parentExpression;

            ConsumeParseTree(root, e, currentNode.ChildNodes[1]);
        }