当前位置: 首页>>代码示例>>C#>>正文


C# JSToken类代码示例

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


JSToken类属于命名空间,在下文中一共展示了JSToken类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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