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

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

?? parser.cs

?? Grammatica是一個C#和Java的語法分析程序生成器(編譯器的編譯器)。它可以用LL(k)語法創(chuàng)建可讀的和帶有注釋的源代碼。它也支持創(chuàng)建一個運(yùn)行時語法分析器
?? CS
?? 第 1 頁 / 共 2 頁
字號:
/* * 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.1     */    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, new Analyzer()) {        }        /**         * 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;            this.analyzer = 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;            }        }            /**         * Returns the production pattern with the specified id.         *           * @param id             the production pattern id         *          * @return the production pattern found, or         *         null if non-existent         */        internal ProductionPattern GetPattern(int id) {            return (ProductionPattern) patternIds[id];

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区免费在线| 国产成人免费在线| 亚洲成人av中文| 亚洲三级在线免费观看| 久久精品欧美日韩| 久久久精品2019中文字幕之3| 精品久久久久久久久久久久久久久久久| 欧美日韩国产片| 欧美日产在线观看| 8x福利精品第一导航| 欧美二区乱c少妇| 91精品国产一区二区三区蜜臀| 91精品婷婷国产综合久久性色| 欧美乱熟臀69xxxxxx| 日韩欧美第一区| 久久只精品国产| 中文无字幕一区二区三区| 国产精品进线69影院| 亚洲美女一区二区三区| 亚洲一区二区三区视频在线播放| 亚洲图片一区二区| 蜜臀a∨国产成人精品| 国产做a爰片久久毛片| 大尺度一区二区| 91麻豆国产香蕉久久精品| 色8久久人人97超碰香蕉987| 欧美三级午夜理伦三级中视频| 在线91免费看| xfplay精品久久| 中文字幕亚洲精品在线观看| 亚洲一线二线三线久久久| 日韩vs国产vs欧美| 国产成人在线视频网站| 91免费视频网| 91精品国产综合久久精品| 国产欧美日韩在线观看| 亚洲精品乱码久久久久久黑人| 日韩专区一卡二卡| 国产精品一二三四五| 95精品视频在线| 欧美一二三在线| 欧美极品另类videosde| 亚洲一级二级在线| 久久精品免费观看| av在线不卡免费看| 欧美一区二区成人6969| 欧美国产日本韩| 亚洲不卡在线观看| 国产成人日日夜夜| 欧美另类z0zxhd电影| 久久精品一区二区三区av| 日韩美女精品在线| 精品制服美女丁香| 在线一区二区视频| 久久久久88色偷偷免费| 亚洲国产成人av网| 成人精品一区二区三区中文字幕| 欧美亚洲高清一区二区三区不卡| 国产亚洲综合av| 日韩高清不卡一区| av在线不卡电影| 久久久久久久久久久久久夜| 亚洲午夜视频在线| 播五月开心婷婷综合| 日韩精品中文字幕一区二区三区| 综合久久给合久久狠狠狠97色| 六月丁香综合在线视频| 欧洲精品视频在线观看| 国产午夜精品久久久久久久| 日日夜夜精品视频天天综合网| www.99精品| 精品精品国产高清a毛片牛牛| 亚洲一区二区三区四区在线| 不卡的av中国片| 久久久高清一区二区三区| 午夜激情综合网| 色噜噜狠狠一区二区三区果冻| 国产精品情趣视频| 黄网站免费久久| 91精品欧美久久久久久动漫| 亚洲美女免费视频| 大白屁股一区二区视频| 久久亚洲影视婷婷| 另类人妖一区二区av| 欧美美女激情18p| 亚洲成人在线免费| 91黄色在线观看| 中文字幕一区二区三区在线播放 | 中文在线一区二区| 久久aⅴ国产欧美74aaa| 欧美精品久久久久久久久老牛影院 | 国产亚洲婷婷免费| 另类中文字幕网| 欧美岛国在线观看| 奇米色777欧美一区二区| 欧美日韩亚洲另类| 亚洲五月六月丁香激情| 欧美日韩综合不卡| 亚洲一区二区美女| 欧日韩精品视频| 亚洲福利视频导航| 欧美久久久久中文字幕| 亚洲超碰精品一区二区| 欧美丰满美乳xxx高潮www| 日日噜噜夜夜狠狠视频欧美人| 欧美日韩精品欧美日韩精品| 香蕉影视欧美成人| 欧美日本高清视频在线观看| 图片区小说区区亚洲影院| 欧美男生操女生| 三级一区在线视频先锋| 91精品国产一区二区人妖| 久久国产剧场电影| 精品1区2区在线观看| 国产伦精品一区二区三区免费| 久久久久国产精品麻豆ai换脸 | 美国三级日本三级久久99| 日韩欧美成人一区| 国产一区二区中文字幕| 久久精品一区二区三区不卡| 成人av免费在线播放| 亚洲欧美一区二区三区久本道91| 91蜜桃网址入口| 亚洲国产日产av| 宅男噜噜噜66一区二区66| 美日韩一区二区| 久久久国产精品不卡| 99久久综合国产精品| 亚洲自拍偷拍综合| 777奇米四色成人影色区| 精品写真视频在线观看| 欧美韩国一区二区| 色婷婷av一区二区三区软件| 亚洲成人先锋电影| 欧美草草影院在线视频| 成人不卡免费av| 亚洲一区二区影院| 日韩欧美一级二级三级 | 久久久久久久电影| 91亚洲精品久久久蜜桃| 日韩成人午夜电影| 国产视频视频一区| 91福利在线看| 久久91精品久久久久久秒播| 国产精品国产三级国产普通话蜜臀| 欧美在线看片a免费观看| 久久精品国产精品亚洲综合| 中文字幕一区二区三区不卡| 91.xcao| 成人国产精品免费观看视频| 亚洲国产人成综合网站| 国产亚洲短视频| 欧美肥胖老妇做爰| 成人97人人超碰人人99| 日韩不卡一区二区三区| 亚洲欧洲日韩一区二区三区| 91精品国产综合久久久蜜臀图片 | 在线观看成人小视频| 久久成人综合网| 亚洲特级片在线| 精品国产91亚洲一区二区三区婷婷| 99精品国产99久久久久久白柏| 秋霞电影一区二区| 一区二区三区在线观看欧美| 精品国产免费一区二区三区香蕉| 色婷婷精品久久二区二区蜜臂av| 久久福利视频一区二区| 亚洲一区自拍偷拍| 国产精品国产自产拍高清av| 精品动漫一区二区三区在线观看| 91极品视觉盛宴| 成人av网站免费观看| 久久精品国产**网站演员| 一区二区三区四区精品在线视频| 欧美精品一区二区三区视频| 欧美日韩免费视频| av电影天堂一区二区在线| 久久99精品视频| 丝袜诱惑制服诱惑色一区在线观看| 国产精品国产三级国产专播品爱网 | 久久精品网站免费观看| 777午夜精品免费视频| 91高清视频免费看| a4yy欧美一区二区三区| 国产激情精品久久久第一区二区 | 奇米影视在线99精品| 亚洲国产欧美在线| 亚洲乱码中文字幕综合| 中文字幕欧美三区| 精品免费99久久| 日韩一区二区电影在线| 欧美日韩国产系列| 欧美色综合网站| 在线观看91视频| 色偷偷一区二区三区| 99久久99久久综合| 成人午夜视频福利| 国产精品 欧美精品| 国产成人亚洲综合a∨婷婷图片| 国产一区高清在线|