本文整理汇总了C#中IInstruction.Build方法的典型用法代码示例。如果您正苦于以下问题:C# IInstruction.Build方法的具体用法?C# IInstruction.Build怎么用?C# IInstruction.Build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IInstruction
的用法示例。
在下文中一共展示了IInstruction.Build方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SprocketScript
public SprocketScript(string source, string descriptiveName, string scriptIdentificationString)
{
this.source = source;
this.identifier = new ExecutionState.ScriptRecursionIdentifier(descriptiveName, scriptIdentificationString);
TokenList tokens;
try
{
tokens = Tokeniser.Extract(source);
}
catch (TokeniserException ex)
{
Token falseToken = new Token(source.Substring(ex.Position, 1), TokenType.FreeText, ex.Position);
Token token = new Token(GetErrorHTML(ex.Message, falseToken, null), TokenType.FreeText, 0);
tokens = new TokenList(new List<Token>(new Token[] { token }));
instruction = new ShowInstruction();
instruction.Build(tokens);
hasError = true;
exception = ex;
return;
}
try
{
instruction = TokenParser.BuildInstruction(tokens);
}
catch (TokenParserException ex)
{
Token token = new Token(GetErrorHTML(ex.Message, ex.Token, null), TokenType.FreeText, 0);
tokens = new TokenList(new List<Token>(new Token[] { token }));
instruction = new ShowInstruction();
instruction.Build(tokens);
hasError = true;
}
}
示例2: SprocketScript
public SprocketScript(string source)
{
this.source = source;
List<Token> tokens = Tokeniser.Extract(source);
try
{
instruction = TokenParser.BuildInstruction(tokens);
}
catch (TokenParserException ex)
{
tokens.Clear();
tokens.Add(new Token(GetErrorHTML(ex.Message, ex.Token), TokenType.StringLiteral, 0));
instruction = new ShowInstruction();
int n = 0;
instruction.Build(tokens, ref n);
}
}