예제 #1
0
파일: parse-ops.cs 프로젝트: firda-cze/bee
		}//Op
		
		/// <summary>
		/// push left-associative operator but first pop and prepare operators with higher or same priority
		/// </summary>
		public Parser Op( Opcode op, int bottom )
		{
			Debug.Assert( op.Prior() > Opcode.Assign.Prior() );
			while( (OpsAt > bottom) && (Top().Prior() >= op.Prior()) ){
				Cgen.Prepare( Pop() );
			}
			if( OpsAt == Ops.Length )
			{
				Array.Resize( ref _ops, Ops.Length << 1 );
			}
			Ops[OpsAt++] = op;
			return this;
		}//Op
예제 #2
0
파일: parse-ops.cs 프로젝트: firda-cze/bee
		}//OpsAt
		
		/// <summary>
		/// push right-associative operator (assign or special)
		/// </summary>
		public Parser Op( Opcode op )
		{
			Debug.Assert( ((op == Opcode.Comma) || (op.Prior() <= Opcode.Assign.Prior())) || (op.Unary() && (!op.Postfix())) );
			if( OpsAt == Ops.Length )
			{
				Array.Resize( ref _ops, Ops.Length << 1 );
			}
			Ops[OpsAt++] = op;
			return this;
		}//Op