Esempio n. 1
0
        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
            });
        }
Esempio n. 2
0
 public static AssignmentExpressionNode AssignmentExpression(KSyntaxKind simpleAssignmentExpression)
 {
     return(new AssignmentExpressionNode());
 }
Esempio n. 3
0
 public static AssignmentExpressionNode AssignmentExpression(KSyntaxKind simpleAssignmentExpression, ExpressionNode left, ExpressionNode right)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
 public static LiteralExpressionNode LiteralExpression(KSyntaxKind stringLiteralExpression, KSyntaxToken token)
 {
     return(new LiteralExpressionNode(stringLiteralExpression, token));
 }
Esempio n. 5
0
 public LiteralExpressionNode(KSyntaxKind kind, KSyntaxToken token)
 {
     Kind  = kind;
     Token = token;
 }
Esempio n. 6
0
 internal KSyntaxToken(KSyntaxKind kind, string text)
 {
     Kind = kind;
     Text = text;
 }