public static KSyntaxToken Token(KSyntaxKind openParenToken, int startIndex = 0, int endIndex = 0) { string text; switch (openParenToken) { case KSyntaxKind.OpenParenToken: text = "("; break; case KSyntaxKind.CloseParenToken: text = ")"; break; case KSyntaxKind.Period: text = "."; break; case KSyntaxKind.SetKeyword: text = "set"; break; case KSyntaxKind.ToKeyword: text = "to"; break; case KSyntaxKind.LocalKeyword: text = "local"; break; case KSyntaxKind.IsKeyword: text = "is"; break; default: throw new KeyNotFoundException($"Unable to find token text value for '{openParenToken}'"); } return(new KSyntaxToken(openParenToken, text) { StartIndex = startIndex, EndIndex = endIndex }); }
public static AssignmentExpressionNode AssignmentExpression(KSyntaxKind simpleAssignmentExpression) { return(new AssignmentExpressionNode()); }
public static AssignmentExpressionNode AssignmentExpression(KSyntaxKind simpleAssignmentExpression, ExpressionNode left, ExpressionNode right) { throw new NotImplementedException(); }
public static LiteralExpressionNode LiteralExpression(KSyntaxKind stringLiteralExpression, KSyntaxToken token) { return(new LiteralExpressionNode(stringLiteralExpression, token)); }
public LiteralExpressionNode(KSyntaxKind kind, KSyntaxToken token) { Kind = kind; Token = token; }
internal KSyntaxToken(KSyntaxKind kind, string text) { Kind = kind; Text = text; }