1 using CodeGeneration.Operations;
5 namespace CodeGeneration.NewOperations
8 internal class CGBitwiseOperation<T> : NewOperations.CGBinaryOperation<T> where T : ILCodeGenerator
11 public CGBitwiseOperation(VisitorILCodeGeneration<T> visitor,
object obj,
int indent,
BitwiseExpression node) : base(visitor, obj, indent, node) { }
14 protected override UnionType GenerateAllUnionTypes()
17 unions.AddType(IntType.Instance);
23 return typeExpression1;
29 switch (bitwiseOperator)
31 case BitwiseOperator.BitwiseOr:
32 this.codeGenerator.or(this.indent);
34 case BitwiseOperator.BitwiseAnd:
35 this.codeGenerator.and(this.indent);
37 case BitwiseOperator.BitwiseXOr:
38 this.codeGenerator.xor(this.indent);
40 case BitwiseOperator.ShiftLeft:
41 this.codeGenerator.shl(this.indent);
43 case BitwiseOperator.ShiftRight:
44 this.codeGenerator.shr(this.indent);
Encapsulates a binary expression of our programming language.
TypeExpression ExpressionType
Gets or sets the type of the expression.
Abstract class that represents all different types.
Represent a integer type.
Encapsulates a bitwise binary expression.
static IntType Instance
Gets the unique instance of IntType
BitwiseOperator
Bitwise binary operators