Package net.percederberg.grammatica.code.csharp

Examples of net.percederberg.grammatica.code.csharp.CSharpMethod.addCode()


        method = new CSharpMethod(CSharpMethod.PROTECTED + CSharpMethod.OVERRIDE,
                                  "NewTokenizer",
                                  "TextReader input",
                                  "Tokenizer");
        method.addComment(new CSharpComment(FACTORY_COMMENT));
        method.addCode("return new " + tokenizer.getClassName() + "(input);");
        cls.addMethod(method);

        // Add init method
        cls.addMethod(initMethod);
        initMethod.addComment(new CSharpComment(INIT_METHOD_COMMENT));
View Full Code Here


        m = new CSharpMethod(CSharpMethod.PUBLIC + CSharpMethod.VIRTUAL,
                             "Exit" + name,
                             type + " node",
                             "Node");
        m.addComment(new CSharpComment(EXIT_COMMENT));
        m.addCode("return node;");
        cls.addMethod(m);
    }

    /**
     * Adds an add child method to this file.
View Full Code Here

        m = new CSharpMethod(CSharpMethod.PUBLIC + CSharpMethod.VIRTUAL,
                             "Child" + name,
                             "Production node, Node child",
                             "void");
        m.addComment(new CSharpComment(CHILD_COMMENT));
        m.addCode("node.AddChild(child);");
        cls.addMethod(m);
    }

    /**
     * Returns the class name for this analyzer.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.