예제 #1
0
 public BoundUnaryExpression(BoundUnaryOperator op, BoundExpression operand)
 {
     Op      = op;
     Operand = operand;
 }
예제 #2
0
 public static BoundBinaryExpression LessOrEqual(BoundExpression left, BoundExpression right)
 => Binary(left, SyntaxKind.LessOrEqualsToken, right);
예제 #3
0
 public static BoundWhileStatement While(BoundExpression condition, BoundStatement body, BoundLabel breakLabel, BoundLabel continueLabel)
 {
     return(new BoundWhileStatement(condition, body, breakLabel, continueLabel));
 }
예제 #4
0
        public static BoundBinaryExpression Binary(BoundExpression left, SyntaxKind kind, BoundExpression right)
        {
            var op = BoundBinaryOperator.Bind(kind, left.Type, right.Type) !;

            return(new BoundBinaryExpression(left, op, right));
        }
예제 #5
0
 public static BoundBinaryExpression Add(BoundExpression left, BoundExpression right)
 => Binary(left, SyntaxKind.PlusToken, right);
예제 #6
0
 public static BoundVariableDeclaration ConstantDeclaration(string name, BoundExpression initializer)
 => VariableDeclarationInternal(name, initializer, isReadOnly: true);
예제 #7
0
        private static BoundVariableDeclaration VariableDeclarationInternal(string name, BoundExpression initializer, bool isReadOnly)
        {
            var local = new LocalVariableSymbol(name, isReadOnly, initializer.Type, initializer.ConstantValue);

            return(new BoundVariableDeclaration(local, initializer));
        }
예제 #8
0
 public static BoundConditionalGotoStatement GotoFalse(BoundLabelStatement label, BoundExpression condition)
 => GotoIf(label, condition, jumpIfTrue: false);
예제 #9
0
 public static BoundVariableDeclaration VariableDeclaration(VariableSymbol symbol, BoundExpression initializer)
 {
     return(new BoundVariableDeclaration(symbol, initializer));
 }
예제 #10
0
 public static BoundConditionalGotoStatement GotoIf(BoundLabelStatement label, BoundExpression condition, bool jumpIfTrue)
 {
     return(new BoundConditionalGotoStatement(label.Label, condition, jumpIfTrue));
 }
예제 #11
0
 public BoundBinaryExpression(BoundExpression left, BoundBinaryOperator op, BoundExpression right)
 {
     Left  = left;
     Op    = op;
     Right = right;
 }
예제 #12
0
 public BoundExpressionStatement(SyntaxNode syntax, BoundExpression expression)
     : base(syntax)
 {
     Expression = expression;
 }
예제 #13
0
 public Branch(AtomicBlock from, AtomicBlock to, BoundExpression condition)
 {
     From      = from;
     To        = to;
     Condition = condition;
 }
 public BoundAssignmentExpression(VariableSymbol variable, BoundExpression expression)
 {
     Variable   = variable;
     Expression = expression;
 }