├── .gitignore ├── README.md ├── fast_pb2.py ├── sample_files ├── .DS_Store ├── C │ ├── Bubblesort.c │ ├── Bubblesort.fbs │ ├── Bubblesort.pb │ ├── Bubblesort.pkl │ ├── Bubblesort.txt │ └── dummy.txt ├── Csharp │ ├── Bubblesort.cs │ ├── Bubblesort.fbs │ ├── Bubblesort.pb │ ├── Bubblesort.txt │ └── dummy.txt └── Java │ ├── Bubblesort.fbs │ ├── Bubblesort.java │ ├── Bubblesort.pb │ ├── Bubblesort.pkl │ ├── Bubblesort.txt │ ├── Bubblesort.xml │ └── dummy.txt ├── traverse_tree_sample.py └── types ├── edge_types.tsv └── srcml_node_types.tsv /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | The backbone of this tool is the Abstract Syntax Tree (AST). The AST will be generated using the f-ast tool: [fAST: Flattening Abstract Syntax Trees for Efficiency, ICSE 2019](https://oro.open.ac.uk/59268/1/main.pdf). The tool supports any ANTLR4 grammar of over 170 different types of programming languages. 4 | 5 | Some benefits of using the f-ast: 6 | 7 | - f-ast leverages [protobuf](https://github.com/protocolbuffers/protobuf) to store the AST and make the parsing much faster than the other tools. 8 | - f-ast is built based on [srcml](https://www.srcml.org/) and [srcSlice](https://github.com/srcML/srcSlice). That is, it can incorporate the slicing information of the program, such as [the use-def chain](https://en.wikipedia.org/wiki/Use-define_chain) (taken from srcSlice) into the AST. The use-def chain is a critical information to generate the graph representation of the AST. 9 | 10 | A runnable docker image of the tool can be pulled by using this command: 11 | 12 | ```bash 13 | $ docker pull yijun/fast:latest 14 | ``` 15 | 16 | ## Example usages: 17 | 18 | The example files can be found in [this](https://github.com/bdqnghi/fAST-instruction/tree/master/sample_files) 19 | 20 | To generate an protobuffer representation of the AST. 21 | 22 | ```bash 23 | $ cd sample_files 24 | $ docker run -v $(pwd):/e -it yijun/fast -p Bubblesort.java Bubblesort.pb 25 | ``` 26 | 27 | To generate an flatbuffer representation of the AST. 28 | 29 | ```bash 30 | $ cd sample_files 31 | $ docker run -v $(pwd):/e -it yijun/fast -S -G Bubblesort.java Bubblesort.fbs 32 | ``` 33 | 34 | While the protobuf representation is more convenient when traversing and modifying the AST, the flatbuffer representation is much faster in parsing time. 35 | 36 | To generate an Graph representation of from the fbs representation: 37 | 38 | ```bash 39 | $ docker run -v $(pwd):/e --entrypoint ggnn -it yijun/fast Bubblesort.fbs dummy.txt Bubblesort.txt 40 | ``` 41 | Ignore the dummy.txt, it's a redundant output (we intended to use it for other purpose) 42 | The Bubblesort.txt is a graph representation with the format: source_id, source_node_type edge_type sink_id, sink_node_type. 43 | For example, the edge: 44 | ``` 45 | 22,3 1 21,4 46 | ``` 47 | means that the node with id 22 connects to the node with id 21 via the edge type 1. Also, the node with id 22 has the type of 3, the node with id 21 has the type of 4. 48 | 49 | For the list of node types, see [this](https://github.com/bdqnghi/fAST-instruction/blob/master/types/srcml_node_types.tsv). 50 | 51 | For the list of edge types, see [this](https://github.com/bdqnghi/fAST-instruction/blob/master/types/edge_types.tsv). 52 | -------------------------------------------------------------------------------- /sample_files/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/.DS_Store -------------------------------------------------------------------------------- /sample_files/C/Bubblesort.c: -------------------------------------------------------------------------------- 1 | // C program for implementation of Bubble sort 2 | #include 3 | 4 | void swap(int *xp, int *yp) 5 | { 6 | int temp = *xp; 7 | *xp = *yp; 8 | *yp = temp; 9 | } 10 | 11 | // A function to implement bubble sort 12 | void bubbleSort(int arr[], int n) 13 | { 14 | int i, j; 15 | for (i = 0; i < n-1; i++) 16 | 17 | // Last i elements are already in place 18 | for (j = 0; j < n-i-1; j++) 19 | if (arr[j] > arr[j+1]) 20 | swap(&arr[j], &arr[j+1]); 21 | } 22 | 23 | /* Function to print an array */ 24 | void printArray(int arr[], int size) 25 | { 26 | int i; 27 | for (i=0; i < size; i++) 28 | printf("%d ", arr[i]); 29 | printf("\n"); 30 | } 31 | 32 | // Driver program to test above functions 33 | int main() 34 | { 35 | int arr[] = {64, 34, 25, 12, 22, 11, 90}; 36 | int n = sizeof(arr)/sizeof(arr[0]); 37 | bubbleSort(arr, n); 38 | printf("Sorted array: \n"); 39 | printArray(arr, n); 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /sample_files/C/Bubblesort.fbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/C/Bubblesort.fbs -------------------------------------------------------------------------------- /sample_files/C/Bubblesort.pb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/C/Bubblesort.pb -------------------------------------------------------------------------------- /sample_files/C/Bubblesort.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/C/Bubblesort.pkl -------------------------------------------------------------------------------- /sample_files/C/Bubblesort.txt: -------------------------------------------------------------------------------- 1 | 152,54 2 165,100 2 | 118,54 2 137,104 3 | 127,52 2 134,54 4 | 70,4 1 68,52 5 | 22,52 2 23,54 6 | 26,1 1 21,54 7 | 267,54 5 243,54 8 | 4,57 1 3,54 9 | 135,4 1 134,54 10 | 240,2 2 262,2 11 | 97,59 2 101,9 12 | 180,59 2 184,9 13 | 145,279 1 144,60 14 | 170,2 2 202,279 15 | 183,4 1 182,52 16 | 100,4 1 98,54 17 | 96,4 1 94,52 18 | 14,57 1 13,53 19 | 263,54 2 270,104 20 | 215,54 2 216,100 21 | 140,5 1 139,4 22 | 102,8 1 97,59 23 | 296,60 1 273,5 24 | 174,4 1 173,48 25 | 105,4 1 104,54 26 | 33,4 1 32,54 27 | 198,7 1 186,54 28 | 117,59 2 142,67 29 | 141,60 1 140,5 30 | 5,54 2 18,100 31 | 18,100 1 11,101 32 | 212,12 2 297,12 33 | 2,299 1 0,150 34 | 129,54 2 130,52 35 | 85,52 2 86,48 36 | 91,54 2 92,52 37 | 52,101 2 57,101 38 | 128,54 2 133,62 39 | 88,3 1 87,4 40 | 40,5 1 39,4 41 | 45,54 2 58,100 42 | 259,4 1 258,283 43 | 298,0 1 2,299 44 | 77,4 1 72,54 45 | 157,54 1 155,54 46 | 207,104 1 206,105 47 | 266,105 2 269,105 48 | 66,2 1 65,1 49 | 20,57 2 21,54 50 | 154,57 1 153,54 51 | 62,1 2 65,1 52 | 56,1 1 54,57 53 | 225,4 1 224,48 54 | 286,54 4 267,54 55 | 211,60 1 202,279 56 | 247,104 1 246,105 57 | 165,100 2 211,60 58 | 102,8 1 88,3 59 | 268,4 1 267,54 60 | 236,60 1 229,4 61 | 58,100 1 57,101 62 | 47,57 1 46,54 63 | 227,4 2 229,4 64 | 270,104 1 266,105 65 | 212,12 1 211,60 66 | 10,1 1 8,57 67 | 290,7 1 282,54 68 | 179,4 1 176,54 69 | 259,4 1 249,52 70 | 89,54 2 90,52 71 | 109,54 2 114,62 72 | 248,283 1 247,104 73 | 176,54 2 177,52 74 | 212,12 1 165,100 75 | 176,54 5 168,54 76 | 17,101 1 16,1 77 | 8,57 1 7,53 78 | 103,54 2 106,62 79 | 218,57 1 217,54 80 | 14,57 2 15,54 81 | 116,4 1 115,54 82 | 139,4 1 138,7 83 | 242,57 1 241,54 84 | 42,12 1 4,57 85 | 229,4 2 231,4 86 | 41,60 1 27,2 87 | 221,54 1 220,62 88 | 193,62 1 192,4 89 | 258,283 1 257,104 90 | 199,4 1 198,7 91 | 44,57 2 45,54 92 | 154,57 2 157,54 93 | 66,2 2 147,279 94 | 294,4 1 293,48 95 | 124,54 1 120,54 96 | 67,54 2 68,52 97 | 96,4 1 92,52 98 | 161,57 2 162,54 99 | 16,1 1 15,54 100 | 111,52 2 112,48 101 | 167,57 1 166,54 102 | 81,4 1 79,54 103 | 122,4 1 121,54 104 | 102,8 2 144,60 105 | 233,4 2 235,4 106 | 149,12 1 45,54 107 | 149,12 1 44,57 108 | 77,4 1 74,54 109 | 98,54 2 99,52 110 | 264,54 5 219,54 111 | 149,12 1 148,60 112 | 75,52 2 76,48 113 | 197,104 1 196,105 114 | 185,8 2 201,60 115 | 146,60 1 145,279 116 | 143,280 1 117,59 117 | 298,0 1 212,12 118 | 113,4 1 112,48 119 | 237,4 1 236,60 120 | 238,3 1 237,4 121 | 90,52 2 91,54 122 | 296,60 1 292,5 123 | 84,54 2 85,52 124 | 283,54 5 219,54 125 | 239,1 1 221,54 126 | 89,54 5 64,54 127 | 242,57 2 243,54 128 | 151,57 2 152,54 129 | 35,52 2 36,54 130 | 282,54 2 289,104 131 | 205,4 1 204,48 132 | 201,60 1 200,5 133 | 78,59 1 77,4 134 | 32,54 5 36,54 135 | 290,7 1 289,104 136 | 289,104 1 285,105 137 | 239,1 1 238,3 138 | 50,54 1 49,62 139 | 83,8 1 78,59 140 | 106,62 1 105,4 141 | 280,4 1 279,7 142 | 31,52 2 32,54 143 | 4,57 2 5,54 144 | 133,62 1 132,4 145 | 107,54 2 108,52 146 | 178,54 4 176,54 147 | 144,60 1 143,280 148 | 87,4 1 85,52 149 | 96,4 1 91,54 150 | 236,60 1 233,4 151 | 87,4 1 84,54 152 | 126,105 1 125,4 153 | 157,54 1 156,62 154 | 136,105 1 135,4 155 | 0,150 2 1,174 156 | 68,52 2 69,48 157 | 196,105 1 195,4 158 | 292,5 1 291,4 159 | 184,9 1 183,4 160 | 137,104 1 126,105 161 | 287,4 1 286,54 162 | 163,1 1 162,54 163 | 24,4 1 22,52 164 | 239,1 1 218,57 165 | 285,105 2 288,105 166 | 120,54 2 123,62 167 | 42,12 1 18,100 168 | 192,4 1 191,54 169 | 62,1 1 61,54 170 | 29,54 2 30,52 171 | 101,9 1 100,4 172 | 248,283 2 249,52 173 | 178,54 5 162,54 174 | 261,1 1 242,57 175 | 200,5 1 199,4 176 | 221,54 2 238,3 177 | 27,2 2 34,5 178 | 93,54 2 94,52 179 | 71,3 2 78,59 180 | 285,105 1 284,4 181 | 249,52 2 258,283 182 | 279,7 1 278,104 183 | 179,4 1 178,54 184 | 28,52 2 29,54 185 | 33,4 1 30,52 186 | 125,4 1 119,52 187 | 23,54 5 29,54 188 | 44,57 1 43,54 189 | 88,3 2 97,59 190 | 276,4 1 275,48 191 | 110,54 2 111,52 192 | 134,54 1 128,54 193 | 27,2 1 26,1 194 | 132,4 1 130,52 195 | 8,57 2 9,54 196 | 281,5 1 280,4 197 | 277,105 1 276,4 198 | 65,1 1 63,57 199 | 147,279 1 146,60 200 | 33,4 1 31,52 201 | 100,4 1 99,52 202 | 296,60 1 240,2 203 | 194,54 1 190,54 204 | 39,4 1 35,52 205 | 58,100 2 148,60 206 | 169,1 1 167,57 207 | 155,54 2 156,62 208 | 172,52 2 173,48 209 | 87,4 1 86,48 210 | 279,7 1 274,54 211 | 21,54 2 25,3 212 | 132,4 1 129,54 213 | 123,62 1 122,4 214 | 74,54 2 75,52 215 | 231,4 1 230,48 216 | 209,4 1 208,7 217 | 36,54 7 38,54 218 | 236,60 1 225,4 219 | 170,2 1 169,1 220 | 74,54 4 93,54 221 | 42,12 2 149,12 222 | 58,100 1 52,101 223 | 72,54 5 61,54 224 | 29,54 7 32,54 225 | 60,57 1 59,54 226 | 195,4 1 194,54 227 | 41,60 1 40,5 228 | 159,101 2 164,101 229 | 115,54 1 109,54 230 | 297,12 1 215,54 231 | 132,4 1 131,48 232 | 298,0 1 42,12 233 | 62,1 1 60,57 234 | 179,4 1 177,52 235 | 30,52 2 31,52 236 | 260,3 1 259,4 237 | 116,4 1 108,52 238 | 74,54 5 55,54 239 | 210,5 1 209,4 240 | 169,1 1 168,54 241 | 284,4 1 283,54 242 | 236,60 1 235,4 243 | 81,4 1 80,52 244 | 202,279 1 201,60 245 | 295,298 6 297,12 246 | 51,1 1 50,54 247 | 16,1 1 14,57 248 | 143,280 1 142,67 249 | 18,100 2 41,60 250 | 203,54 2 207,104 251 | 289,104 1 288,105 252 | 180,59 1 179,4 253 | 218,57 2 221,54 254 | 181,54 2 182,52 255 | 254,54 1 253,62 256 | 70,4 1 69,48 257 | 223,4 2 225,4 258 | 73,52 2 74,54 259 | 236,60 1 231,4 260 | 281,5 2 292,5 261 | 71,3 1 70,4 262 | 198,7 1 197,104 263 | 189,105 2 196,105 264 | 6,54 2 7,53 265 | 124,54 1 123,62 266 | 2,299 1 1,174 267 | 194,54 1 193,62 268 | 297,12 1 216,100 269 | 253,62 1 252,4 270 | 117,59 1 116,4 271 | 107,54 1 103,54 272 | 270,104 1 269,105 273 | 227,4 1 226,48 274 | 265,4 1 264,54 275 | 38,54 5 21,54 276 | 77,4 1 73,52 277 | 271,7 1 263,54 278 | 33,4 1 29,54 279 | 134,54 1 133,62 280 | 93,54 4 72,54 281 | 96,4 1 90,52 282 | 186,54 2 197,104 283 | 77,4 1 76,48 284 | 183,4 1 181,54 285 | 79,54 2 80,52 286 | 8,57 1 6,54 287 | 273,5 1 272,4 288 | 190,54 2 193,62 289 | 291,4 1 290,7 290 | 50,54 1 48,54 291 | 78,59 2 82,9 292 | 278,104 1 277,105 293 | 221,54 1 219,54 294 | 126,105 2 136,105 295 | 11,101 1 10,1 296 | 245,4 1 244,54 297 | 274,54 2 278,104 298 | 158,1 1 154,57 299 | 298,0 1 149,12 300 | 197,104 1 189,105 301 | 236,60 1 223,4 302 | 54,57 1 53,54 303 | 66,2 1 62,1 304 | 39,4 1 38,54 305 | 47,57 2 50,54 306 | 77,4 1 75,52 307 | 171,54 2 172,52 308 | 151,57 1 150,54 309 | 259,4 1 248,283 310 | 94,52 2 95,48 311 | 185,8 1 180,59 312 | 165,100 1 159,101 313 | 223,4 1 222,48 314 | 32,54 4 38,54 315 | 147,279 1 83,8 316 | 138,7 1 118,54 317 | 250,54 2 253,62 318 | 149,12 2 212,12 319 | 167,57 2 168,54 320 | 202,279 2 210,5 321 | 288,105 1 287,4 322 | 39,4 1 37,52 323 | 211,60 1 170,2 324 | 163,1 1 161,57 325 | 235,4 1 234,48 326 | 138,7 1 137,104 327 | 119,52 2 124,54 328 | 92,52 2 93,54 329 | 83,8 2 146,60 330 | 212,12 1 151,57 331 | 185,8 1 175,3 332 | 51,1 1 47,57 333 | 208,7 1 207,104 334 | 26,1 1 20,57 335 | 135,4 1 127,52 336 | 108,52 2 115,54 337 | 149,12 1 58,100 338 | 283,54 4 264,54 339 | 60,57 2 61,54 340 | 2,299 2 42,12 341 | 266,105 1 265,4 342 | 297,12 1 214,57 343 | 42,12 1 41,60 344 | 83,8 1 71,3 345 | 23,54 4 32,54 346 | 296,60 1 295,298 347 | 137,104 1 136,105 348 | 42,12 1 5,54 349 | 82,9 1 81,4 350 | 54,57 2 55,54 351 | 70,4 1 67,54 352 | 211,60 1 210,5 353 | 26,1 1 25,3 354 | 52,101 1 51,1 355 | 65,1 1 64,54 356 | 233,4 1 232,48 357 | 142,67 1 141,60 358 | 48,54 2 49,62 359 | 296,60 1 281,5 360 | 113,4 1 110,54 361 | 83,8 1 82,9 362 | 298,0 1 297,12 363 | 174,4 1 171,54 364 | 214,57 2 215,54 365 | 188,4 1 187,48 366 | 212,12 1 152,54 367 | 63,57 2 64,54 368 | 269,105 1 268,4 369 | 286,54 5 243,54 370 | 36,54 2 37,52 371 | 34,5 1 33,4 372 | 236,60 1 227,4 373 | 37,52 2 38,54 374 | 262,2 2 273,5 375 | 33,4 1 28,52 376 | 240,2 1 239,1 377 | 14,57 1 12,54 378 | 24,4 1 23,54 379 | 114,62 1 113,4 380 | 272,4 1 271,7 381 | 165,100 1 164,101 382 | 41,60 1 34,5 383 | 91,54 5 55,54 384 | 255,4 1 254,54 385 | 295,298 1 294,4 386 | 96,4 1 89,54 387 | 34,5 2 40,5 388 | 39,4 1 36,54 389 | 96,4 1 93,54 390 | 130,52 2 131,48 391 | 113,4 1 111,52 392 | 206,105 1 205,4 393 | 18,100 1 17,101 394 | 292,5 2 295,298 395 | 125,4 1 124,54 396 | 185,8 1 184,9 397 | 256,105 1 255,4 398 | 93,54 5 61,54 399 | 214,57 1 213,54 400 | 257,104 1 256,105 401 | 145,279 1 102,8 402 | 56,1 1 55,54 403 | 175,3 2 180,59 404 | 161,57 1 160,54 405 | 148,60 1 147,279 406 | 229,4 1 228,48 407 | 72,54 4 89,54 408 | 216,100 2 296,60 409 | 261,1 1 260,3 410 | 174,4 1 172,52 411 | 158,1 1 157,54 412 | 208,7 1 203,54 413 | 97,59 1 96,4 414 | 116,4 1 107,54 415 | 254,54 1 250,54 416 | 219,54 2 220,62 417 | 11,101 2 17,101 418 | 107,54 1 106,62 419 | 243,54 2 260,3 420 | 57,101 1 56,1 421 | 297,12 1 296,60 422 | 115,54 1 114,62 423 | 252,4 1 251,48 424 | 225,4 2 227,4 425 | 177,52 2 178,54 426 | 246,105 1 245,4 427 | 10,1 1 9,54 428 | 231,4 2 233,4 429 | 91,54 4 74,54 430 | 148,60 1 66,2 431 | 164,101 1 163,1 432 | 261,1 1 243,54 433 | 175,3 1 174,4 434 | 264,54 4 286,54 435 | 189,105 1 188,4 436 | 202,279 1 185,8 437 | 72,54 2 73,52 438 | 12,54 2 13,53 439 | 271,7 1 270,104 440 | 102,8 1 101,9 441 | 262,2 1 261,1 442 | 20,57 1 19,54 443 | 273,5 2 281,5 444 | 25,3 1 24,4 445 | 159,101 1 158,1 446 | 296,60 1 262,2 447 | 96,4 1 95,48 448 | ? 1 e/Bubblesort.c 449 | 450 | -------------------------------------------------------------------------------- /sample_files/C/dummy.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/C/dummy.txt -------------------------------------------------------------------------------- /sample_files/Csharp/Bubblesort.cs: -------------------------------------------------------------------------------- 1 | // C# program for implementation 2 | // of Bubble Sort 3 | using System; 4 | 5 | class GFG 6 | { 7 | static void bubbleSort(int []arr) 8 | { 9 | int n = arr.Length; 10 | for (int i = 0; i < n - 1; i++) 11 | for (int j = 0; j < n - i - 1; j++) 12 | if (arr[j] > arr[j + 1]) 13 | { 14 | // swap temp and arr[i] 15 | int temp = arr[j]; 16 | arr[j] = arr[j + 1]; 17 | arr[j + 1] = temp; 18 | } 19 | } 20 | 21 | /* Prints the array */ 22 | static void printArray(int []arr) 23 | { 24 | int n = arr.Length; 25 | for (int i = 0; i < n; ++i) 26 | Console.Write(arr[i] + " "); 27 | Console.WriteLine(); 28 | } 29 | 30 | // Driver method 31 | public static void Main() 32 | { 33 | int []arr = {64, 34, 25, 12, 22, 11, 90}; 34 | bubbleSort(arr); 35 | Console.WriteLine("Sorted array"); 36 | printArray(arr); 37 | } 38 | 39 | } 40 | 41 | // This code is contributed by Sam007 42 | -------------------------------------------------------------------------------- /sample_files/Csharp/Bubblesort.fbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/Csharp/Bubblesort.fbs -------------------------------------------------------------------------------- /sample_files/Csharp/Bubblesort.pb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/Csharp/Bubblesort.pb -------------------------------------------------------------------------------- /sample_files/Csharp/Bubblesort.txt: -------------------------------------------------------------------------------- 1 | 116,54 7 118,54 2 | 33,3 1 32,1 3 | 186,4 1 185,7 4 | 254,7 1 253,104 5 | 21,54 1 20,54 6 | 119,4 1 117,52 7 | 12,1 1 11,54 8 | 90,54 1 89,62 9 | 178,62 1 177,4 10 | 92,3 1 91,4 11 | 193,54 1 192,54 12 | 247,4 1 246,7 13 | 68,54 4 56,54 14 | 96,54 7 101,54 15 | 67,8 1 62,59 16 | 225,60 1 218,4 17 | 179,54 2 180,52 18 | 39,4 1 34,54 19 | 95,54 2 98,62 20 | 72,54 1 68,54 21 | 106,62 1 105,4 22 | 148,54 1 145,54 23 | 137,57 2 138,54 24 | 52,1 1 47,57 25 | 117,52 2 118,54 26 | 179,54 1 175,54 27 | 257,60 1 229,2 28 | 252,105 1 251,4 29 | 148,54 1 146,52 30 | 229,2 1 228,1 31 | 170,8 1 160,3 32 | 95,54 7 107,54 33 | 216,4 1 215,48 34 | 105,4 1 104,48 35 | 114,4 1 112,52 36 | 134,54 2 135,62 37 | 25,2 2 127,279 38 | 222,4 1 221,48 39 | 61,4 1 58,54 40 | 27,57 1 26,54 41 | 141,100 2 198,60 42 | 16,57 2 17,54 43 | 43,4 1 41,54 44 | 47,57 1 46,54 45 | 96,54 7 107,54 46 | 56,54 4 36,54 47 | 99,54 7 102,54 48 | 78,4 1 75,54 49 | 114,4 1 111,54 50 | 246,7 1 241,54 51 | 28,54 2 31,3 52 | 209,57 2 210,54 53 | 84,57 2 85,54 54 | 103,52 2 104,48 55 | 180,52 2 181,48 56 | 1,36 2 260,108 57 | 170,8 1 165,59 58 | 161,54 2 162,52 59 | 23,3 1 22,4 60 | 33,3 2 40,59 61 | 179,54 1 178,62 62 | 183,105 1 182,4 63 | 158,3 1 157,4 64 | 9,54 1 8,62 65 | 139,1 1 137,57 66 | 32,1 1 31,3 67 | 58,54 4 34,54 68 | 17,54 2 23,3 69 | 206,54 2 207,62 70 | 231,54 5 210,54 71 | 62,59 2 66,9 72 | 201,314 2 203,57 73 | 88,4 1 87,54 74 | 212,4 2 214,4 75 | 50,4 1 49,48 76 | 140,101 1 139,1 77 | 225,60 1 216,4 78 | 241,54 2 245,104 79 | 89,62 1 88,4 80 | 121,60 1 120,5 81 | 10,57 2 11,54 82 | 182,4 1 179,54 83 | 159,1 1 155,54 84 | 101,54 2 106,62 85 | 43,4 1 42,52 86 | 99,54 7 101,54 87 | 72,54 1 71,62 88 | 36,54 4 118,54 89 | 258,12 1 201,314 90 | 144,54 2 150,3 91 | 72,54 2 73,52 92 | 12,1 1 10,57 93 | 32,1 1 27,57 94 | 86,54 5 11,54 95 | 203,57 1 202,54 96 | 58,54 5 28,54 97 | 32,1 1 28,54 98 | 39,4 1 38,48 99 | 175,54 2 178,62 100 | 225,60 1 222,4 101 | 94,2 2 109,5 102 | 132,57 1 131,54 103 | 171,54 2 172,52 104 | 235,7 1 230,54 105 | 3,314 2 5,57 106 | 91,4 1 90,54 107 | 122,67 1 121,60 108 | 36,54 5 17,54 109 | 34,54 4 18,54 110 | 74,54 5 11,54 111 | 160,3 2 165,59 112 | 175,54 4 145,54 113 | 150,3 1 149,4 114 | 1,36 1 0,54 115 | 78,4 1 77,48 116 | 260,108 1 2,54 117 | 67,8 1 53,3 118 | 123,280 1 82,59 119 | 157,4 1 156,48 120 | 174,54 1 171,54 121 | 61,4 1 56,54 122 | 188,60 1 187,5 123 | 67,8 1 66,9 124 | 45,8 1 33,3 125 | 59,52 2 60,48 126 | 162,52 2 163,54 127 | 199,12 1 198,60 128 | 24,1 1 17,54 129 | 90,54 1 86,54 130 | 129,12 1 6,54 131 | 241,54 1 239,52 132 | 34,54 5 28,54 133 | 177,4 1 176,54 134 | 244,105 1 243,4 135 | 259,60 1 129,12 136 | 137,57 1 136,54 137 | 248,5 2 256,5 138 | 95,54 7 101,54 139 | 259,60 1 199,12 140 | 200,314 2 201,314 141 | 241,54 1 238,54 142 | 170,8 1 169,9 143 | 105,4 1 103,52 144 | 93,1 1 92,3 145 | 125,279 1 124,60 146 | 108,4 1 100,52 147 | 34,54 2 35,52 148 | 99,54 1 98,62 149 | 61,4 1 57,52 150 | 24,1 1 16,57 151 | 204,54 2 205,100 152 | 196,4 1 195,7 153 | 40,59 1 39,4 154 | 256,5 1 255,4 155 | 85,54 2 92,3 156 | 129,12 2 199,12 157 | 184,104 1 183,105 158 | 248,5 1 247,4 159 | 165,59 2 169,9 160 | 13,101 1 12,1 161 | 39,4 1 36,54 162 | 109,5 1 108,4 163 | 48,54 2 51,3 164 | 165,59 1 164,4 165 | 68,54 5 11,54 166 | 63,54 2 64,52 167 | 225,60 1 214,4 168 | 225,60 1 224,4 169 | 136,54 1 134,54 170 | 21,54 1 18,54 171 | 39,4 1 37,52 172 | 111,54 2 112,52 173 | 53,3 2 62,59 174 | 55,52 2 56,54 175 | 51,3 1 50,4 176 | 5,57 1 4,54 177 | 108,4 1 99,54 178 | 81,4 1 72,54 179 | 102,54 2 103,52 180 | 86,54 2 89,62 181 | 258,12 1 200,314 182 | 84,57 1 83,54 183 | 125,279 1 67,8 184 | 175,54 5 138,54 185 | 116,54 2 117,52 186 | 195,7 1 194,104 187 | 193,54 2 194,104 188 | 224,4 1 223,48 189 | 61,4 1 54,54 190 | 132,57 2 133,54 191 | 82,59 2 122,67 192 | 218,4 1 217,48 193 | 99,54 2 100,52 194 | 54,54 4 58,54 195 | 10,57 1 9,54 196 | 71,62 1 70,4 197 | 249,54 2 253,104 198 | 163,54 4 161,54 199 | 208,54 1 206,54 200 | 35,52 2 36,54 201 | 53,3 1 52,1 202 | 100,52 2 107,54 203 | 258,12 1 204,54 204 | 81,4 1 73,52 205 | 261,0 1 1,36 206 | 258,12 1 257,60 207 | 220,4 2 222,4 208 | 115,62 1 114,4 209 | 145,54 4 163,54 210 | 80,54 1 79,62 211 | 37,52 2 38,48 212 | 129,12 1 3,314 213 | 75,54 2 76,52 214 | 56,54 5 17,54 215 | 238,54 2 239,52 216 | 99,54 7 107,54 217 | 119,4 1 118,54 218 | 56,54 2 57,52 219 | 154,57 1 153,54 220 | 61,4 1 60,48 221 | 136,54 1 135,62 222 | 216,4 2 218,4 223 | 79,62 1 78,4 224 | 199,12 1 133,54 225 | 237,5 1 236,4 226 | 164,4 1 163,54 227 | 159,1 1 158,3 228 | 214,4 2 216,4 229 | 14,100 2 128,60 230 | 18,54 4 86,54 231 | 155,54 2 158,3 232 | 198,60 1 152,2 233 | 141,100 1 140,101 234 | 214,4 1 213,48 235 | 189,279 1 188,60 236 | 258,12 1 203,57 237 | 121,60 1 94,2 238 | 47,57 2 48,54 239 | 225,60 1 212,4 240 | 199,12 1 141,100 241 | 208,54 1 207,62 242 | 52,1 1 48,54 243 | 235,7 1 234,104 244 | 99,54 1 95,54 245 | 130,314 2 132,57 246 | 154,57 2 155,54 247 | 176,54 4 175,54 248 | 9,54 1 7,54 249 | 78,4 1 76,52 250 | 218,4 2 220,4 251 | 74,54 4 68,54 252 | 62,59 1 61,4 253 | 18,54 5 11,54 254 | 61,4 1 55,52 255 | 57,52 2 58,54 256 | 193,54 1 191,52 257 | 145,54 2 146,52 258 | 107,54 1 106,62 259 | 169,9 1 168,4 260 | 98,62 1 97,4 261 | 129,12 1 5,57 262 | 148,54 1 147,54 263 | 22,4 1 21,54 264 | 203,57 2 204,54 265 | 18,54 2 19,52 266 | 237,5 2 248,5 267 | 151,1 1 150,3 268 | 159,1 1 154,57 269 | 225,60 1 220,4 270 | 182,4 1 180,52 271 | 114,4 1 113,48 272 | 174,54 1 172,52 273 | 246,7 1 245,104 274 | 14,100 1 13,101 275 | 199,12 1 130,314 276 | 222,4 2 224,4 277 | 73,52 2 80,54 278 | 25,2 1 24,1 279 | 152,2 2 189,279 280 | 168,4 1 166,52 281 | 19,52 2 20,54 282 | 232,4 1 231,54 283 | 190,54 2 191,52 284 | 168,4 1 167,54 285 | 220,4 1 219,48 286 | 149,4 1 148,54 287 | 230,54 2 234,104 288 | 94,2 1 93,1 289 | 259,60 1 258,12 290 | 251,4 1 250,54 291 | 58,54 2 59,52 292 | 139,1 1 138,54 293 | 5,57 2 6,54 294 | 146,52 2 147,54 295 | 199,12 2 258,12 296 | 182,4 1 181,48 297 | 133,54 2 141,100 298 | 52,1 1 51,3 299 | 96,54 7 102,54 300 | 245,104 1 244,105 301 | 257,60 1 256,5 302 | 253,104 1 252,105 303 | 82,59 1 81,4 304 | 44,9 1 43,4 305 | 126,60 1 125,279 306 | 93,1 1 85,54 307 | 121,60 1 109,5 308 | 127,279 1 45,8 309 | 151,1 1 144,54 310 | 250,54 5 210,54 311 | 160,3 1 159,1 312 | 41,54 2 42,52 313 | 198,60 1 189,279 314 | 129,12 1 14,100 315 | 163,54 5 144,54 316 | 45,8 1 44,9 317 | 250,54 4 231,54 318 | 152,2 1 151,1 319 | 65,4 1 64,52 320 | 97,4 1 96,54 321 | 241,54 1 240,54 322 | 120,5 1 119,4 323 | 255,4 1 254,7 324 | 205,100 2 257,60 325 | 118,54 5 85,54 326 | 86,54 4 74,54 327 | 45,8 1 40,59 328 | 2,54 2 259,60 329 | 74,54 2 79,62 330 | 110,54 2 115,62 331 | 65,4 1 63,54 332 | 257,60 1 248,5 333 | 109,5 2 120,5 334 | 209,57 1 208,54 335 | 6,54 2 14,100 336 | 164,4 1 162,52 337 | 112,52 2 113,48 338 | 193,54 1 190,54 339 | 164,4 1 161,54 340 | 143,57 1 142,54 341 | 31,3 1 30,4 342 | 228,1 1 210,54 343 | 108,4 1 107,54 344 | 110,54 7 118,54 345 | 30,4 1 29,48 346 | 145,54 5 138,54 347 | 95,54 7 102,54 348 | 234,104 1 233,105 349 | 93,1 1 84,57 350 | 116,54 1 110,54 351 | 76,52 2 77,48 352 | 233,105 1 232,4 353 | 39,4 1 35,52 354 | 187,5 1 186,4 355 | 40,59 2 44,9 356 | 236,4 1 235,7 357 | 129,12 1 128,60 358 | 116,54 1 115,62 359 | 195,7 1 193,54 360 | 127,279 1 126,60 361 | 199,12 1 132,57 362 | 128,60 1 25,2 363 | 61,4 1 59,52 364 | 161,54 5 155,54 365 | 210,54 2 227,3 366 | 185,7 1 184,104 367 | 174,54 1 173,54 368 | 128,60 1 127,279 369 | 189,279 1 170,8 370 | 36,54 2 37,52 371 | 257,60 1 237,5 372 | 172,52 2 173,54 373 | 227,3 1 226,4 374 | 66,9 1 65,4 375 | 229,2 2 237,5 376 | 111,54 7 118,54 377 | 68,54 2 71,62 378 | 80,54 1 74,54 379 | 226,4 1 225,60 380 | 254,7 1 249,54 381 | 143,57 2 144,54 382 | 260,108 1 259,60 383 | 45,8 2 126,60 384 | 170,8 2 188,60 385 | 191,52 2 192,54 386 | 24,1 1 23,3 387 | 212,4 1 211,48 388 | 243,4 1 242,48 389 | 119,4 1 116,54 390 | 123,280 1 122,67 391 | 176,54 5 138,54 392 | 261,0 1 260,108 393 | 54,54 5 48,54 394 | 166,52 2 167,54 395 | 7,54 2 8,62 396 | 197,5 1 196,4 397 | 151,1 1 143,57 398 | 105,4 1 102,54 399 | 228,1 1 227,3 400 | 228,1 1 209,57 401 | 67,8 2 124,60 402 | 198,60 1 197,5 403 | 54,54 2 55,52 404 | 21,54 1 19,52 405 | 70,4 1 69,54 406 | 258,12 1 205,100 407 | 81,4 1 80,54 408 | 107,54 1 101,54 409 | 124,60 1 123,280 410 | 239,52 2 240,54 411 | 174,54 2 184,104 412 | 189,279 2 197,5 413 | 16,57 1 15,54 414 | 185,7 1 174,54 415 | 27,57 2 28,54 416 | ? 1 e/Bubblesort.cs 417 | 418 | -------------------------------------------------------------------------------- /sample_files/Csharp/dummy.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/Csharp/dummy.txt -------------------------------------------------------------------------------- /sample_files/Java/Bubblesort.fbs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/Java/Bubblesort.fbs -------------------------------------------------------------------------------- /sample_files/Java/Bubblesort.java: -------------------------------------------------------------------------------- 1 | // Java program for implementation of Bubble Sort 2 | class BubbleSort 3 | { 4 | void bubbleSort(int arr[]) 5 | { 6 | int n = arr.length; 7 | for (int i = 0; i < n-1; i++) 8 | for (int j = 0; j < n-i-1; j++) 9 | if (arr[j] > arr[j+1]) 10 | { 11 | // swap arr[j+1] and arr[i] 12 | int temp = arr[j]; 13 | arr[j] = arr[j+1]; 14 | arr[j+1] = temp; 15 | } 16 | } 17 | 18 | /* Prints the array */ 19 | void printArray(int arr[]) 20 | { 21 | int n = arr.length; 22 | for (int i=0; i 2 | // Java program for implementation of Bubble Sort 3 | class BubbleSort 4 | { 5 | void bubbleSort(int arr[]) 6 | { 7 | int n = arr.length; 8 | for (int i = 0; i < n-1; i++) 9 | for (int j = 0; j < n-i-1; j++) 10 | if (arr[j] > arr[j+1]) 11 | { 12 | // swap arr[j+1] and arr[i] 13 | int temp = arr[j]; 14 | arr[j] = arr[j+1]; 15 | arr[j+1] = temp; 16 | } 17 | } 18 | 19 | /* Prints the array */ 20 | void printArray(int arr[]) 21 | { 22 | int n = arr.length; 23 | for (int i=0; i<n; ++i) 24 | System.out.print(arr[i] + " "); 25 | System.out.println(); 26 | } 27 | 28 | // Driver method to test above 29 | public static void main(String args[]) 30 | { 31 | BubbleSort ob = new BubbleSort(); 32 | int arr[] = {64, 34, 25, 12, 22, 11, 90}; 33 | ob.bubbleSort(arr); 34 | System.out.println("Sorted array"); 35 | ob.printArray(arr); 36 | } 37 | } 38 | /* This code is contributed by Rajat Mishra */ 39 | -------------------------------------------------------------------------------- /sample_files/Java/dummy.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdqnghi/graph-ast/68dc3fce26ae1f1775fbf0445d33b152ded4153a/sample_files/Java/dummy.txt -------------------------------------------------------------------------------- /traverse_tree_sample.py: -------------------------------------------------------------------------------- 1 | import pickle 2 | import sys 3 | 4 | file_path = "sample_files/Java/Bubblesort.pkl" 5 | 6 | def load_pickle(path): 7 | """Builds an AST from a script.""" 8 | 9 | with open(path, 'rb') as file_handler: 10 | tree = pickle.load(file_handler) 11 | 12 | return tree 13 | return None 14 | # return ast.parse(script) 15 | 16 | 17 | def traverse_tree(root): 18 | num_nodes = 1 19 | queue = [root] 20 | 21 | root_json = { 22 | "node": str(root.kind), 23 | 24 | "children": [] 25 | } 26 | queue_json = [root_json] 27 | while queue: 28 | 29 | current_node = queue.pop(0) 30 | num_nodes += 1 31 | # print (_name(current_node)) 32 | current_node_json = queue_json.pop(0) 33 | 34 | 35 | children = [x for x in current_node.child] 36 | queue.extend(children) 37 | 38 | for child in children: 39 | print(child) 40 | # print "##################" 41 | #print child.kind 42 | 43 | child_json = { 44 | "node": str(child.kind), 45 | "children": [] 46 | } 47 | 48 | current_node_json['children'].append(child_json) 49 | queue_json.append(child_json) 50 | # print current_node_json 51 | 52 | return root_json, num_nodes 53 | 54 | data = load_pickle(file_path) 55 | print(data) 56 | # root = data.element 57 | # traverse_tree(root) -------------------------------------------------------------------------------- /types/edge_types.tsv: -------------------------------------------------------------------------------- 1 | PARENT_CHILD_EDGE = 0 2 | NEXT_TOKEN_EDGE = 1 3 | LAST_LEXICAL_USE_EDGE = 2 4 | LAST_USE_EDGE = 3 5 | LAST_WRITE_EDGE = 4 6 | RETURN_TO_EDGE = 5 7 | COMPUTE_FROM_EDGE = 6 -------------------------------------------------------------------------------- /types/srcml_node_types.tsv: -------------------------------------------------------------------------------- 1 | UNIT_KIND = 0 2 | DECL = 1 3 | DECL_STMT = 2 4 | INIT = 3 5 | EXPR = 4 6 | EXPR_STMT = 5 7 | COMMENT = 6 8 | CALL = 7 9 | CONTROL = 8 10 | INCR = 9 11 | NONE = 10 12 | VARIABLE = 11 13 | FUNCTION = 12 14 | FUNCTION_DECL = 13 15 | CONSTRUCTOR = 14 16 | CONSTRUCTOR_DECL = 15 17 | DESTRUCTOR = 16 18 | DESTRUCTOR_DECL = 17 19 | MACRO = 18 20 | SINGLE_MACRO = 19 21 | NULLOPERATOR = 20 22 | ENUM_DEFN = 21 23 | ENUM_DECL = 22 24 | GLOBAL_ATTRIBUTE = 23 25 | PROPERTY_ACCESSOR = 24 26 | PROPERTY_ACCESSOR_DECL = 25 27 | EXPRESSION = 26 28 | CLASS_DEFN = 27 29 | CLASS_DECL = 28 30 | UNION_DEFN = 29 31 | UNION_DECL = 30 32 | STRUCT_DEFN = 31 33 | STRUCT_DECL = 32 34 | INTERFACE_DEFN = 33 35 | INTERFACE_DECL = 34 36 | ACCESS_REGION = 35 37 | USING = 36 38 | OPERATOR_FUNCTION = 37 39 | OPERATOR_FUNCTION_DECL = 38 40 | EVENT = 39 41 | PROPERTY = 40 42 | ANNOTATION_DEFN = 41 43 | GLOBAL_TEMPLATE = 42 44 | UNIT = 43 45 | TART_ELEMENT_TOKEN = 44 46 | NOP = 45 47 | STRING = 46 48 | CHAR = 47 49 | LITERAL = 48 50 | BOOLEAN = 49 51 | NULL = 50 52 | COMPLEX = 51 53 | OPERATOR = 52 54 | MODIFIER = 53 55 | NAME = 54 56 | ONAME = 55 57 | CNAME = 56 58 | TYPE = 57 59 | TYPEPREV = 58 60 | CONDITION = 59 61 | BLOCK = 60 62 | PSEUDO_BLOCK = 61 63 | INDEX = 62 64 | ENUM = 63 65 | ENUM_DECLARATION = 64 66 | IF_STATEMENT = 65 67 | TERNARY = 66 68 | THEN = 67 69 | ELSE = 68 70 | ELSEIF = 69 71 | WHILE_STATEMENT = 70 72 | DO_STATEMENT = 71 73 | FOR_STATEMENT = 72 74 | FOREACH_STATEMENT = 73 75 | FOR_CONTROL = 74 76 | FOR_INITIALIZATION = 75 77 | FOR_CONDITION = 76 78 | FOR_INCREMENT = 77 79 | FOR_LIKE_CONTROL = 78 80 | EXPRESSION_STATEMENT = 79 81 | FUNCTION_CALL = 80 82 | DECLARATION_STATEMENT = 81 83 | DECLARATION = 82 84 | DECLARATION_INITIALIZATION = 83 85 | DECLARATION_RANGE = 84 86 | RANGE = 85 87 | GOTO_STATEMENT = 86 88 | CONTINUE_STATEMENT = 87 89 | BREAK_STATEMENT = 88 90 | LABEL_STATEMENT = 89 91 | LABEL = 90 92 | SWITCH = 91 93 | CASE = 92 94 | DEFAULT = 93 95 | FUNCTION_DEFINITION = 94 96 | FUNCTION_DECLARATION = 95 97 | LAMBDA = 96 98 | FUNCTION_LAMBDA = 97 99 | FUNCTION_SPECIFIER = 98 100 | RETURN_STATEMENT = 99 101 | PARAMETER_LIST = 100 102 | PARAMETER = 101 103 | KRPARAMETER_LIST = 102 104 | KRPARAMETER = 103 105 | ARGUMENT_LIST = 104 106 | ARGUMENT = 105 107 | PSEUDO_PARAMETER_LIST = 106 108 | INDEXER_PARAMETER_LIST = 107 109 | CLASS = 108 110 | CLASS_DECLARATION = 109 111 | STRUCT = 110 112 | STRUCT_DECLARATION = 111 113 | UNION = 112 114 | UNION_DECLARATION = 113 115 | DERIVATION_LIST = 114 116 | PUBLIC_ACCESS = 115 117 | PUBLIC_ACCESS_DEFAULT = 116 118 | PRIVATE_ACCESS = 117 119 | PRIVATE_ACCESS_DEFAULT = 118 120 | PROTECTED_ACCESS = 119 121 | PROTECTED_ACCESS_DEFAULT = 120 122 | MEMBER_INIT_LIST = 121 123 | MEMBER_INITIALIZATION_LIST = 122 124 | MEMBER_INITIALIZATION = 123 125 | CONSTRUCTOR_DEFINITION = 124 126 | CONSTRUCTOR_DECLARATION = 125 127 | DESTRUCTOR_DEFINITION = 126 128 | DESTRUCTOR_DECLARATION = 127 129 | FRIEND = 128 130 | CLASS_SPECIFIER = 129 131 | TRY_BLOCK = 130 132 | CATCH_BLOCK = 131 133 | FINALLY_BLOCK = 132 134 | THROW_STATEMENT = 133 135 | THROW_SPECIFIER = 134 136 | THROW_SPECIFIER_JAVA = 135 137 | TEMPLATE = 136 138 | GENERIC_ARGUMENT = 137 139 | GENERIC_ARGUMENT_LIST = 138 140 | TEMPLATE_PARAMETER = 139 141 | TEMPLATE_PARAMETER_LIST = 140 142 | GENERIC_PARAMETER = 141 143 | GENERIC_PARAMETER_LIST = 142 144 | TYPEDEF = 143 145 | ASM = 144 146 | MACRO_CALL = 145 147 | SIZEOF_CALL = 146 148 | EXTERN = 147 149 | NAMESPACE = 148 150 | USING_DIRECTIVE = 149 151 | DIRECTIVE = 150 152 | ATOMIC = 151 153 | STATIC_ASSERT_STATEMENT = 152 154 | GENERIC_SELECTION = 153 155 | GENERIC_SELECTOR = 154 156 | GENERIC_ASSOCIATION_LIST = 155 157 | GENERIC_ASSOCIATION = 156 158 | ALIGNAS = 157 159 | DECLTYPE = 158 160 | CAPTURE = 159 161 | LAMBDA_CAPTURE = 160 162 | NOEXCEPT = 161 163 | TYPENAME = 162 164 | ALIGNOF = 163 165 | TYPEID = 164 166 | SIZEOF_PACK = 165 167 | ENUM_CLASS = 166 168 | ENUM_CLASS_DECLARATION = 167 169 | REF_QUALIFIER = 168 170 | SIGNAL_ACCESS = 169 171 | FOREVER_STATEMENT = 170 172 | EMIT_STATEMENT = 171 173 | CPP_DIRECTIVE = 172 174 | CPP_FILENAME = 173 175 | FILE = 174 176 | NUMBER = 175 177 | CPP_NUMBER = 176 178 | CPP_LITERAL = 177 179 | CPP_MACRO_DEFN = 178 180 | CPP_MACRO_VALUE = 179 181 | ERROR = 180 182 | CPP_ERROR = 181 183 | CPP_WARNING = 182 184 | CPP_PRAGMA = 183 185 | CPP_INCLUDE = 184 186 | CPP_DEFINE = 185 187 | CPP_UNDEF = 186 188 | CPP_LINE = 187 189 | CPP_IF = 188 190 | CPP_IFDEF = 189 191 | CPP_IFNDEF = 190 192 | CPP_THEN = 191 193 | CPP_ELSE = 192 194 | CPP_ELIF = 193 195 | CPP_EMPTY = 194 196 | CPP_REGION = 195 197 | CPP_ENDREGION = 196 198 | USING_STMT = 197 199 | ESCAPE = 198 200 | VALUE = 199 201 | CPP_IMPORT = 200 202 | CPP_ENDIF = 201 203 | MARKER = 202 204 | ERROR_PARSE = 203 205 | ERROR_MODE = 204 206 | IMPLEMENTS = 205 207 | EXTENDS = 206 208 | IMPORT = 207 209 | PACKAGE = 208 210 | ASSERT_STATEMENT = 209 211 | INTERFACE = 210 212 | INTERFACE_DECLARATION = 211 213 | SYNCHRONIZED_STATEMENT = 212 214 | ANNOTATION = 213 215 | STATIC_BLOCK = 214 216 | CHECKED_STATEMENT = 215 217 | UNCHECKED_STATEMENT = 216 218 | ATTRIBUTE = 217 219 | TARGET = 218 220 | UNSAFE_STATEMENT = 219 221 | LOCK_STATEMENT = 220 222 | FIXED_STATEMENT = 221 223 | TYPEOF = 222 224 | USING_STATEMENT = 223 225 | FUNCTION_DELEGATE = 224 226 | CONSTRAINT = 225 227 | LINQ = 226 228 | FROM = 227 229 | WHERE = 228 230 | SELECT = 229 231 | LET = 230 232 | ORDERBY = 231 233 | JOIN = 232 234 | GROUP = 233 235 | IN = 234 236 | ON = 235 237 | EQUALS = 236 238 | BY = 237 239 | INTO = 238 240 | EMPTY = 239 241 | EMPTY_STMT = 240 242 | RECEIVER = 241 243 | MESSAGE = 242 244 | SELECTOR = 243 245 | PROTOCOL_LIST = 244 246 | CATEGORY = 245 247 | PROTOCOL = 246 248 | REQUIRED_DEFAULT = 247 249 | REQUIRED = 248 250 | OPTIONAL = 249 251 | ATTRIBUTE_LIST = 250 252 | SYNTHESIZE = 251 253 | DYNAMIC = 252 254 | ENCODE = 253 255 | AUTORELEASEPOOL = 254 256 | COMPATIBILITY_ALIAS = 255 257 | NIL = 256 258 | CLASS_INTERFACE = 257 259 | CLASS_IMPLEMENTATION = 258 260 | PROTOCOL_DECLARATION = 259 261 | CAST = 260 262 | CONST_CAST = 261 263 | DYNAMIC_CAST = 262 264 | REINTERPRET_CAST = 263 265 | STATIC_CAST = 264 266 | POSITION = 265 267 | CUDA_ARGUMENT_LIST = 266 268 | OMP_DIRECTIVE = 267 269 | OMP_NAME = 268 270 | OMP_CLAUSE = 269 271 | OMP_ARGUMENT_LIST = 270 272 | OMP_ARGUMENT = 271 273 | OMP_EXPRESSION = 272 274 | END_ELEMENT_TOKEN = 273 275 | MAIN = 274 276 | BREAK = 275 277 | CONTINUE = 276 278 | WHILE = 277 279 | DO = 278 280 | FOR = 279 281 | IF = 280 282 | GOTO = 281 283 | VISUAL_CXX_ASM = 282 284 | SIZEOF = 283 285 | AUTO = 284 286 | REGISTER = 285 287 | RESTRICT = 286 288 | IMAGINARY = 287 289 | NORETURN = 288 290 | STATIC_ASSERT = 289 291 | CRESTRICT = 290 292 | CXX_TRY = 291 293 | CXX_CATCH = 292 294 | CXX_CLASS = 293 295 | CONSTEXPR = 294 296 | THREAD_LOCAL = 295 297 | NULLPTR = 296 298 | VOID = 297 299 | RETURN = 298 300 | INCLUDE = 299 301 | DEFINE = 300 302 | ELIF = 301 303 | ENDIF = 302 304 | ERRORPREC = 303 305 | WARNING = 304 306 | IFDEF = 305 307 | IFNDEF = 306 308 | LINE = 307 309 | PRAGMA = 308 310 | UNDEF = 309 311 | INLINE = 310 312 | MACRO_TYPE_NAME = 311 313 | MACRO_CASE = 312 314 | MACRO_LABEL = 313 315 | SPECIFIER = 314 316 | TRY = 315 317 | CATCH = 316 318 | THROW = 317 319 | THROWS = 318 320 | PUBLIC = 319 321 | PRIVATE = 320 322 | PROTECTED = 321 323 | VIRTUAL = 322 324 | EXPLICIT = 323 325 | FOREVER = 324 326 | SIGNAL = 325 327 | EMIT = 326 328 | NEW = 327 329 | DELETE = 328 330 | STATIC = 329 331 | CONST = 330 332 | MUTABLE = 331 333 | VOLATILE = 332 334 | TRANSIENT = 333 335 | FINALLY = 334 336 | FINAL = 335 337 | ABSTRACT = 336 338 | SUPER = 337 339 | SYNCHRONIZED = 338 340 | NATIVE = 339 341 | STRICTFP = 340 342 | NULLLITERAL = 341 343 | ASSERT = 342 344 | FOREACH = 343 345 | REF = 344 346 | OUT = 345 347 | LOCK = 346 348 | IS = 347 349 | INTERNAL = 348 350 | SEALED = 349 351 | OVERRIDE = 350 352 | IMPLICIT = 351 353 | STACKALLOC = 352 354 | AS = 353 355 | DELEGATE = 354 356 | FIXED = 355 357 | CHECKED = 356 358 | UNCHECKED = 357 359 | REGION = 358 360 | ENDREGION = 359 361 | UNSAFE = 360 362 | READONLY = 361 363 | GET = 362 364 | SET = 363 365 | ADD = 364 366 | REMOVE = 365 367 | YIELD = 366 368 | PARTIAL = 367 369 | AWAIT = 368 370 | ASYNC = 369 371 | THIS = 370 372 | PARAMS = 371 373 | ALIAS = 372 374 | ASCENDING = 373 375 | DESCENDING = 374 376 | ATINTERFACE = 375 377 | ATIMPLEMENTATION = 376 378 | ATEND = 377 379 | ATPROTOCOL = 378 380 | ATREQUIRED = 379 381 | ATOPTIONAL = 380 382 | ATCLASS = 381 383 | WEAK = 382 384 | STRONG = 383 385 | OMP_OMP = 384 386 | SPECIAL_CHARS = 385 387 | SLICE_DEFINE = 386 388 | SLICE_USE = 387 389 | --------------------------------------------------------------------------------