示例#1
0
		}//Binary
		
		protected override void Unary( Opcode op, byte[] code, ref int at )
		{
			var paren = Parens;
			if( paren )
			{
				Write( '(' );
			}
			var text = op.Text();
			var post = op.Postfix();
			if( !post )
			{
				Write( text );
				if( text.Length > 2 )
				{
					Write( ' ' );
				}
			}
			Expression( code, ref at );
			if( post )
			{
				Write( text );
			}
			if( paren )
			{
				Write( ')' );
			}
		}//Unary
示例#2
0
		}//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