本文整理汇总了C#中ScriptSharp.CodeModel.Token类的典型用法代码示例。如果您正苦于以下问题:C# Token类的具体用法?C# Token怎么用?C# Token使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Token类属于ScriptSharp.CodeModel命名空间,在下文中一共展示了Token类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConstantFieldDeclarationNode
public ConstantFieldDeclarationNode(Token token,
ParseNodeList attributes,
Modifiers modifiers,
ParseNode type,
ParseNodeList initializers)
: base(ParseNodeType.ConstFieldDeclaration, token, attributes, modifiers, type, initializers, false) {
}
示例2: UsingNode
public UsingNode(Token token,
ParseNode guard,
ParseNode body)
: base(ParseNodeType.Using, token) {
_guard = GetParentedNode(guard);
_body = GetParentedNode(body);
}
示例3: DestructorDeclarationNode
public DestructorDeclarationNode(Token token,
ParseNodeList attributes,
Modifiers modifiers,
AtomicNameNode name,
BlockStatementNode body)
: base(ParseNodeType.DestructorDeclaration, token, attributes, modifiers, /* return type */ null, name, new ParseNodeList(), body) {
}
示例4: AttributeBlockNode
public AttributeBlockNode(Token token,
AttributeTargets location,
ParseNodeList attributes)
: base(ParseNodeType.AttributeBlock, token) {
_location = location;
_attributes = GetParentedNodeList(attributes);
}
示例5: ReportError
private void ReportError(Error error, Token token, params object[] args) {
BufferPosition newPosition = token.Position;
if (OnError != null && lastErrorPosition != newPosition) {
OnError(this, new ErrorEventArgs(error, newPosition, args));
}
lastErrorPosition = newPosition;
}
示例6: SwitchSectionNode
public SwitchSectionNode(Token token,
ParseNodeList labels,
ParseNodeList statements)
: base(ParseNodeType.SwitchSection, token) {
_labels = GetParentedNodeList(labels);
_statements = GetParentedNodeList(statements);
}
示例7: SwitchNode
public SwitchNode(Token token,
ParseNode condition,
ParseNodeList cases)
: base(ParseNodeType.Switch, token) {
_condition = GetParentedNode(condition);
_cases = GetParentedNodeList(cases);
}
示例8: LockNode
public LockNode(Token token,
ParseNode monitor,
ParseNode body)
: base(ParseNodeType.Lock, token) {
this.monitor = GetParentedNode(monitor);
this.body = GetParentedNode(body);
}
示例9: FixedNode
public FixedNode(Token token,
VariableDeclarationNode declaration,
ParseNode body)
: base(ParseNodeType.Fixed, token) {
_declaration = (VariableDeclarationNode)GetParentedNode(declaration);
_body = GetParentedNode(body);
}
示例10: Parse
/// <summary>
/// Preprocesses, Lexes and Parses a C# compilation unit. Subscribe to the OnError
/// event before calling this method to receive error notifications.
/// After calling Parse, the Defines property contains the list of preprocessor
/// symbols defined as a result of #define and #undef directives in this
/// compilation unit.
/// </summary>
public CompilationUnitNode Parse(Token[] tokens, LineMap lineMap) {
_lineMap = lineMap;
CompilationUnitNode parseTree = _parser.Parse(tokens);
_lineMap = null;
return parseTree;
}
示例11: DoWhileNode
public DoWhileNode(Token token,
ParseNode body,
ParseNode condition)
: base(ParseNodeType.DoWhile, token) {
_body = GetParentedNode(body);
_condition = GetParentedNode(condition);
}
示例12: VariableDeclarationNode
public VariableDeclarationNode(Token token,
ParseNodeList attributes,
Modifiers modifiers,
ParseNode type,
ParseNodeList initializers,
bool isFixed)
: this(ParseNodeType.VariableDeclaration, token, attributes, modifiers, type, initializers, isFixed) {
}
示例13: Parse
/// <summary>
/// Parses an array of C# tokens. Subscribe to the OnError event before
/// calling Parse to receive errors while Parsing.
/// </summary>
public CompilationUnitNode Parse(Token[] tokens) {
this.tokens = tokens;
iToken = 0;
lastErrorPosition.Column = -1;
return ParseCompilationUnit();
}
示例14: CatchNode
public CatchNode(Token token, ParseNode type,
AtomicNameNode name,
ParseNode body)
: base(ParseNodeType.Catch, token) {
_type = GetParentedNode(type);
_name = (AtomicNameNode)GetParentedNode(name);
_body = GetParentedNode(body);
}
示例15: NamespaceNode
public NamespaceNode(Token token, string name,
ParseNodeList usingClauses,
ParseNodeList members)
: base(ParseNodeType.Namespace, token) {
_name = name;
_usingClauses = GetParentedNodeList(usingClauses);
_members = GetParentedNodeList(members);
}