Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #9546: Added example of AST for TokenTypes.NUM_INT #9630

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

shashwatj07
Copy link
Contributor

Resolves #9546

image

C:\Users\Shashwat>cat Test.java
public class Test {
    void foo(int a) {
      a = 3;
    }
}

C:\Users\Shashwat>java -jar checkstyle-8.41-all.jar -t Test.java
CLASS_DEF -> CLASS_DEF [1:0]
|--MODIFIERS -> MODIFIERS [1:0]
|   `--LITERAL_PUBLIC -> public [1:0]
|--LITERAL_CLASS -> class [1:7]
|--IDENT -> Test [1:13]
`--OBJBLOCK -> OBJBLOCK [1:18]
    |--LCURLY -> { [1:18]
    |--METHOD_DEF -> METHOD_DEF [2:4]
    |   |--MODIFIERS -> MODIFIERS [2:4]
    |   |--TYPE -> TYPE [2:4]
    |   |   `--LITERAL_VOID -> void [2:4]
    |   |--IDENT -> foo [2:9]
    |   |--LPAREN -> ( [2:12]
    |   |--PARAMETERS -> PARAMETERS [2:13]
    |   |   `--PARAMETER_DEF -> PARAMETER_DEF [2:13]
    |   |       |--MODIFIERS -> MODIFIERS [2:13]
    |   |       |--TYPE -> TYPE [2:13]
    |   |       |   `--LITERAL_INT -> int [2:13]
    |   |       `--IDENT -> a [2:17]
    |   |--RPAREN -> ) [2:18]
    |   `--SLIST -> { [2:20]
    |       |--EXPR -> EXPR [3:8]
    |       |   `--ASSIGN -> = [3:8]
    |       |       |--IDENT -> a [3:6]
    |       |       `--NUM_INT -> 3 [3:10]
    |       |--SEMI -> ; [3:11]
    |       `--RCURLY -> } [4:4]
    `--RCURLY -> } [5:0]

@shashwatj07
Copy link
Contributor Author

@strkkk please restart semaphore CI

@romani romani merged commit 6dce946 into checkstyle:master Mar 19, 2021
@shashwatj07 shashwatj07 deleted the issue_9546 branch March 23, 2021 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update example of AST for TokenTypes.NUM_INT
2 participants