상속: Expression
예제 #1
0
 public void Visit(ValueExpression expression)
 {
     switch (expression.TypeCode) {
         case TypeCode.Boolean: Result = Global.BooleanClass.New((bool)expression.Value); break;
         case TypeCode.Int32:
         case TypeCode.Single:
         case TypeCode.Double: Result = Global.NumberClass.New(Convert.ToDouble(expression.Value)); break;
         case TypeCode.String: Result = Global.StringClass.New((string)expression.Value); break;
         default: Result = expression.Value as JsInstance;
             break;
     }
 }
예제 #2
0
		public void Visit(ValueExpression expression)
		{
			Builder.Append(expression.Value);
		}
예제 #3
0
파일: IronJint.cs 프로젝트: welias/IronWASP
 void Analyze(ValueExpression Stmt)
 {
     SetCurrentLineAndCharNos(Stmt);
     if (JintStack.Count == 0)
     {
         if (Stmt.TypeCode == TypeCode.String)
             AddToJintStack(Stmt.Source, JintState.StringValue, Stmt.Value.ToString());
         else
             AddToJintStack(Stmt.Source, JintState.NonStringValue, Stmt.Value.ToString());
         return;
     }
     JintItem LastItem = JintStack[JintStack.Count - 1];
     switch (LastItem.State)
     {
         case (JintState.Indexer):
             if(Stmt.TypeCode == TypeCode.String)
                 AddToJintStack(Stmt.Source, JintState.StringValue, Stmt.Value.ToString());
             else
                 AddToJintStack(Stmt.Source, JintState.IntValue, Stmt.Value.ToString());
             break;
         default:
             AddToJintStack(Stmt.Source, JintState.StringValue, Stmt.Value.ToString());
             break;
     }
     if (TraceKeyword)
     {
         List<string> Contexts = GetContext(RawLines[CurrentLineNo - 1], Stmt.Value.ToString());
         if (Contexts.Count == 0 && Stmt.Value.ToString().IndexOf(KeywordToTrace) >= 0)
         {
             if(Stmt.TypeCode == TypeCode.String)
                 KeywordContexts.Add("StringValue");
             else
                 KeywordContexts.Add("NonStringValue");
         }
         KeywordContexts.AddRange(Contexts);
     }
     //Analyzer.CheckIdentifier(Stmt.Value.ToString());
 }