本文整理汇总了C#中IToken.getText方法的典型用法代码示例。如果您正苦于以下问题:C# IToken.getText方法的具体用法?C# IToken.getText怎么用?C# IToken.getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IToken
的用法示例。
在下文中一共展示了IToken.getText方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: initialize
/// <summary>
/// initialize this instance from an IToken
/// </summary>
public override void initialize(IToken tok)
{
this.setText(tok.getText());
this.Type = tok.Type;
}
示例2: MismatchedTokenException
// Expected token / not token
public MismatchedTokenException(string[] tokenNames_, IToken token_, int expecting_, bool matchNot, string fileName_) :
base("Mismatched Token", fileName_, token_.getLine(), token_.getColumn())
{
tokenNames = tokenNames_;
token = token_;
tokenText = token_.getText();
mismatchType = matchNot ? TokenTypeEnum.NotTokenType : TokenTypeEnum.TokenType;
expecting = expecting_;
}
示例3: CreateToken
static IToken CreateToken(IToken prototype, int newTokenType, string newTokenText)
{
return new BooToken(newTokenType, newTokenText,
prototype.getFilename(),
prototype.getLine(),
prototype.getColumn()+SafeGetLength(prototype.getText()));
}
示例4: initialize
public override void initialize(IToken tok) {
if (tok.Type == CalcParserTokenTypes.INT)
v = Convert.ToInt32(tok.getText());
}
示例5: initialize
override public void initialize(IToken tok)
{
setText(tok.getText());
Type = tok.Type;
}
示例6: UnexpectedToken
protected void UnexpectedToken(IToken token)
{
this.ReportError(CompilerErrorFactory.UnexpectedToken(ToLexicalInfo(token), null, token.getText()));
}
示例7: ToSourceLocation
public static SourceLocation ToSourceLocation(IToken token)
{
string str = token.getText();
int num = (str != null) ? (str.Length - 1) : 0;
return new SourceLocation(token.getLine(), token.getColumn() + num);
}
示例8: AddFunctionTo
public Method AddFunctionTo(TypeDefinition type, IToken nameToken, IToken getter, IToken setter)
{
Method method;
string name = nameToken.getText();
LexicalInfo info = ToLexicalInfo(nameToken);
Method method1 = method = new Method(info);
method.set_Name(name);
Method node = !IsConstructorName(name, type) ? method : new Constructor(info);
if ((getter != null) || (setter != null))
{
Property property = type.get_Members().get_Item(name) as Property;
if (property == null)
{
Property property2;
Property property1 = property2 = new Property(info);
property2.set_Name(name);
property = property2;
type.get_Members().Add(property);
}
if (getter != null)
{
if (property.get_Getter() != null)
{
throw new AssertionFailedException("p.Getter is null");
}
property.set_Getter(node);
}
else
{
if (property.get_Setter() != null)
{
throw new AssertionFailedException("p.Setter is null");
}
property.set_Setter(node);
}
this.FlushAttributes(property);
return node;
}
type.get_Members().Add(node);
this.FlushAttributes(node);
return node;
}
示例9: KeywordCannotBeUsedAsAnIdentifier
protected void KeywordCannotBeUsedAsAnIdentifier(IToken token)
{
this.ReportError(UnityScriptCompilerErrors.KeywordCannotBeUsedAsAnIdentifier(ToLexicalInfo(token), token.getText()));
}