Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "JCompilationUnit:1":
- {
- "source": "project3/BasicTypesWithRef.java",
- "imports": ["java.lang.Double", "java.lang.Integer", "java.lang.Math", "java.lang.System"],
- "JClassDeclaration:6":
- {
- "modifiers": ["public"],
- "name": "BasicTypes",
- "super": "java.lang.Object",
- "JMethodDeclaration:7":
- {
- "modifiers": ["private", "static"],
- "returnType": "void",
- "name": "compute",
- "parameters": [["a", "double"], ["b", "double"], ["c", "double"], ["n", "int"]],
- "JBlock:7":
- {
- "JStatementExpression:8":
- {
- "JMessageExpression:8":
- {
- "ambiguousPart": "null",
- "name": "quadratic",
- "Argument":
- {
- "JVariable:8":
- {
- "name": "a",
- "type": "null"
- }
- },
- "Argument":
- {
- "JVariable:8":
- {
- "name": "b",
- "type": "null"
- }
- },
- "Argument":
- {
- "JVariable:8":
- {
- "name": "c",
- "type": "null"
- }
- }
- }
- },
- "JStatementExpression:9":
- {
- "JMessageExpression:9":
- {
- "ambiguousPart": "System.out",
- "name": "println",
- "Argument":
- {
- "JBinaryExpression:9":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:9":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:9":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JLiteralString:9":
- {
- "type": "",
- "value": "fibonacci("
- }
- },
- "Operand2":
- {
- "JVariable:9":
- {
- "name": "n",
- "type": "null"
- }
- }
- }
- },
- "Operand2":
- {
- "JLiteralString:9":
- {
- "type": "",
- "value": ") = "
- }
- }
- }
- },
- "Operand2":
- {
- "JMessageExpression:9":
- {
- "ambiguousPart": "null",
- "name": "fibonacci",
- "Argument":
- {
- "JVariable:9":
- {
- "name": "n",
- "type": "null"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "JMethodDeclaration:12":
- {
- "modifiers": ["private", "static"],
- "returnType": "void",
- "name": "quadratic",
- "parameters": [["a", "double"], ["b", "double"], ["c", "double"]],
- "JBlock:12":
- {
- "JVariableDeclaration:13":
- {
- "JVariableDeclarator:13":
- {
- "name": "discriminant",
- "type": "double",
- "Initializer":
- {
- "JBinaryExpression:13":
- {
- "operator": "-",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:13":
- {
- "operator": "*",
- "type": "",
- "Operand1":
- {
- "JVariable:13":
- {
- "name": "b",
- "type": "null"
- }
- },
- "Operand2":
- {
- "JVariable:13":
- {
- "name": "b",
- "type": "null"
- }
- }
- }
- },
- "Operand2":
- {
- "JBinaryExpression:13":
- {
- "operator": "*",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:13":
- {
- "operator": "*",
- "type": "",
- "Operand1":
- {
- "JLiteralDouble:13":
- {
- "type": "",
- "value": "4.0"
- }
- },
- "Operand2":
- {
- "JVariable:13":
- {
- "name": "a",
- "type": "null"
- }
- }
- }
- },
- "Operand2":
- {
- "JVariable:13":
- {
- "name": "c",
- "type": "null"
- }
- }
- }
- }
- }
- }
- }
- },
- "JVariableDeclaration:14":
- {
- "JVariableDeclarator:14":
- {
- "name": "roots",
- "type": "double[]",
- "Initializer":
- {
- "JNewArrayOp:14":
- {
- "type": "",
- "Dimension":
- {
- "JLiteralInt:14":
- {
- "type": "",
- "value": "2"
- }
- }
- }
- }
- }
- },
- "JStatementExpression:15":
- {
- "JBinaryExpression:15":
- {
- "operator": "=",
- "type": "",
- "Operand1":
- {
- "JArrayExpression:15":
- {
- "TheArray":
- {
- "JVariable:15":
- {
- "name": "roots",
- "type": "null"
- }
- },
- "TheIndex":
- {
- "JLiteralInt:15":
- {
- "type": "",
- "value": "0"
- }
- }
- }
- },
- "Operand2":
- {
- "JBinaryExpression:15":
- {
- "operator": "/",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:15":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JUnaryExpression:15":
- {
- "operator": "-",
- "type": "",
- "Operand":
- {
- "JVariable:15":
- {
- "name": "b",
- "type": "null"
- }
- }
- }
- },
- "Operand2":
- {
- "JMessageExpression:15":
- {
- "ambiguousPart": "Math",
- "name": "sqrt",
- "Argument":
- {
- "JVariable:15":
- {
- "name": "discriminant",
- "type": "null"
- }
- }
- }
- }
- }
- },
- "Operand2":
- {
- "JBinaryExpression:15":
- {
- "operator": "*",
- "type": "",
- "Operand1":
- {
- "JLiteralDouble:15":
- {
- "type": "",
- "value": "2.0"
- }
- },
- "Operand2":
- {
- "JVariable:15":
- {
- "name": "a",
- "type": "null"
- }
- }
- }
- }
- }
- }
- }
- },
- "JStatementExpression:16":
- {
- "JBinaryExpression:16":
- {
- "operator": "=",
- "type": "",
- "Operand1":
- {
- "JArrayExpression:16":
- {
- "TheArray":
- {
- "JVariable:16":
- {
- "name": "roots",
- "type": "null"
- }
- },
- "TheIndex":
- {
- "JLiteralInt:16":
- {
- "type": "",
- "value": "1"
- }
- }
- }
- },
- "Operand2":
- {
- "JBinaryExpression:16":
- {
- "operator": "/",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:16":
- {
- "operator": "-",
- "type": "",
- "Operand1":
- {
- "JUnaryExpression:16":
- {
- "operator": "-",
- "type": "",
- "Operand":
- {
- "JVariable:16":
- {
- "name": "b",
- "type": "null"
- }
- }
- }
- },
- "Operand2":
- {
- "JMessageExpression:16":
- {
- "ambiguousPart": "Math",
- "name": "sqrt",
- "Argument":
- {
- "JVariable:16":
- {
- "name": "discriminant",
- "type": "null"
- }
- }
- }
- }
- }
- },
- "Operand2":
- {
- "JBinaryExpression:16":
- {
- "operator": "*",
- "type": "",
- "Operand1":
- {
- "JLiteralDouble:16":
- {
- "type": "",
- "value": "2.0"
- }
- },
- "Operand2":
- {
- "JVariable:16":
- {
- "name": "a",
- "type": "null"
- }
- }
- }
- }
- }
- }
- }
- },
- "JStatementExpression:17":
- {
- "JMessageExpression:17":
- {
- "ambiguousPart": "System.out",
- "name": "print",
- "Argument":
- {
- "JBinaryExpression:17":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:17":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:17":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:17":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:17":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JBinaryExpression:17":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JLiteralString:17":
- {
- "type": "",
- "value": "Roots of "
- }
- },
- "Operand2":
- {
- "JVariable:17":
- {
- "name": "a",
- "type": "null"
- }
- }
- }
- },
- "Operand2":
- {
- "JLiteralString:17":
- {
- "type": "",
- "value": "x^2 + "
- }
- }
- }
- },
- "Operand2":
- {
- "JVariable:17":
- {
- "name": "b",
- "type": "null"
- }
- }
- }
- },
- "Operand2":
- {
- "JLiteralString:17":
- {
- "type": "",
- "value": "x + "
- }
- }
- }
- },
- "Operand2":
- {
- "JVariable:17":
- {
- "name": "c",
- "type": "null"
- }
- }
- }
- },
- "Operand2":
- {
- "JLiteralString:17":
- {
- "type": "",
- "value": " = 0: "
- }
- }
- }
- }
- }
- },
- "JStatementExpression:18":
- {
- "JMessageExpression:18":
- {
- "ambiguousPart": "System.out",
- "name": "print",
- "Argument":
- {
- "JBinaryExpression:18":
- {
- "operator": "+",
- "type": "",
- "Operand1":
- {
- "JArrayExpression:18":
- {
- "TheArray":
- {
- "JVariable:18":
- {
- "name": "roots",
- "type": "null"
- }
- },
- "TheIndex":
- {
- "JLiteralInt:18":
- {
- "type": "",
- "value": "0"
- }
- }
- }
- },
- "Operand2":
- {
- "JLiteralString:18":
- {
- "type": "",
- "value": ", "
- }
- }
- }
- }
- }
- },
- "JStatementExpression:19":
- {
- "JMessageExpression:19":
- {
- "ambiguousPart": "System.out",
- "name": "println",
- "Argument":
- {
- "JArrayExpression:19":
- {
- "TheArray":
- {
- "JVariable:19":
- {
- "name": "roots",
- "type": "null"
- }
- },
- "TheIndex":
- {
- "JLiteralInt:19":
- {
- "type": "",
- "value": "1"
- }
- }
- }
- }
- }
- }
- }
- },
- "JMethodDeclaration:22":
- {
- "modifiers": ["private", "static"],
- "returnType": "long",
- "name": "fibonacci",
- "parameters": [["n", "int"]],
- "JBlock:22":
- {
- "JVariableDeclaration:23":
- {
- "JVariableDeclarator:23":
- {
- "name": "a",
- "type": "long",
- "Initializer":
- {
- "JLiteralLong:23":
- {
- "type": "",
- "value": "1L"
- }
- }
- },
- "JVariableDeclarator:23":
- {
- "name": "b",
- "type": "long",
- "Initializer":
- {
- "JLiteralLong:23":
- {
- "type": "",
- "value": "1L"
- }
- }
- }
- },
- "JVariableDeclaration:24":
- {
- "JVariableDeclarator:24":
- {
- "name": "i",
- "type": "int",
- "Initializer":
- {
- "JLiteralInt:24":
- {
- "type": "",
- "value": "3"
- }
- }
- }
- },
- "JWhileStatement:25":
- {
- "Condition":
- {
- "JBinaryExpression:25":
- {
- "operator": "<=",
- "type": "",
- "Operand1":
- {
- "JVariable:25":
- {
- "name": "i",
- "type": "null"
- }
- },
- "Operand2":
- {
- "JVariable:25":
- {
- "name": "n",
- "type": "null"
- }
- }
- }
- },
- "Body":
- {
- "JBlock:25":
- {
- "JVariableDeclaration:26":
- {
- "JVariableDeclarator:26":
- {
- "name": "temp",
- "type": "long",
- "Initializer":
- {
- "JVariable:26":
- {
- "name": "a",
- "type": "null"
- }
- }
- }
- },
- "JStatementExpression:27":
- {
- "JBinaryExpression:27":
- {
- "operator": "=",
- "type": "",
- "Operand1":
- {
- "JVariable:27":
- {
- "name": "a",
- "type": "null"
- }
- },
- "Operand2":
- {
- "JVariable:27":
- {
- "name": "b",
- "type": "null"
- }
- }
- }
- },
- "JStatementExpression:28":
- {
- "JBinaryExpression:28":
- {
- "operator": "+=",
- "type": "",
- "Operand1":
- {
- "JVariable:28":
- {
- "name": "b",
- "type": "null"
- }
- },
- "Operand2":
- {
- "JVariable:28":
- {
- "name": "temp",
- "type": "null"
- }
- }
- }
- },
- "JStatementExpression:29":
- {
- "JUnaryExpression:29":
- {
- "operator": "++ (pre)",
- "type": "",
- "Operand":
- {
- "JVariable:29":
- {
- "name": "i",
- "type": "null"
- }
- }
- }
- }
- }
- }
- },
- "JReturnStatement:31":
- {
- "Expression":
- {
- "JVariable:31":
- {
- "name": "b",
- "type": "null"
- }
- }
- }
- }
- },
- "JMethodDeclaration:34":
- {
- "modifiers": ["public", "static"],
- "returnType": "void",
- "name": "main",
- "parameters": [["args", "String[]"]],
- "JBlock:34":
- {
- "JVariableDeclaration:35":
- {
- "JVariableDeclarator:35":
- {
- "name": "a",
- "type": "double",
- "Initializer":
- {
- "JMessageExpression:35":
- {
- "ambiguousPart": "Double",
- "name": "parseDouble",
- "Argument":
- {
- "JArrayExpression:35":
- {
- "TheArray":
- {
- "JVariable:35":
- {
- "name": "args",
- "type": "null"
- }
- },
- "TheIndex":
- {
- "JLiteralInt:35":
- {
- "type": "",
- "value": "0"
- }
- }
- }
- }
- }
- }
- }
- },
- "JVariableDeclaration:36":
- {
- "JVariableDeclarator:36":
- {
- "name": "b",
- "type": "double",
- "Initializer":
- {
- "JMessageExpression:36":
- {
- "ambiguousPart": "Double",
- "name": "parseDouble",
- "Argument":
- {
- "JArrayExpression:36":
- {
- "TheArray":
- {
- "JVariable:36":
- {
- "name": "args",
- "type": "null"
- }
- },
- "TheIndex":
- {
- "JLiteralInt:36":
- {
- "type": "",
- "value": "1"
- }
- }
- }
- }
- }
- }
- }
- },
- "JVariableDeclaration:37":
- {
- "JVariableDeclarator:37":
- {
- "name": "c",
- "type": "double",
- "Initializer":
- {
- "JMessageExpression:37":
- {
- "ambiguousPart": "Double",
- "name": "parseDouble",
- "Argument":
- {
- "JArrayExpression:37":
- {
- "TheArray":
- {
- "JVariable:37":
- {
- "name": "args",
- "type": "null"
- }
- },
- "TheIndex":
- {
- "JLiteralInt:37":
- {
- "type": "",
- "value": "2"
- }
- }
- }
- }
- }
- }
- }
- },
- "JVariableDeclaration:38":
- {
- "JVariableDeclarator:38":
- {
- "name": "n",
- "type": "int",
- "Initializer":
- {
- "JMessageExpression:38":
- {
- "ambiguousPart": "Integer",
- "name": "parseInt",
- "Argument":
- {
- "JArrayExpression:38":
- {
- "TheArray":
- {
- "JVariable:38":
- {
- "name": "args",
- "type": "null"
- }
- },
- "TheIndex":
- {
- "JLiteralInt:38":
- {
- "type": "",
- "value": "3"
- }
- }
- }
- }
- }
- }
- }
- },
- "JStatementExpression:39":
- {
- "JMessageExpression:39":
- {
- "ambiguousPart": "null",
- "name": "compute",
- "Argument":
- {
- "JVariable:39":
- {
- "name": "a",
- "type": "null"
- }
- },
- "Argument":
- {
- "JVariable:39":
- {
- "name": "b",
- "type": "null"
- }
- },
- "Argument":
- {
- "JVariable:39":
- {
- "name": "c",
- "type": "null"
- }
- },
- "Argument":
- {
- "JVariable:39":
- {
- "name": "n",
- "type": "null"
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment