當前位置: 首頁>>代碼示例>>C#>>正文


C# Compiler.Expression類代碼示例

本文整理匯總了C#中PHP.Compiler.Expression的典型用法代碼示例。如果您正苦於以下問題:C# Expression類的具體用法?C# Expression怎麽用?C# Expression使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Expression類屬於PHP.Compiler命名空間,在下文中一共展示了Expression類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RETURN

 public RETURN(Expression expr, int line, int column)
     : base(line, column)
 {
     Expr = expr;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:5,代碼來源:AST.cs

示例2: IS_NOT_IDENTICAL

 public IS_NOT_IDENTICAL(Expression expr1, Expression expr2, int line, int column)
     : base(expr1, expr2, line, column)
 {
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:4,代碼來源:AST.cs

示例3: StoreToObjectOperator

		public void StoreToObjectOperator(OBJECT_OPERATOR oo, Expression value) {
			// warn if left part is a function call
			if (oo.Expr1 is FUNCTION_CALL) {
				FUNCTION_CALL fc = (FUNCTION_CALL)oo.Expr1;
				Report.Warn(404, fc.FunctionName, fc.Line, fc.Column);
				if (ObjectOperatorInProgress) {
					IlGen.Emit(OpCodes.Pop);
					ObjectOperatorInProgress = false;
				}
				return;
			}
			// process left part
			ObjectOperatorInProgress = true;
			// local variable
			if (oo.Expr1 is VARIABLE) {
				VARIABLE var = (VARIABLE)oo.Expr1;
				// handle $this->
				if (var.Name == "$this") {
					ProcessingObjectThisWhenStoring = true;
					// if this is a static context, load object from which this static context was called
					if (FD.Modifiers.Contains(Modifiers.STATIC)) {
						Report.Warn(502, var.Line, var.Column);
						IlGen.Emit(OpCodes.Ldsfld, PHPRuntimeCore.GetField("ThisForStaticContext"));
					}
					// otherwise load current object
					else
						IlGen.Emit(OpCodes.Ldarg_0);
					if (var.Offset != null)
						Report.Warn(401, CD.Name, var.Offset.Line, var.Offset.Column);
				}
				// some variable
				else if (var.Name.StartsWith("$")) {
					ProcessingObjectThisWhenStoring = false;
					Visit(var);
				}
				// class member
				else {
					// if processing a class member of $this (of a non-static context), load directly
					if (ProcessingObjectThisWhenStoring && !FD.Modifiers.Contains(Modifiers.STATIC))
						LoadFromClassMemberOfThis(var.Name, var.Line, var.Column);
					// else load at runtime by reflection
					else
						LoadFromClassMemberOfAnotherObject(var.Name);
					ProcessingObjectThisWhenStoring = false;
					// process offset, if available
					if (var.Offset != null) {
						// this is an array
						if (var.Offset.Kind == OFFSET.SQUARE) {
							if (var.Offset.Value == null)
								IlGen.Emit(OpCodes.Ldnull);
							else
								Visit(var.Offset);
							IlGen.Emit(OpCodes.Ldc_I4, OFFSET.SQUARE);
							IlGen.Emit(OpCodes.Call, PHPRuntimeCore.GetMethod("Offset", new Type[] { typeof(object), typeof(object), typeof(int) }));
						}
					}
				}
			}
			// paamayim nekudotayim
			else if (oo.Expr1 is PAAMAYIM_NEKUDOTAYIM) {
				PAAMAYIM_NEKUDOTAYIM pn = (PAAMAYIM_NEKUDOTAYIM)oo.Expr1;
				LoadFromPaamayimNekudotayim(pn);
			}
			// process right part
			if (oo.Expr2 is OBJECT_OPERATOR)
				StoreToObjectOperator((OBJECT_OPERATOR)oo.Expr2, value);
			else if (oo.Expr2 is VARIABLE) {
				VARIABLE var2 = (VARIABLE)oo.Expr2;
				// no offset available, so store to class member
				if (var2.Offset == null) {
					Visit(value);
					// if processing a class member of $this, store directly
					if (ProcessingObjectThisWhenStoring)
						StoreToClassMemberOfThis(var2.Name, var2.Line, var2.Column);
					// else store at runtime by reflection
					else
						StoreToClassMemberOfAnotherObject(var2.Name);
				}
				// array offset available, so store to specified place
				else if (var2.Offset.Kind == OFFSET.SQUARE) {
					IlGen.Emit(OpCodes.Dup);
					IlGen.Emit(OpCodes.Dup);
					// if processing a class member of $this, load directly
					if (ProcessingObjectThisWhenStoring)
						LoadFromClassMemberOfThis(var2.Name, var2.Line, var2.Column);
					// else load at runtime by reflection
					else
						LoadFromClassMemberOfAnotherObject(var2.Name);
					// if array loaded is null, create a new one and store
					Label skip = IlGen.DefineLabel();
					Label join = IlGen.DefineLabel();
					IlGen.Emit(OpCodes.Brtrue, skip);
					IlGen.Emit(OpCodes.Newobj, PHPArray.GetConstructor(Type.EmptyTypes));
					// if processing a class member of $this, store directly
					if (ProcessingObjectThisWhenStoring)
						StoreToClassMemberOfThis(var2.Name, var2.Line, var2.Column);
					// else store at runtime by reflection
					else
						StoreToClassMemberOfAnotherObject(var2.Name);
					IlGen.Emit(OpCodes.Br, join);
//.........這裏部分代碼省略.........
開發者ID:emtees,項目名稱:old-code,代碼行數:101,代碼來源:Visitors.cs

示例4: INC

 public INC(Expression expr, int kind, int line, int column)
     : base(expr, line, column)
 {
     Kind = kind;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:5,代碼來源:AST.cs

示例5: INT_CAST

 public INT_CAST(Expression expr, int line, int column)
     : base(expr, line, column)
 {
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:4,代碼來源:AST.cs

示例6: ARRAY_PAIR

 public ARRAY_PAIR(Expression key, Expression value, int line, int column)
     : base(line, column)
 {
     Key = key;
     Value = value;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:6,代碼來源:AST.cs

示例7: IF

 public IF(Expression expr, Statement stmt, ArrayList elseifList, Statement elseStmt, int line, int column)
     : base(line, column)
 {
     Expr = expr;
     Stmt = stmt;
     ElseifList = elseifList;
     ElseStmt = elseStmt;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:8,代碼來源:AST.cs

示例8: BOOLEAN_OR

 public BOOLEAN_OR(Expression expr1, Expression expr2, int line, int column)
     : base(expr1, expr2, line, column)
 {
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:4,代碼來源:AST.cs

示例9: BREAK

 public BREAK(Expression expr, int line, int column)
     : base(line, column)
 {
     Expr = expr;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:5,代碼來源:AST.cs

示例10: UnaryExpression

 public UnaryExpression(Expression expr, int line, int column)
     : base(line, column)
 {
     Expr = expr;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:5,代碼來源:AST.cs

示例11: BOOLEAN_NOT

 public BOOLEAN_NOT(Expression expr, int line, int column)
     : base(expr, line, column)
 {
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:4,代碼來源:AST.cs

示例12: THROW

 public THROW(Expression expr, int line, int column)
     : base(line, column)
 {
     Expr = expr;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:5,代碼來源:AST.cs

示例13: TernaryExpression

 public TernaryExpression(Expression expr1, Expression expr2, Expression expr3, int line, int column)
     : base(line, column)
 {
     Expr1 = expr1;
     Expr2 = expr2;
     Expr3 = expr3;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:7,代碼來源:AST.cs

示例14: SWITCH

 public SWITCH(Expression expr, ArrayList switchCaseList, int line, int column)
     : base(line, column)
 {
     Expr = expr;
     SwitchCaseList = switchCaseList;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:6,代碼來源:AST.cs

示例15: EXPRESSION_AS_STATEMENT

 public EXPRESSION_AS_STATEMENT(Expression expr, int line, int column)
     : base(line, column)
 {
     Expr = expr;
 }
開發者ID:Notulp,項目名稱:php4mono,代碼行數:5,代碼來源:AST.cs


注:本文中的PHP.Compiler.Expression類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。