本文整理汇总了C#中JSToken类的典型用法代码示例。如果您正苦于以下问题:C# JSToken类的具体用法?C# JSToken怎么用?C# JSToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JSToken类属于命名空间,在下文中一共展示了JSToken类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: JSKeyword
private JSKeyword(JSToken token, string name, JSKeyword next)
{
this.name = name;
this.next = next;
this.token = token;
this.length = this.name.Length;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:JSKeyword.cs
示例2: JSKeyword
private JSKeyword(JSToken token, string name, JSKeyword next)
{
m_name = name;
m_token = token;
m_length = m_name.Length;
m_next = next;
}
开发者ID:lioaphy,项目名称:nodejstools,代码行数:7,代码来源:jskeyword.cs
示例3: DoOp
// Evaluate a numeric binary operator on two values.
public static Object DoOp(Object v1, Object v2, JSToken operatorTok)
{
double n1 = Convert.ToNumber(v1);
double n2 = Convert.ToNumber(v2);
switch(operatorTok)
{
case JSToken.Minus:
{
return (n1 - n2);
}
// Not reached.
case JSToken.Multiply:
{
return (n1 * n2);
}
// Not reached.
case JSToken.Divide:
{
return (n1 / n2);
}
// Not reached.
case JSToken.Modulo:
{
return (n1 % n2);
}
// Not reached.
}
throw new JScriptException(JSError.InternalError);
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:33,代码来源:NumericBinary.cs
示例4: BinaryOp
internal BinaryOp (AST parent, AST left, AST right, JSToken op, Location location)
: base (parent, location)
{
operand1 = left;
operand2 = right;
operatorTok = op;
}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:BinaryOp.cs
示例5: while
/*internal bool Exists(string target)
{
JSKeyword keyword = this;
while (keyword != null)
{
if (keyword.m_name == target)
{
return true;
}
keyword = keyword.m_next;
}
return false;
}*/
internal static string CanBeIdentifier(JSToken keyword)
{
switch (keyword)
{
// always allowed
case JSToken.Get: return "get";
case JSToken.Set: return "set";
// not in strict mode
case JSToken.Implements: return "implements";
case JSToken.Interface: return "interface";
case JSToken.Let: return "let";
case JSToken.Package: return "package";
case JSToken.Private: return "private";
case JSToken.Protected: return "protected";
case JSToken.Public: return "public";
case JSToken.Static: return "static";
case JSToken.Yield: return "yield";
// apparently never allowed for Chrome, so we want to treat it
// differently, too
case JSToken.Native: return "native";
// no other tokens can be identifiers
default: return null;
}
}
开发者ID:Aliceljm1,项目名称:kiss-project.web,代码行数:41,代码来源:jskeyword.cs
示例6: PostOrPrefixOperator
internal PostOrPrefixOperator(AST parent, AST operand, JSToken oper, bool prefix, Location location)
: base(parent, location)
{
this.operand = operand;
this.oper = oper;
this.prefix = prefix;
}
开发者ID:mayatforest,项目名称:Refractor,代码行数:7,代码来源:PostOrPrefixOperator.cs
示例7: UnaryOperator
protected UnaryOperator(Context context, JSParser parser, AstNode operand, JSToken operatorToken)
: base(context, parser)
{
Operand = operand;
OperatorToken = operatorToken;
if (Operand != null) Operand.Parent = this;
}
开发者ID:nuxleus,项目名称:ajaxmin,代码行数:7,代码来源:unaryop.cs
示例8: JSScanner
//public Dictionary<JSToken, int> TokenCounts;
public JSScanner(Context sourceContext)
{
m_keywords = s_Keywords;
m_previousToken = JSToken.None;
EatUnnecessaryCCOn = true;
UsePreprocessorDefines = true;
SetSource(sourceContext);
}
开发者ID:nuxleus,项目名称:ajaxmin,代码行数:9,代码来源:jsscanner.cs
示例9: DoOp
private static object DoOp(long x, long y, JSToken operatorTok)
{
switch (operatorTok)
{
case JSToken.Multiply:
if ((x != 0L) && (y != 0L))
{
try
{
return (x * y);
}
catch (OverflowException)
{
return (x * y);
}
}
return (x * y);
case JSToken.Divide:
return (((double) x) / ((double) y));
case JSToken.Modulo:
if (y != 0L)
{
long num2 = x % y;
if (num2 != 0L)
{
return num2;
}
if (x < 0L)
{
if (y < 0L)
{
return 0;
}
return 0.0;
}
if (y < 0L)
{
return 0.0;
}
return 0;
}
return (double) 1.0 / (double) 0.0;
case JSToken.Minus:
{
long num = x - y;
if ((num < x) == (y > 0L))
{
return num;
}
return (x - y);
}
}
throw new JScriptException(JSError.InternalError);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:57,代码来源:NumericBinary.cs
示例10: BinaryOp
internal BinaryOp(Context context, AST operand1, AST operand2, JSToken operatorTok)
: base(context) {
this.operand1 = operand1;
this.operand2 = operand2;
this.operatorTok = operatorTok;
this.type1 = null;
this.type2 = null;
this.operatorMeth = null;
}
开发者ID:ArildF,项目名称:masters,代码行数:9,代码来源:binaryop.cs
示例11: Context
// Constructors.
internal Context(String source)
{
startPosition = 0;
endPosition = source.Length;
startLine = 1;
startLinePosition = 0;
endLine = 1;
endLinePosition = 0;
token = JSToken.None;
this.source = source;
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:12,代码来源:Context.cs
示例12: Context
public Context(DocumentContext document, int startLineNumber, int startLinePosition, int startPosition, int endLineNumber, int endLinePosition, int endPosition, JSToken token)
: this(document)
{
StartLineNumber = startLineNumber;
StartLinePosition = startLinePosition;
StartPosition = startPosition;
EndLineNumber = endLineNumber;
EndLinePosition = endLinePosition;
EndPosition = endPosition;
Token = token;
}
开发者ID:Aliceljm1,项目名称:kiss-project.web,代码行数:11,代码来源:context.cs
示例13: Context
internal Context(DocumentContext document, String source_string){
this.document = document;
this.source_string = source_string;
this.lineNumber = 1;
this.startLinePos = 0;
this.startPos = 0;
this.endLineNumber = 1;
this.endLinePos = 0;
this.endPos = (source_string == null) ? -1 : source_string.Length;
this.token = JSToken.None;
this.errorReported = 1000000;
}
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:12,代码来源:context.cs
示例14: Context
internal Context(DocumentContext document, string source_string, int lineNumber, int startLinePos, int startPos, int endLineNumber, int endLinePos, int endPos, JSToken token)
{
this.document = document;
this.source_string = source_string;
this.lineNumber = lineNumber;
this.startLinePos = startLinePos;
this.startPos = startPos;
this.endLineNumber = endLineNumber;
this.endLinePos = endLinePos;
this.endPos = endPos;
this.token = token;
this.errorReported = 0xf4240;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:Context.cs
示例15: Context
public Context(DocumentContext document, int lineNumber, int startLinePos, int startPos, int endLineNumber,
int endLinePos, int endPos, JSToken token)
{
Document = document;
StartLineNumber = lineNumber;
StartLinePosition = startLinePos;
StartPosition = startPos;
EndLineNumber = endLineNumber;
EndLinePosition = endLinePos;
EndPosition = endPos;
Token = token;
m_errorReported = 1000000;
}
开发者ID:nuxleus,项目名称:ajaxmin,代码行数:13,代码来源:context.cs
示例16: HasToken
internal bool HasToken(JSToken token)
{
for (TokenSetListItem item = this._tokenSet; item != null; item = item._next)
{
int index = 0;
int length = item._tokens.Length;
while (index < length)
{
if (item._tokens[index] == token)
{
return true;
}
index++;
}
}
return false;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:NoSkipTokenSet.cs
示例17: CanBeIdentifier
internal static string CanBeIdentifier(JSToken keyword){
switch (keyword){
case JSToken.Abstract: return "abstract";
case JSToken.Assert: return "assert";
case JSToken.Boolean: return "boolean";
case JSToken.Byte: return "byte";
case JSToken.Char: return "char";
case JSToken.Decimal: return "decimal";
case JSToken.Double: return "double";
case JSToken.Ensure: return "ensure";
case JSToken.Enum: return "enum";
case JSToken.Event: return "event";
case JSToken.Final: return "final";
case JSToken.Float: return "float";
case JSToken.Get: return "get";
case JSToken.Goto: return "goto";
case JSToken.Implements: return "implements";
case JSToken.Int: return "int";
case JSToken.Interface: return "interface";
case JSToken.Internal: return "internal";
case JSToken.Invariant: return "invariant";
case JSToken.Long: return "long";
case JSToken.Namespace: return "namespace";
case JSToken.Native: return "native";
case JSToken.Package: return "package";
case JSToken.Private: return "private";
case JSToken.Protected: return "protected";
case JSToken.Public: return "public";
case JSToken.Require: return "require";
case JSToken.Sbyte: return "sbyte";
case JSToken.Set: return "set";
case JSToken.Short: return "short";
case JSToken.Static: return "static";
case JSToken.Synchronized: return "synchronized";
case JSToken.Throws: return "throws";
case JSToken.Transient: return "transient";
case JSToken.Void: return "void";
case JSToken.Volatile: return "volatile";
case JSToken.Uint : return "uint";
case JSToken.Ulong : return "ulong";
case JSToken.Ushort : return "ushort";
case JSToken.Use : return "use";
default: return null;
}
}
开发者ID:ArildF,项目名称:masters,代码行数:45,代码来源:jskeyword.cs
示例18: Remove
internal void Remove(JSToken[] tokens)
{
TokenSetListItem item = this._tokenSet;
TokenSetListItem item2 = null;
while (item != null)
{
if (item._tokens == tokens)
{
if (item2 == null)
{
this._tokenSet = this._tokenSet._next;
return;
}
item2._next = item._next;
return;
}
item2 = item;
item = item._next;
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:NoSkipTokenSet.cs
示例19: DoOp
internal static object DoOp(int i, int j, JSToken operatorTok)
{
switch (operatorTok)
{
case JSToken.BitwiseOr:
return (i | j);
case JSToken.BitwiseXor:
return (i ^ j);
case JSToken.BitwiseAnd:
return (i & j);
case JSToken.LeftShift:
return (i << j);
case JSToken.RightShift:
return (i >> j);
case JSToken.UnsignedRightShift:
return (uint) (i >> j);
}
throw new JScriptException(JSError.InternalError);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:24,代码来源:BitwiseBinary.cs
示例20: NumericBinaryAssign
internal NumericBinaryAssign(Context context, AST operand1, AST operand2, JSToken operatorTok)
: base(context, operand1, operand2, operatorTok){
this.binOp = new NumericBinary(context, operand1, operand2, operatorTok);
this.metaData = null;
}
开发者ID:ArildF,项目名称:masters,代码行数:5,代码来源:numericbinaryassign.cs
注:本文中的JSToken类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论