• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# goldparser.TerminalToken类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中com.calitha.goldparser.TerminalToken的典型用法代码示例。如果您正苦于以下问题:C# TerminalToken类的具体用法?C# TerminalToken怎么用?C# TerminalToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TerminalToken类属于com.calitha.goldparser命名空间,在下文中一共展示了TerminalToken类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DoShift

		private void DoShift(TerminalToken token, ShiftAction action)
		{
			stateStack.Push(action.State);
			tokenStack.Push(token);
			lookahead = null;
			if (OnShift != null)
				OnShift(this,new ShiftEventArgs(token,action.State));
		}
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:8,代码来源:LALRParser.cs


示例2: ShowInputError

 public void ShowInputError(TerminalToken token)
 {
     ClearShowInputError();
     int oldpos = this.inputBox.SelectionStart;
     this.inputBox.Select(token.Location.Position, token.Text.Length);
     this.inputBox.SelectionColor = Color.Red;
     this.inputBox.Select(oldpos,0);
     this.inputBox.SelectionColor = Color.ForestGreen;
 }
开发者ID:langpavel,项目名称:LPS-old,代码行数:9,代码来源:MainForm.cs


示例3: ShiftEventArgs

 public ShiftEventArgs(TerminalToken token, State newState)
 {
     this.token = token;
     this.newState = newState;
 }
开发者ID:pavelsavara,项目名称:nMars,代码行数:5,代码来源:ParserEvents.cs


示例4: TokenErrorEventArgs

 public TokenErrorEventArgs(TerminalToken token)
 {
     this.token = token;
     contin = false;
 }
开发者ID:pavelsavara,项目名称:nMars,代码行数:5,代码来源:ParserEvents.cs


示例5: ProcessError

		private bool ProcessError(TerminalToken token)
		{
			if (OnTokenError != null)
			{
				TokenErrorEventArgs e = new TokenErrorEventArgs(token);
				OnTokenError(this, e);
				return e.Continue;
			}
			else
				return false;
		}
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:11,代码来源:LALRParser.cs


示例6: TerminalTryfinally

		/// <summary>
		/// <para>Symbol: TryFinally</para>
		/// <para><c>&lt;TryFinally&gt;</c></para>
		/// </summary>
		protected virtual object TerminalTryfinally(TerminalToken token)
		{
			throw new NotImplementedException("Symbol TryFinally");
		}
开发者ID:langpavel,项目名称:LPS-old,代码行数:8,代码来源:ToolScriptParserBase.cs


示例7: ParseTerminal

		private void ParseTerminal(TerminalToken token)
		{
			State currentState = stateStack.Peek();

			Action action = currentState.Actions.Get(token.Symbol);

			if (action is ShiftAction)
				DoShift(token,(ShiftAction)action);
			else if (action is ReduceAction)
				DoReduce(token,(ReduceAction)action);
			else if (action is AcceptAction)
				DoAccept(token,(AcceptAction)action);
			else
			{
				continueParsing = false;
				FireParseError(token);
			}
		}
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:18,代码来源:LALRParser.cs


示例8: FireEOFError

		private void FireEOFError()
		{
			TerminalToken eofToken = new TerminalToken(SymbolCollection.EOF,
				SymbolCollection.EOF.Name,
				tokenizer.GetCurrentLocation());
			FireParseError(eofToken);
		}
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:7,代码来源:LALRParser.cs


示例9: CreateObject

        protected override Object CreateObject(TerminalToken token)
        {
            switch (token.Symbol.Id)
               {

               case (int)com.calitha.goldparser.SymbolConstants.SYMBOL_IDENTIFIER:
                   return token.Text;
               case (int)SymbolConstants.SYMBOL_IP:
                   return token.Text;
               case (int)SymbolConstants.SYMBOL_NUMBER:
                   return token.Text;
               case (int)SymbolConstants.SYMBOL_FLOAT:
                   return token.Text;
               case (int)SymbolConstants.SYMBOL_DEVICEID:
                   return token.Text;

               case (int)SymbolConstants.SYMBOL_CMD:
                   return token.Text;
               case (int)SymbolConstants.SYMBOL_SUBCMD:
                   return token.Text;
               case (int)SymbolConstants.SYMBOL_STRINGLITERAL:
                   return token.Text;
               case (int)SymbolConstants.SYMBOL_CMDCLASS:
                   if (!(token.Text == "A" || token.Text == "B" || token.Text == "C" || token.Text == "D" || token.Text == "N"))
                     throw new SymbolException(token.Location+", must be 'A' or 'B' or 'C' or 'D' or 'N'==>"+token.Text);
                   return token.Text;
               case (int)SymbolConstants.SYMBOL_CMDTYPE:
                   if (!(token.Text == "Set" || token.Text == "Query" || token.Text == "Report" ))
                       throw new SymbolException(token.Location + ", must be 'Set' or 'Query' or 'Report' ==>" + token.Text);
                   return token.Text;
               //case (int)SymbolConstants.SYMBOL_LVALUE:
               //    return token.Text;

               //case (int)SymbolConstants.SYMBOL_HVALUE:
               //    return Convert.ToInt32(token.Text);
               //case (int) SymbolConstants.SYMBOL_BYTES:
                   //return token.Text;

                 //  break;

               }
               return null;
        }
开发者ID:ufjl0683,项目名称:sshmc,代码行数:43,代码来源:Protocol.cs


示例10: CreateObject

        protected virtual Object CreateObject(TerminalToken token)
        {
            switch (token.Symbol.Id)
            {
                case (int)SymbolConstants.SYMBOL_EOF :
                //(EOF)
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_ERROR :
                //(Error)
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_WHITESPACE :
                //(Whitespace)
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_MINUS :
                //'-'
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_LPARAN :
                //'('
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_RPARAN :
                //')'
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_COMMA :
                //','
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_COLON :
                //':'
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_ATCMD :
                //'@cmd'
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_LBRACKETCOMMANDRBRACKET :
                //'[Command]'
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_LBRACKETDEVICEINFORBRACKET :
                //'[DeviceInfo]'
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_LBRACE :
                //'{'
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_RBRACE :
                //'}'
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_CLASSEQ :
                //'class='
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_CMD :
                //Cmd
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_CMDEQ :
                //'cmd='
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_CMDCLASS :
                //CmdClass
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_CMDTYPE :
                //CmdType
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_DESCRIPTIONEQ :
                //'description='
                //todo: Create a new object that corresponds to the symbol
                return null;

                case (int)SymbolConstants.SYMBOL_DEVICEID :
//.........这里部分代码省略.........
开发者ID:ufjl0683,项目名称:sshmc,代码行数:101,代码来源:V20Parser.cs


示例11: CreateObjectFromTerminal

        public virtual object CreateObjectFromTerminal(TerminalToken token)
        {
            switch (token.Symbol.Id)
            {
                case (int)Symbols.Eof: //(EOF)
                	return TerminalEof(token);

                case (int)Symbols.Error: //(Error)
                	return TerminalError(token);

                case (int)Symbols.Whitespace: //(Whitespace)
                	return TerminalWhitespace(token);

                case (int)Symbols.Commentend: //(Comment End)
                	return TerminalCommentend(token);

                case (int)Symbols.Commentline: //(Comment Line)
                	return TerminalCommentline(token);

                case (int)Symbols.Commentstart: //(Comment Start)
                	return TerminalCommentstart(token);

                case (int)Symbols.Minus: //'-'
                	return TerminalMinus(token);

                case (int)Symbols.Minusminus: //--
                	return TerminalMinusminus(token);

                case (int)Symbols.Comma: //','
                	return TerminalComma(token);

                case (int)Symbols.Semi: //';'
                	return TerminalSemi(token);

                case (int)Symbols.Colon: //':'
                	return TerminalColon(token);

                case (int)Symbols.Exclam: //'!'
                	return TerminalExclam(token);

                case (int)Symbols.Exclameq: //'!='
                	return TerminalExclameq(token);

                case (int)Symbols.Question: //'?'
                	return TerminalQuestion(token);

                case (int)Symbols.Dot: //'.'
                	return TerminalDot(token);

                case (int)Symbols.Lparan: //'('
                	return TerminalLparan(token);

                case (int)Symbols.Rparan: //')'
                	return TerminalRparan(token);

                case (int)Symbols.Lbracket: //'['
                	return TerminalLbracket(token);

                case (int)Symbols.Rbracket: //']'
                	return TerminalRbracket(token);

                case (int)Symbols.Lbrace: //'{'
                	return TerminalLbrace(token);

                case (int)Symbols.Rbrace: //'}'
                	return TerminalRbrace(token);

                case (int)Symbols.Times: //'*'
                	return TerminalTimes(token);

                case (int)Symbols.Timeseq: //'*='
                	return TerminalTimeseq(token);

                case (int)Symbols.Div: //'/'
                	return TerminalDiv(token);

                case (int)Symbols.Diveq: //'/='
                	return TerminalDiveq(token);

                case (int)Symbols.Percent: //'%'
                	return TerminalPercent(token);

                case (int)Symbols.Plus: //'+'
                	return TerminalPlus(token);

                case (int)Symbols.Plusplus: //'++'
                	return TerminalPlusplus(token);

                case (int)Symbols.Pluseq: //'+='
                	return TerminalPluseq(token);

                case (int)Symbols.Lt: //'<'
                	return TerminalLt(token);

                case (int)Symbols.Lteq: //'<='
                	return TerminalLteq(token);

                case (int)Symbols.Lteqeq: //'<=='
                	return TerminalLteqeq(token);

//.........这里部分代码省略.........
开发者ID:langpavel,项目名称:LPS-old,代码行数:101,代码来源:ToolScriptParserBase.cs


示例12: CreateObject

        private Object CreateObject(TerminalToken token)
        {
            switch (token.Symbol.Id)
            {
                case (int)SymbolConstants.SYMBOL_EOF :
                //(EOF)
                return null;

                case (int)SymbolConstants.SYMBOL_ERROR :
                //(Error)
                return null;

                case (int)SymbolConstants.SYMBOL_WHITESPACE :
                //(Whitespace)
                return null;

                case (int)SymbolConstants.SYMBOL_COMMENTLINE :
                //(Comment Line)
                return null;

                case (int)SymbolConstants.SYMBOL_MINUS :
                //'-'
                return null;

                case (int)SymbolConstants.SYMBOL_LPARAN :
                //'('
                return null;

                case (int)SymbolConstants.SYMBOL_RPARAN :
                //')'
                return null;

                case (int)SymbolConstants.SYMBOL_TIMES :
                //'*'
                return null;

                case (int)SymbolConstants.SYMBOL_COLONCOLONEQ :
                //'::='
                return null;

                case (int)SymbolConstants.SYMBOL_QUESTION :
                //'?'
                return null;

                case (int)SymbolConstants.SYMBOL_PIPE :
                //'|'
                return null;

                case (int)SymbolConstants.SYMBOL_PLUS :
                //'+'
                return null;

                case (int)SymbolConstants.SYMBOL_EQ :
                //'='
                return null;

                case (int)SymbolConstants.SYMBOL_LARGECOMMENT :
                //LargeComment
                return token.Text;

                case (int)SymbolConstants.SYMBOL_NEWLINE :
                //Newline
                return null;

                case (int)SymbolConstants.SYMBOL_NONTERMINAL :
                //Nonterminal
                return token.Text;

                case (int)SymbolConstants.SYMBOL_PARAMETERNAME :
                //ParameterName
                return null;

                case (int)SymbolConstants.SYMBOL_SETLITERAL :
                //SetLiteral
                return null;

                case (int)SymbolConstants.SYMBOL_SETNAME :
                //SetName
                return null;

                case (int)SymbolConstants.SYMBOL_TERMINAL :
                //Terminal
                return token.Text;

                case (int)SymbolConstants.SYMBOL_CONTENT :
                //<Content>
                return null;

                case (int)SymbolConstants.SYMBOL_DEFINITION :
                //<Definition>
                return null;

                case (int)SymbolConstants.SYMBOL_GRAMMAR :
                //<Grammar>
                return null;

                case (int)SymbolConstants.SYMBOL_HANDLE :
                //<Handle>
                return null;

//.........这里部分代码省略.........
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:101,代码来源:Parser.cs


示例13: TerminalWndparamlist

		/// <summary>
		/// <para>Symbol: WndParam List</para>
		/// <para><c>&lt;WndParam List&gt;</c></para>
		/// </summary>
		protected virtual object TerminalWndparamlist(TerminalToken token)
		{
			throw new NotImplementedException("Symbol WndParam List");
		}
开发者ID:langpavel,项目名称:LPS-old,代码行数:8,代码来源:ToolScriptParserBase.cs


示例14: TerminalWidget2

		/// <summary>
		/// <para>Symbol: Widget</para>
		/// <para><c>&lt;Widget&gt;</c></para>
		/// </summary>
		protected virtual object TerminalWidget2(TerminalToken token)
		{
			throw new NotImplementedException("Symbol Widget");
		}
开发者ID:langpavel,项目名称:LPS-old,代码行数:8,代码来源:ToolScriptParserBase.cs


示例15: TerminalValue

		/// <summary>
		/// <para>Symbol: Value</para>
		/// <para><c>&lt;Value&gt;</c></para>
		/// </summary>
		protected virtual object TerminalValue(TerminalToken token)
		{
			throw new NotImplementedException("Symbol Value");
		}
开发者ID:langpavel,项目名称:LPS-old,代码行数:8,代码来源:ToolScriptParserBase.cs


示例16: TokenReadEventArgs

 public TokenReadEventArgs(TerminalToken token)
 {
     this.token = token;
     contin = true;
 }
开发者ID:pavelsavara,项目名称:nMars,代码行数:5,代码来源:ParserEvents.cs


示例17: FireParseError

 private void FireParseError(TerminalToken token)
 {
     if (OnParseError != null)
     {
         ParseErrorEventArgs e =
             new ParseErrorEventArgs(token, FindExpectedTokens());
         OnParseError(this, e);
         continueParsing = e.Continue != ContinueMode.Stop;
         lookahead = e.NextToken;
         if ((e.NextToken != null) && (e.Continue == ContinueMode.Insert))
             tokenizer.SetCurrentLocation(token.Location);
     }
 }
开发者ID:langpavel,项目名称:LPS-old,代码行数:13,代码来源:LALRParser.cs


示例18: CreateObject

 private Object CreateObject(TerminalToken token)
 {
     return null;
 }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:4,代码来源:EpiInfo7EventGrammar.cs


示例19: ProcessCommentLine

 private bool ProcessCommentLine(TerminalToken token)
 {
     if (OnCommentRead == null)
     {
         tokenizer.SkipToChar('\n');
         //SkipToEndOfLine();
         return true;
     }
     else
     {
         Location start = this.tokenizer.GetCurrentLocation();
         tokenizer.SkipToChar('\n');
         //SkipToEndOfLine();
         Location end = this.tokenizer.GetCurrentLocation();
         string str = this.tokenizer.GetInput();
         int len = end.Position - start.Position;
         string comment = str.Substring(start.Position, len);
         CommentReadEventArgs args = new CommentReadEventArgs(token.Text + comment,
                                                              comment,
                                                              true);
         OnCommentRead(this, args);
         return true;
     }
 }
开发者ID:langpavel,项目名称:LPS-old,代码行数:24,代码来源:LALRParser.cs


示例20: DecimalLiteral

 public DecimalLiteral(TerminalToken token)
 {
     val = Parse(token.Text);
 }
开发者ID:langpavel,项目名称:LPS-old,代码行数:4,代码来源:DecimalLiteral.cs



注:本文中的com.calitha.goldparser.TerminalToken类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# implement.cooperativaEntities类代码示例发布时间:2022-05-26
下一篇:
C# goldparser.NonterminalToken类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap