public BoundExpression BindExpression(ExpresssionSyntax syntax) { switch (syntax.Kind) { case SyntaxKind.ParenthesizedExpression: return(BindParenthesizedExpression((ParenthesizedExpressionSyntax)syntax)); case SyntaxKind.LiteralExpression: return(BindLiteralExpression((LiteralExpressionSyntax)syntax)); case SyntaxKind.NameExpression: return(BindNameExpression((NameExpressionSyntax)syntax)); case SyntaxKind.AssignmentExpression: return(BindAssignmentExpression((AssignmentExpressionSyntax)syntax)); case SyntaxKind.UnaryExpression: return(BindUnaryExpression((UnaryExpressionSyntax)syntax)); case SyntaxKind.BinaryExpression: return(BindBinaryExpression((BinaryExpressionSyntax)syntax)); default: throw new Exception($"Unexpected Syntax {syntax.Kind}"); } }
public BinaryExpressionSyntax(ExpresssionSyntax left, SyntaxToken operatorToken, ExpresssionSyntax right) { Left = left; OperatorToken = operatorToken; Right = right; }
public SyntaxTree(IEnumerable <Diagnostic> diagnostics, ExpresssionSyntax root, SyntaxToken endOfFileToken) { Diagnostics = diagnostics.ToArray(); Root = root; EndOfFileToken = endOfFileToken; }
public UnaryExpressionSyntax(SyntaxToken operatorToken, ExpresssionSyntax operand) { OperatorToken = operatorToken; Operand = operand; }
public ParenthesizedExpressionSyntax(SyntaxToken OpenParenthesisToken, ExpresssionSyntax expresssion, SyntaxToken CloseParenthesisToken) { this.OpenParenthesisToken = OpenParenthesisToken; Expresssion = expresssion; this.CloseParenthesisToken = CloseParenthesisToken; }