⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regexpanalyzer.cs

📁 Grammatica is a C# and Java parser generator (compiler compiler). It improves upon simlar tools (lik
💻 CS
📖 第 1 页 / 共 2 页
字号:
/* * RegexpAnalyzer.cs *  * THIS FILE HAS BEEN GENERATED AUTOMATICALLY. DO NOT EDIT! *  * This work is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. *  * This work is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. *  * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA *  * As a special exception, the copyright holders of this library give * you permission to link this library with independent modules to * produce an executable, regardless of the license terms of these * independent modules, and to copy and distribute the resulting * executable under terms of your choice, provided that you also meet, * for each linked independent module, the terms and conditions of the * license of that module. An independent module is a module which is * not derived from or based on this library. If you modify this * library, you may extend this exception to your version of the * library, but you are not obligated to do so. If you do not wish to * do so, delete this exception statement from your version. *  * Copyright (c) 2003 Per Cederberg. All rights reserved. */using PerCederberg.Grammatica.Parser;namespace PerCederberg.Grammatica.Test {    /**     * <remarks>A class providing callback methods for the     * parser.</remarks>     */    internal abstract class RegexpAnalyzer : Analyzer {        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public override void Enter(Node node) {            switch (node.GetId()) {            case (int) RegexpConstants.LEFT_PAREN:                EnterLeftParen((Token) node);                break;            case (int) RegexpConstants.RIGHT_PAREN:                EnterRightParen((Token) node);                break;            case (int) RegexpConstants.LEFT_BRACKET:                EnterLeftBracket((Token) node);                break;            case (int) RegexpConstants.RIGHT_BRACKET:                EnterRightBracket((Token) node);                break;            case (int) RegexpConstants.LEFT_BRACE:                EnterLeftBrace((Token) node);                break;            case (int) RegexpConstants.RIGHT_BRACE:                EnterRightBrace((Token) node);                break;            case (int) RegexpConstants.QUESTION:                EnterQuestion((Token) node);                break;            case (int) RegexpConstants.ASTERISK:                EnterAsterisk((Token) node);                break;            case (int) RegexpConstants.PLUS:                EnterPlus((Token) node);                break;            case (int) RegexpConstants.VERTICAL_BAR:                EnterVerticalBar((Token) node);                break;            case (int) RegexpConstants.DOT:                EnterDot((Token) node);                break;            case (int) RegexpConstants.COMMA:                EnterComma((Token) node);                break;            case (int) RegexpConstants.NUMBER:                EnterNumber((Token) node);                break;            case (int) RegexpConstants.CHAR:                EnterChar((Token) node);                break;            case (int) RegexpConstants.EXPR:                EnterExpr((Production) node);                break;            case (int) RegexpConstants.TERM:                EnterTerm((Production) node);                break;            case (int) RegexpConstants.FACT:                EnterFact((Production) node);                break;            case (int) RegexpConstants.ATOM:                EnterAtom((Production) node);                break;            case (int) RegexpConstants.ATOM_MODIFIER:                EnterAtomModifier((Production) node);                break;            case (int) RegexpConstants.CHARACTER_SET:                EnterCharacterSet((Production) node);                break;            case (int) RegexpConstants.CHARACTER:                EnterCharacter((Production) node);                break;            }        }        /**         * <summary>Called when exiting a parse tree node.</summary>         *          * <param name='node'>the node being exited</param>         *          * <returns>the node to add to the parse tree, or         *          null if no parse tree should be created</returns>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public override Node Exit(Node node) {            switch (node.GetId()) {            case (int) RegexpConstants.LEFT_PAREN:                return ExitLeftParen((Token) node);            case (int) RegexpConstants.RIGHT_PAREN:                return ExitRightParen((Token) node);            case (int) RegexpConstants.LEFT_BRACKET:                return ExitLeftBracket((Token) node);            case (int) RegexpConstants.RIGHT_BRACKET:                return ExitRightBracket((Token) node);            case (int) RegexpConstants.LEFT_BRACE:                return ExitLeftBrace((Token) node);            case (int) RegexpConstants.RIGHT_BRACE:                return ExitRightBrace((Token) node);            case (int) RegexpConstants.QUESTION:                return ExitQuestion((Token) node);            case (int) RegexpConstants.ASTERISK:                return ExitAsterisk((Token) node);            case (int) RegexpConstants.PLUS:                return ExitPlus((Token) node);            case (int) RegexpConstants.VERTICAL_BAR:                return ExitVerticalBar((Token) node);            case (int) RegexpConstants.DOT:                return ExitDot((Token) node);            case (int) RegexpConstants.COMMA:                return ExitComma((Token) node);            case (int) RegexpConstants.NUMBER:                return ExitNumber((Token) node);            case (int) RegexpConstants.CHAR:                return ExitChar((Token) node);            case (int) RegexpConstants.EXPR:                return ExitExpr((Production) node);            case (int) RegexpConstants.TERM:                return ExitTerm((Production) node);            case (int) RegexpConstants.FACT:                return ExitFact((Production) node);            case (int) RegexpConstants.ATOM:                return ExitAtom((Production) node);            case (int) RegexpConstants.ATOM_MODIFIER:                return ExitAtomModifier((Production) node);            case (int) RegexpConstants.CHARACTER_SET:                return ExitCharacterSet((Production) node);            case (int) RegexpConstants.CHARACTER:                return ExitCharacter((Production) node);            }            return node;        }        /**         * <summary>Called when adding a child to a parse tree         * node.</summary>         *          * <param name='node'>the parent node</param>         * <param name='child'>the child node, or null</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public override void Child(Production node, Node child) {            switch (node.GetId()) {            case (int) RegexpConstants.EXPR:                ChildExpr(node, child);                break;            case (int) RegexpConstants.TERM:                ChildTerm(node, child);                break;            case (int) RegexpConstants.FACT:                ChildFact(node, child);                break;            case (int) RegexpConstants.ATOM:                ChildAtom(node, child);                break;            case (int) RegexpConstants.ATOM_MODIFIER:                ChildAtomModifier(node, child);                break;            case (int) RegexpConstants.CHARACTER_SET:                ChildCharacterSet(node, child);                break;            case (int) RegexpConstants.CHARACTER:                ChildCharacter(node, child);                break;            }        }        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual void EnterLeftParen(Token node) {        }        /**         * <summary>Called when exiting a parse tree node.</summary>         *          * <param name='node'>the node being exited</param>         *          * <returns>the node to add to the parse tree, or         *          null if no parse tree should be created</returns>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual Node ExitLeftParen(Token node) {            return node;        }        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual void EnterRightParen(Token node) {        }        /**         * <summary>Called when exiting a parse tree node.</summary>         *          * <param name='node'>the node being exited</param>         *          * <returns>the node to add to the parse tree, or         *          null if no parse tree should be created</returns>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual Node ExitRightParen(Token node) {            return node;        }        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual void EnterLeftBracket(Token node) {        }        /**         * <summary>Called when exiting a parse tree node.</summary>         *          * <param name='node'>the node being exited</param>         *          * <returns>the node to add to the parse tree, or         *          null if no parse tree should be created</returns>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual Node ExitLeftBracket(Token node) {            return node;        }        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual void EnterRightBracket(Token node) {        }        /**         * <summary>Called when exiting a parse tree node.</summary>         *          * <param name='node'>the node being exited</param>         *          * <returns>the node to add to the parse tree, or         *          null if no parse tree should be created</returns>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual Node ExitRightBracket(Token node) {            return node;        }        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual void EnterLeftBrace(Token node) {        }        /**         * <summary>Called when exiting a parse tree node.</summary>         *          * <param name='node'>the node being exited</param>         *          * <returns>the node to add to the parse tree, or         *          null if no parse tree should be created</returns>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual Node ExitLeftBrace(Token node) {            return node;        }        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual void EnterRightBrace(Token node) {        }        /**         * <summary>Called when exiting a parse tree node.</summary>         *          * <param name='node'>the node being exited</param>         *          * <returns>the node to add to the parse tree, or         *          null if no parse tree should be created</returns>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual Node ExitRightBrace(Token node) {            return node;        }        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual void EnterQuestion(Token node) {        }        /**         * <summary>Called when exiting a parse tree node.</summary>         *          * <param name='node'>the node being exited</param>         *          * <returns>the node to add to the parse tree, or         *          null if no parse tree should be created</returns>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual Node ExitQuestion(Token node) {            return node;        }        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual void EnterAsterisk(Token node) {        }        /**         * <summary>Called when exiting a parse tree node.</summary>         *          * <param name='node'>the node being exited</param>         *          * <returns>the node to add to the parse tree, or         *          null if no parse tree should be created</returns>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>         */        public virtual Node ExitAsterisk(Token node) {            return node;        }        /**         * <summary>Called when entering a parse tree node.</summary>         *          * <param name='node'>the node being entered</param>         *          * <exception cref='ParseException'>if the node analysis         * discovered errors</exception>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -