亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? parser.cs

?? Grammatica is a C# and Java parser generator (compiler compiler). It improves upon simlar tools (lik
?? CS
?? 第 1 頁 / 共 2 頁
字號(hào):
/* * Parser.cs * * 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 System;using System.Collections;using System.Text;namespace PerCederberg.Grammatica.Parser {    /**     * A base parser class. This class provides the standard parser      * interface, as well as token handling.     *     * @author   Per Cederberg, <per at percederberg dot net>     * @version  1.4     */    public abstract class Parser {            /**         * The parser initialization flag.         */        private bool initialized = false;            /**         * The tokenizer to use.         */        private Tokenizer tokenizer;            /**         * The analyzer to use for callbacks.         */        private Analyzer analyzer;            /**         * The list of production patterns.          */        private ArrayList patterns = new ArrayList();            /**         * The map with production patterns and their id:s. This map          * contains the production patterns indexed by their id:s.         */        private Hashtable patternIds = new Hashtable();            /**         * The list of buffered tokens. This list will contain tokens that         * have been read from the tokenizer, but not yet consumed.         */        private ArrayList tokens = new ArrayList();                /**         * The error log. All parse errors will be added to this log as         * the parser attempts to recover from the error. If the error         * count is higher than zero (0), this log will be thrown as the         * result from the parse() method.          */        private ParserLogException errorLog = new ParserLogException();            /**         * The error recovery counter. This counter is initially set to a         * negative value to indicate that no error requiring recovery          * has been encountered. When a parse error is found, the counter         * is set to three (3), and is then decreased by one for each          * correctly read token until it reaches zero (0).           */        private int errorRecovery = -1;            /**         * Creates a new parser.         *          * @param tokenizer       the tokenizer to use         */        internal Parser(Tokenizer tokenizer)             : this(tokenizer, null) {        }        /**         * Creates a new parser.         *          * @param tokenizer       the tokenizer to use         * @param analyzer        the analyzer callback to use         */        internal Parser(Tokenizer tokenizer, Analyzer analyzer) {            this.tokenizer = tokenizer;            if (analyzer == null) {                this.analyzer = new Analyzer();            } else {                this.analyzer = analyzer;            }        }        /**         * Returns the tokenizer in use by this parser.         *          * @return the tokenizer in use by this parser         *          * @since 1.4         */        public Tokenizer GetTokenizer() {            return tokenizer;        }        /**         * Returns the analyzer in use by this parser.         *          * @return the analyzer in use by this parser         *          * @since 1.4         */        public Analyzer GetAnalyzer() {            return analyzer;        }        /**         * Sets the parser initialized flag. Normally this flag is set by         * the prepare() method, but this method allows further          * modifications to it.         *          * @param initialized    the new initialized flag         */        internal void SetInitialized(bool initialized) {            this.initialized = initialized;        }            /**         * Adds a new production pattern to the parser. The first pattern          * added is assumed to be the starting point in the grammar. The          * patterns added may be validated to some extent.         *          * @param pattern        the pattern to add         *          * @throws ParserCreationException if the pattern couldn't be          *             added correctly to the parser         */        public virtual void AddPattern(ProductionPattern pattern) {            if (pattern.GetAlternativeCount() <= 0) {                throw new ParserCreationException(                    ParserCreationException.ErrorType.INVALID_PRODUCTION,                    pattern.GetName(),                    "no production alternatives are present (must have at " +                    "least one)");            }            if (patternIds.ContainsKey(pattern.GetId())) {                throw new ParserCreationException(                    ParserCreationException.ErrorType.INVALID_PRODUCTION,                    pattern.GetName(),                    "another pattern with the same id (" + pattern.GetId() +                     ") has already been added");            }            patterns.Add(pattern);            patternIds.Add(pattern.GetId(), pattern);            SetInitialized(false);        }            /**         * Initializes the parser. All the added production patterns will         * be analyzed for ambiguities and errors. This method also          * initializes internal data structures used during the parsing.          *          * @throws ParserCreationException if the parser couldn't be          *             initialized correctly          */        public virtual void Prepare() {            if (patterns.Count <= 0) {                throw new ParserCreationException(                    ParserCreationException.ErrorType.INVALID_PARSER,                    "no production patterns have been added");            }            for (int i = 0; i < patterns.Count; i++) {                CheckPattern((ProductionPattern) patterns[i]);            }            SetInitialized(true);        }            /**         * Checks a production pattern for completeness. If some rule         * in the pattern referenced an production pattern not added         * to this parser, a parser creation exception will be thrown.         *          * @param pattern        the production pattern to check         *          * @throws ParserCreationException if the pattern referenced a          *             pattern not added to this parser         */        private void CheckPattern(ProductionPattern pattern) {            for (int i = 0; i < pattern.GetAlternativeCount(); i++) {                CheckRule(pattern.GetName(), pattern.GetAlternative(i));                 }        }        /**         * Checks a production pattern rule for completeness. If some         * element in the rule referenced an production pattern not         * added to this parser, a parser creation exception will be         * thrown.         *         * @param name           the name of the pattern being checked          * @param rule           the production pattern rule to check         *          * @throws ParserCreationException if the rule referenced a          *             pattern not added to this parser         */        private void CheckRule(string name,                                ProductionPatternAlternative rule) {                        for (int i = 0; i < rule.GetElementCount(); i++) {                CheckElement(name, rule.GetElement(i));            }        }        /**         * Checks a production pattern element for completeness. If         * the element references a production pattern not added to         * this parser, a parser creation exception will be thrown.         *          * @param name           the name of the pattern being checked          * @param elem           the production pattern element to check         *          * @throws ParserCreationException if the element referenced a         *             pattern not added to this parser         */        private void CheckElement(string name,                                   ProductionPatternElement elem) {            if (elem.IsProduction() && GetPattern(elem.GetId()) == null) {                throw new ParserCreationException(                    ParserCreationException.ErrorType.INVALID_PRODUCTION,                    name,                    "an undefined production pattern id (" + elem.GetId() +                    ") is referenced");            }        }        /**         * Parses the token stream and returns a parse tree. This method         * will call prepare() if not previously called. In case of a          * parse error, the parser will attempt to recover and throw all         * the errors found in a parser log exception in the end.         *          * @return the parse tree         *          * @throws ParserCreationException if the parser couldn't be         *             initialized correctly         * @throws ParserLogException if the input couldn't be parsed          *             correctly         *          * @see #prepare         */        public Node Parse() {            Node  root = null;                // Initialize parser            if (!initialized) {                Prepare();            }                // Parse input            try {                root = ParseStart();            } catch (ParseException e) {                AddError(e, true);            }                        // Check for errors            if (errorLog.GetErrorCount() > 0) {                throw errorLog;            }                return root;        }            /**         * Parses the token stream and returns a parse tree.         *          * @return the parse tree         *          * @throws ParseException if the input couldn't be parsed          *             correctly         */        protected abstract Node ParseStart();            /**         * Adds an error to the error log. If the parser is in error          * recovery mode, the error will not be added to the log. If the         * recovery flag is set, this method will set the error recovery          * counter thus enter error recovery mode. Only lexical or          * syntactical errors require recovery, so this flag shouldn't be         * set otherwise.         *          * @param e              the error to add         * @param recovery       the recover flag          */        internal void AddError(ParseException e, bool recovery) {            if (errorRecovery <= 0) {                errorLog.AddError(e);            }            if (recovery) {                errorRecovery = 3;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品菠萝久久久久久久| 亚洲色图一区二区| 91麻豆免费视频| 精品一区二区三区影院在线午夜| 亚洲色图欧洲色图婷婷| 欧美成人三级在线| 欧美日韩激情在线| 96av麻豆蜜桃一区二区| 国产自产高清不卡| 五月激情丁香一区二区三区| 日韩美女视频19| 国产欧美视频一区二区| 日韩免费性生活视频播放| 欧美综合色免费| 99精品国产99久久久久久白柏| 久久精品久久综合| 日本在线观看不卡视频| 亚洲二区在线观看| 亚洲免费看黄网站| 国产精品日日摸夜夜摸av| 精品国产制服丝袜高跟| 欧美精品日韩一本| 欧美性感一类影片在线播放| 99久久99久久免费精品蜜臀| 国产传媒欧美日韩成人| 国产一区亚洲一区| 韩国一区二区三区| 日本视频在线一区| 免费成人在线播放| 日韩成人dvd| 青青草97国产精品免费观看 | 一区二区三区蜜桃| 亚洲乱码一区二区三区在线观看| 国产日韩欧美电影| 国产欧美日韩三区| 中文av一区特黄| 国产精品久久久久久久蜜臀| 国产欧美一区二区三区鸳鸯浴| 精品国产乱码久久| 337p粉嫩大胆噜噜噜噜噜91av| 精品国精品国产尤物美女| 久久亚洲精精品中文字幕早川悠里| 日韩一区二区三区四区五区六区| 91精品国产免费| 日韩欧美中文一区| www国产成人| 国产日本欧美一区二区| 国产精品理论片| 亚洲天堂福利av| 亚洲一区二区在线观看视频| 午夜视频在线观看一区二区| 日韩高清不卡一区二区| 黑人巨大精品欧美黑白配亚洲| 国产中文字幕精品| 成人av网在线| 欧美在线观看一区二区| 欧美日韩成人高清| 欧美大肚乱孕交hd孕妇| 国产亚洲美州欧州综合国| 中文字幕制服丝袜一区二区三区 | 国产精品中文有码| 色综合久久综合网欧美综合网| av网站免费线看精品| 欧美中文字幕一二三区视频| 欧美一区二区三区思思人 | 亚洲私人影院在线观看| 亚洲精品伦理在线| 亚瑟在线精品视频| 精品中文字幕一区二区小辣椒| 国产成人精品在线看| 色视频成人在线观看免| 欧美一区二区三区色| 国产亚洲成年网址在线观看| 亚洲乱码中文字幕综合| 久久精品国产免费| 99久久精品免费看国产免费软件| 欧美午夜一区二区三区免费大片| 日韩欧美电影一二三| 亚洲人成人一区二区在线观看 | 亚洲色图清纯唯美| 麻豆国产精品官网| 96av麻豆蜜桃一区二区| 日韩一二三区不卡| 亚洲欧美日韩国产综合在线 | 99精品视频在线观看| 91精品麻豆日日躁夜夜躁| 欧美韩国日本一区| 午夜精品久久久久影视| 成人免费高清在线观看| 欧美老肥妇做.爰bbww| 中文字幕不卡的av| 日韩精品电影在线| 99久久久无码国产精品| 精品国产乱码久久久久久蜜臀| 亚洲精选免费视频| 国产精品18久久久久久久网站| 欧美午夜在线观看| 成人欧美一区二区三区1314| 美女视频一区在线观看| 在线观看视频一区| 国产精品日日摸夜夜摸av| 看电视剧不卡顿的网站| 欧美三级电影在线看| 成人免费小视频| 国产一区免费电影| 日韩美女主播在线视频一区二区三区| 一区二区激情小说| 成人免费黄色大片| 久久精品视频免费| 麻豆91在线播放| 欧美日韩日日夜夜| 一区二区三区免费观看| 成人国产精品免费观看动漫| 精品日韩成人av| 日本少妇一区二区| 在线综合视频播放| 亚洲国产aⅴ成人精品无吗| 97精品电影院| 中文字幕制服丝袜一区二区三区| 国产麻豆精品视频| 26uuu精品一区二区| 免费欧美日韩国产三级电影| 欧美日韩国产综合视频在线观看 | 中文字幕一区二区三区四区| 国产精品一区一区三区| 精品卡一卡二卡三卡四在线| 秋霞影院一区二区| 欧美一区二区美女| 日本欧美一区二区| 欧美一区二区视频在线观看2022 | 亚洲精品视频在线| 色综合色综合色综合| 亚洲色图制服丝袜| 91久久奴性调教| 亚洲一二三四久久| 欧美美女bb生活片| 三级成人在线视频| 制服.丝袜.亚洲.另类.中文| 日本系列欧美系列| 精品国产乱码久久久久久老虎 | 日韩精品一区二区三区在线播放 | 欧美久久久久久久久久| 五月综合激情日本mⅴ| 69久久夜色精品国产69蝌蚪网| 午夜精品久久久| 日韩视频在线永久播放| 麻豆国产精品一区二区三区| 精品国产91乱码一区二区三区| 国内精品免费在线观看| 国产精品乱码一区二区三区软件| 99久久国产综合精品麻豆| 亚洲一二三区视频在线观看| 91精品国产美女浴室洗澡无遮挡| 久久精品国产免费| 国产精品久久三| 欧美色图激情小说| 免费精品视频最新在线| 久久免费看少妇高潮| 91污片在线观看| 亚洲成av人片一区二区梦乃| 日韩免费电影一区| www.亚洲色图.com| 亚洲不卡av一区二区三区| 精品国产亚洲一区二区三区在线观看 | 国产农村妇女精品| 一本久久精品一区二区| 天堂资源在线中文精品| 精品国产一区二区精华| 91污片在线观看| 乱中年女人伦av一区二区| 中文字幕成人在线观看| 精品视频在线看| 国产在线视频不卡二| 亚洲综合色自拍一区| 日韩欧美美女一区二区三区| 懂色中文一区二区在线播放| 亚洲成av人片在线| 中文字幕免费一区| 欧美精品第一页| 成人av在线观| 免费人成黄页网站在线一区二区| 国产精品私人影院| 日韩一区二区三区三四区视频在线观看 | 日韩黄色免费网站| 国产精品免费看片| 日韩一区二区在线播放| aa级大片欧美| 狠狠色综合日日| 亚洲永久精品大片| 91福利国产精品| 日韩午夜av一区| 视频精品一区二区| 国产精品视频看| 亚洲视频免费在线| 欧美一区二区视频网站| 日本视频一区二区三区| 亚洲精品免费在线| 国产日产欧美一区| 精品盗摄一区二区三区| 欧美视频日韩视频|