{
"type": "Program",
"statements": [
{
"type": "ClassDeclaration",
"definition": {
"id": {
"type": "Identifier",
"name": "ETSGLOBAL",
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "switch.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "switch.ets"
}
}
},
"superClass": null,
"implements": [],
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "main",
"loc": {
"start": {
"line": 17,
"column": 10,
"program": "switch.ets"
},
"end": {
"line": 17,
"column": 14,
"program": "switch.ets"
}
}
},
"kind": "method",
"accessibility": "public",
"static": true,
"optional": false,
"computed": false,
"value": {
"type": "FunctionExpression",
"function": {
"type": "ScriptFunction",
"id": {
"type": "Identifier",
"name": "main",
"loc": {
"start": {
"line": 17,
"column": 10,
"program": "switch.ets"
},
"end": {
"line": 17,
"column": 14,
"program": "switch.ets"
}
}
},
"generator": false,
"async": false,
"expression": false,
"params": [],
"returnType": {
"type": "ETSPrimitiveType",
"loc": {
"start": {
"line": 17,
"column": 18,
"program": "switch.ets"
},
"end": {
"line": 17,
"column": 22,
"program": "switch.ets"
}
}
},
"body": {
"type": "BlockStatement",
"statements": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "value",
"typeAnnotation": {
"type": "ETSTypeReference",
"part": {
"type": "ETSTypeReferencePart",
"name": {
"type": "Identifier",
"name": "String",
"loc": {
"start": {
"line": 18,
"column": 13,
"program": "switch.ets"
},
"end": {
"line": 18,
"column": 19,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 18,
"column": 13,
"program": "switch.ets"
},
"end": {
"line": 18,
"column": 19,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 18,
"column": 13,
"program": "switch.ets"
},
"end": {
"line": 18,
"column": 19,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 18,
"column": 6,
"program": "switch.ets"
},
"end": {
"line": 18,
"column": 11,
"program": "switch.ets"
}
}
},
"init": {
"type": "StringLiteral",
"value": "10",
"loc": {
"start": {
"line": 18,
"column": 22,
"program": "switch.ets"
},
"end": {
"line": 18,
"column": 26,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 18,
"column": 6,
"program": "switch.ets"
},
"end": {
"line": 18,
"column": 26,
"program": "switch.ets"
}
}
}
],
"kind": "let",
"loc": {
"start": {
"line": 18,
"column": 2,
"program": "switch.ets"
},
"end": {
"line": 18,
"column": 27,
"program": "switch.ets"
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "result",
"typeAnnotation": {
"type": "ETSTypeReference",
"part": {
"type": "ETSTypeReferencePart",
"name": {
"type": "Identifier",
"name": "String",
"loc": {
"start": {
"line": 19,
"column": 14,
"program": "switch.ets"
},
"end": {
"line": 19,
"column": 20,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 19,
"column": 14,
"program": "switch.ets"
},
"end": {
"line": 19,
"column": 20,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 19,
"column": 14,
"program": "switch.ets"
},
"end": {
"line": 19,
"column": 20,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 19,
"column": 6,
"program": "switch.ets"
},
"end": {
"line": 19,
"column": 12,
"program": "switch.ets"
}
}
},
"init": null,
"loc": {
"start": {
"line": 19,
"column": 6,
"program": "switch.ets"
},
"end": {
"line": 19,
"column": 12,
"program": "switch.ets"
}
}
}
],
"kind": "let",
"loc": {
"start": {
"line": 19,
"column": 2,
"program": "switch.ets"
},
"end": {
"line": 19,
"column": 21,
"program": "switch.ets"
}
}
},
{
"type": "SwitchStatement",
"discriminant": {
"type": "Identifier",
"name": "value",
"loc": {
"start": {
"line": 20,
"column": 10,
"program": "switch.ets"
},
"end": {
"line": 20,
"column": 15,
"program": "switch.ets"
}
}
},
"cases": [
{
"type": "SwitchCase",
"test": {
"type": "StringLiteral",
"value": "0",
"loc": {
"start": {
"line": 21,
"column": 8,
"program": "switch.ets"
},
"end": {
"line": 21,
"column": 11,
"program": "switch.ets"
}
}
},
"consequent": [],
"loc": {
"start": {
"line": 21,
"column": 3,
"program": "switch.ets"
},
"end": {
"line": 21,
"column": 12,
"program": "switch.ets"
}
}
},
{
"type": "SwitchCase",
"test": {
"type": "StringLiteral",
"value": "1",
"loc": {
"start": {
"line": 22,
"column": 8,
"program": "switch.ets"
},
"end": {
"line": 22,
"column": 11,
"program": "switch.ets"
}
}
},
"consequent": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "Identifier",
"name": "result",
"loc": {
"start": {
"line": 23,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 23,
"column": 10,
"program": "switch.ets"
}
}
},
"right": {
"type": "StringLiteral",
"value": "One or zero",
"loc": {
"start": {
"line": 23,
"column": 13,
"program": "switch.ets"
},
"end": {
"line": 23,
"column": 26,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 23,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 23,
"column": 26,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 23,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 23,
"column": 27,
"program": "switch.ets"
}
}
},
{
"type": "BreakStatement",
"label": null,
"loc": {
"start": {
"line": 24,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 24,
"column": 10,
"program": "switch.ets"
}
}
}
],
"loc": {
"start": {
"line": 22,
"column": 3,
"program": "switch.ets"
},
"end": {
"line": 24,
"column": 10,
"program": "switch.ets"
}
}
},
{
"type": "SwitchCase",
"test": {
"type": "StringLiteral",
"value": "2",
"loc": {
"start": {
"line": 25,
"column": 8,
"program": "switch.ets"
},
"end": {
"line": 25,
"column": 11,
"program": "switch.ets"
}
}
},
"consequent": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "Identifier",
"name": "result",
"loc": {
"start": {
"line": 26,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 26,
"column": 10,
"program": "switch.ets"
}
}
},
"right": {
"type": "StringLiteral",
"value": "Two",
"loc": {
"start": {
"line": 26,
"column": 13,
"program": "switch.ets"
},
"end": {
"line": 26,
"column": 18,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 26,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 26,
"column": 18,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 26,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 26,
"column": 19,
"program": "switch.ets"
}
}
},
{
"type": "BreakStatement",
"label": null,
"loc": {
"start": {
"line": 27,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 27,
"column": 10,
"program": "switch.ets"
}
}
}
],
"loc": {
"start": {
"line": 25,
"column": 3,
"program": "switch.ets"
},
"end": {
"line": 27,
"column": 10,
"program": "switch.ets"
}
}
},
{
"type": "SwitchCase",
"test": null,
"consequent": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "Identifier",
"name": "result",
"loc": {
"start": {
"line": 29,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 29,
"column": 10,
"program": "switch.ets"
}
}
},
"right": {
"type": "StringLiteral",
"value": "An unknown value",
"loc": {
"start": {
"line": 29,
"column": 13,
"program": "switch.ets"
},
"end": {
"line": 29,
"column": 31,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 29,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 29,
"column": 31,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 29,
"column": 4,
"program": "switch.ets"
},
"end": {
"line": 29,
"column": 32,
"program": "switch.ets"
}
}
}
],
"loc": {
"start": {
"line": 28,
"column": 3,
"program": "switch.ets"
},
"end": {
"line": 29,
"column": 32,
"program": "switch.ets"
}
}
}
],
"loc": {
"start": {
"line": 20,
"column": 2,
"program": "switch.ets"
},
"end": {
"line": 30,
"column": 3,
"program": "switch.ets"
}
}
}
],
"loc": {
"start": {
"line": 17,
"column": 23,
"program": "switch.ets"
},
"end": {
"line": 31,
"column": 2,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 17,
"column": 10,
"program": "switch.ets"
},
"end": {
"line": 31,
"column": 2,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 17,
"column": 10,
"program": "switch.ets"
},
"end": {
"line": 31,
"column": 2,
"program": "switch.ets"
}
}
},
"overloads": [],
"loc": {
"start": {
"line": 17,
"column": 1,
"program": "switch.ets"
},
"end": {
"line": 31,
"column": 2,
"program": "switch.ets"
}
}
}
],
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "switch.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "switch.ets"
}
}
},
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "switch.ets"
},
"end": {
"line": 1,
"column": 1,
"program": "switch.ets"
}
}
}
],
"loc": {
"start": {
"line": 1,
"column": 1,
"program": "switch.ets"
},
"end": {
"line": 32,
"column": 1,
"program": "switch.ets"
}
}
}