public void VisitBinaryOperation(IBinaryOperationNode node) { if (BinaryOperationVisitor != null) { node.AcceptBinaryOperationVisitor(BinaryOperationVisitor); } }
public void VisitBinaryOperation(IBinaryOperationNode node) { BinaryOperationCodeGenVisitor binOpVisitor = new BinaryOperationCodeGenVisitor(this, _functionBuilder); node.AcceptBinaryOperationVisitor(binOpVisitor); _functionBuilder.AddDebugSymbol(binOpVisitor.ComparisonOperationAddress, node); }
private void BasicComparison(IBinaryOperationNode node, OpCode opCode) { node.RHS.AcceptExpressionVisitor(_expressionVisitor); node.LHS.AcceptExpressionVisitor(_expressionVisitor); ComparisonOperationAddress = _functionBuilder.InstructionCount; _functionBuilder.AddInstruction(opCode); }
public void VisitBinaryOperation(IBinaryOperationNode node) { // Don't insert unreachable code if (!_builder.InsertBlock.IsValid) { return; } node.AcceptBinaryOperationVisitor(new BinaryOperationCodeGenVisitor(this)); }
public void VisitBinaryOperation(IBinaryOperationNode node) { VisitPreOrder(node); // NOTE: We may want to make this recursion of LHS and RHS optional, in case the outer visitor uses a // IBinaryOperationVisitor. node.LHS.AcceptExpressionVisitor(this); node.RHS.AcceptExpressionVisitor(this); VisitPostOrder(node); }
public void VisitBinaryOperation(IBinaryOperationNode node) { IType lhsType = GetExpressionType(node.LHS); IType rhsType = GetExpressionType(node.RHS); // Both sides must be of same type. (No implicit conversions in MonC) if (lhsType != rhsType) { string message = "Type mismatch between binary operator.\n" + $" LHS: {lhsType.Represent()}\n" + $" RHS: {rhsType.Represent()}"; _errors.AddError(message, node); } // TODO: Ensure operator is valid based on type. SetAndCacheType(node, lhsType); }
private void GenerateRelationalComparison(IBinaryOperationNode node) { node.RHS.AcceptExpressionVisitor(_expressionVisitor); node.LHS.AcceptExpressionVisitor(_expressionVisitor); ComparisonOperationAddress = _functionBuilder.InstructionCount; bool isGreaterThan = node is CompareGtBinOpNode || node is CompareGteBinOpNode; bool includeEquals = (node is CompareLteBinOpNode || node is CompareGteBinOpNode) ^ isGreaterThan; if (includeEquals) { _functionBuilder.AddInstruction(OpCode.CMPLTE); } else { _functionBuilder.AddInstruction(OpCode.CMPLT); } if (isGreaterThan) { _functionBuilder.AddInstruction(OpCode.LNOT); } }
public void VisitBinaryOperation(IBinaryOperationNode node) { Print($"{node.GetType().Name}"); VisitSubnode(node.LHS); VisitSubnode(node.RHS); }
public void VisitBinaryOperation(IBinaryOperationNode node) { _visitor.Visit(node); }
public void VisitUnknown(IBinaryOperationNode node) { throw new InvalidOperationException("Unexpected binary operation node type. Was replacement of a parse tree node missed?"); }
public virtual void VisitBinaryOperation(IBinaryOperationNode node) { VisitDefaultExpression(node); }
public virtual void VisitUnknown(IBinaryOperationNode node) { ThrowForUnknown(); }
public void VisitBinaryOperation(IBinaryOperationNode node) { // TODO: Should this be optional to allow more flexibility with a IBinaryOperationVisitor? node.LHS = _processor.ProcessReplacement(node.LHS); node.RHS = _processor.ProcessReplacement(node.RHS); }
public void VisitUnknown(IBinaryOperationNode node) { UnknownVisitor?.Visit(node); }
public void VisitBinaryOperation(IBinaryOperationNode node) { }