From f7336d75ed398fa9696efbc74fbbecc2233452f3 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Thu, 26 Apr 2018 15:52:16 -0500 Subject: [PATCH 1/8] Migrate TRUE() and FALSE() to true and false --- excellent/functions/functions_test.go | 2 +- legacy/expressions.go | 14 +- legacy/expressions_test.go | 79 +- legacy/testdata/legacy_tests.json | 1323 +++++++++++++++++++++++++ test/environment.go | 31 + test/session.go | 18 +- 6 files changed, 1436 insertions(+), 31 deletions(-) create mode 100644 legacy/testdata/legacy_tests.json create mode 100644 test/environment.go diff --git a/excellent/functions/functions_test.go b/excellent/functions/functions_test.go index b3c00c53d..4dea77298 100644 --- a/excellent/functions/functions_test.go +++ b/excellent/functions/functions_test.go @@ -448,7 +448,7 @@ var funcTests = []struct { } func TestFunctions(t *testing.T) { - env := test.NewTestEnvironment(utils.DateFormatDayMonthYear, time.UTC) + env := test.NewTestEnvironment(utils.DateFormatDayMonthYear, time.UTC, nil) utils.SetRand(utils.NewSeededRand(123456)) defer utils.SetRand(utils.DefaultRand) diff --git a/legacy/expressions.go b/legacy/expressions.go index 2c8e62f0d..ab9007028 100644 --- a/legacy/expressions.go +++ b/legacy/expressions.go @@ -528,6 +528,14 @@ func (v *legacyVisitor) VisitStringLiteral(ctx *gen.StringLiteralContext) interf // VisitFunctionCall deals with function calls like TITLE(foo.bar) func (v *legacyVisitor) VisitFunctionCall(ctx *gen.FunctionCallContext) interface{} { functionName := strings.ToLower(ctx.Fnname().GetText()) + + // these become keywords + if functionName == "true" { + return "true" + } else if functionName == "false" { + return "false" + } + template, found := functionTemplates[functionName] if !found { template = functionTemplate{name: functionName, params: "(%s)"} @@ -541,7 +549,7 @@ func (v *legacyVisitor) VisitFunctionCall(ctx *gen.FunctionCallContext) interfac if !ignored { _, found = functions.XFUNCTIONS[template.name] if !found { - return fmt.Errorf("No function with name '%s'", template.name) + return fmt.Errorf("no function with name '%s'", template.name) } } @@ -599,12 +607,12 @@ func (v *legacyVisitor) VisitFunctionCall(ctx *gen.FunctionCallContext) interfac // VisitTrue deals with the "true" literal func (v *legacyVisitor) VisitTrue(ctx *gen.TrueContext) interface{} { - return true + return "true" } // VisitFalse deals with the "false" literal func (v *legacyVisitor) VisitFalse(ctx *gen.FalseContext) interface{} { - return false + return "false" } // VisitArrayLookup deals with lookups such as foo[5] diff --git a/legacy/expressions_test.go b/legacy/expressions_test.go index 0edaae659..45b2bbaa7 100644 --- a/legacy/expressions_test.go +++ b/legacy/expressions_test.go @@ -1,9 +1,16 @@ -package legacy +package legacy_test import ( + "encoding/json" + "fmt" + "io/ioutil" "testing" + "time" + "github.com/nyaruka/goflow/excellent/types" + "github.com/nyaruka/goflow/legacy" "github.com/nyaruka/goflow/test" + "github.com/nyaruka/goflow/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -15,7 +22,7 @@ type testTemplate struct { old string new string - extraAs ExtraVarsMapping + extraAs legacy.ExtraVarsMapping } func TestMigrateTemplate(t *testing.T) { @@ -72,6 +79,12 @@ func TestMigrateTemplate(t *testing.T) { {old: `@(contact.gender)`, new: `@(contact.fields.gender)`}, {old: `@(flow.favorite_color)`, new: `@(run.results.favorite_color)`}, + // booleans + {old: `@(TRUE)`, new: `@(true)`}, + {old: `@(False)`, new: `@(false)`}, + {old: `@(TRUE())`, new: `@(true)`}, + {old: `@(FALSE())`, new: `@(false)`}, + // arithmetic {old: `@(1 + 2)`, new: `@(1 + 2)`}, {old: `@(1 - 2)`, new: `@(1 - 2)`}, @@ -141,10 +154,9 @@ func TestMigrateTemplate(t *testing.T) { {old: `@(YEAR(date.now))`, new: `@(format_datetime(now(), "YYYY"))`}, // booleans and conditionals - // TODO - //{old: `@(AND(contact.gender = "F", contact.age >= 18))`, new: `@(and(contact.fields.gender = "F", contact.fields.age >= 18))`}, - //{old: `@(IF(contact.gender = "M", "Sir", "Madam"))`, new: `@(if(contact.fields.gender = "M", "Sir", "Madam"))`}, - //{old: `@(OR(contact.state = "GA", contact.state = "WA", contact.state = "IN"))`, new: `@(or(contact.fields.state = "GA", contact.fields.state == "WA", contact.fields.state == "IN"))`}, + {old: `@(AND(contact.gender = "F", contact.age >= 18))`, new: `@(and(contact.fields.gender = "F", contact.fields.age >= 18))`}, + {old: `@(IF(contact.gender = "M", "Sir", "Madam"))`, new: `@(if(contact.fields.gender = "M", "Sir", "Madam"))`}, + {old: `@(OR(contact.gender = "M", contact.gender = "F", contact.gender = "NB"))`, new: `@(or(contact.fields.gender = "M", contact.fields.gender = "F", contact.fields.gender = "NB"))`}, // math functions {old: `@(ABS(-1))`, new: `@(abs(-1))`}, @@ -179,9 +191,9 @@ func TestMigrateTemplate(t *testing.T) { {old: `@(REPT("*", 10))`, new: `@(repeat("*", 10))`}, {old: `@((DATEDIF(DATEVALUE("1970-01-01"), date.now, "D") * 24 * 60 * 60) + ((((HOUR(date.now)+7) * 60) + MINUTE(date.now)) * 60))`, new: `@(legacy_add((datetime_diff(datetime("1970-01-01"), now(), "D") * 24 * 60 * 60), ((legacy_add(((legacy_add(format_datetime(now(), "h"), 7)) * 60), format_datetime(now(), "m"))) * 60)))`}, - {old: `@extra.results.0.state`, new: `@run.webhook.json.results.0.state`, extraAs: ExtraAsWebhookJSON}, - {old: `@extra.address.state`, new: `@trigger.params.address.state`, extraAs: ExtraAsTriggerParams}, - {old: `@extra.address.state`, new: `@(if(is_error(run.webhook.json.address.state), trigger.params.address.state, run.webhook.json.address.state))`, extraAs: ExtraAsFunction}, + {old: `@extra.results.0.state`, new: `@run.webhook.json.results.0.state`, extraAs: legacy.ExtraAsWebhookJSON}, + {old: `@extra.address.state`, new: `@trigger.params.address.state`, extraAs: legacy.ExtraAsTriggerParams}, + {old: `@extra.address.state`, new: `@(if(is_error(run.webhook.json.address.state), trigger.params.address.state, run.webhook.json.address.state))`, extraAs: legacy.ExtraAsFunction}, // non-expressions {old: `bob@nyaruka.com`, new: `bob@nyaruka.com`}, @@ -204,7 +216,7 @@ func TestMigrateTemplate(t *testing.T) { for _, test := range tests { for i := 0; i < 1; i++ { - migratedTemplate, err := MigrateTemplate(test.old, test.extraAs) + migratedTemplate, err := legacy.MigrateTemplate(test.old, test.extraAs) defer func() { if r := recover(); r != nil { @@ -223,3 +235,50 @@ func TestMigrateTemplate(t *testing.T) { } } } + +type legacyTestContext struct { + Variables json.RawMessage `json:"variables"` + Timezone string `json:"timezone"` + DateStyle string `json:"date_style"` + Now *time.Time `json:"now"` +} + +type legacyTest struct { + Template string `json:"template"` + Context legacyTestContext `json:"context"` + URLEncode bool `json:"url_encode"` + Output string `json:"output"` + Errors []string `json:"errors"` +} + +// TestLegacyTests runs the tests from https://github.com/rapidpro/expressions, migrating each template first +func TestLegacyTests(t *testing.T) { + legacyTestData, err := ioutil.ReadFile("testdata/legacy_tests.json") + require.NoError(t, err) + + var tests []legacyTest + err = json.Unmarshal(legacyTestData, &tests) + require.NoError(t, err) + + for _, tc := range tests { + migratedTemplate, err := legacy.MigrateTemplate(tc.Template, legacy.ExtraAsFunction) + + defer func() { + if r := recover(); r != nil { + t.Errorf("panic migrating template '%s': %#v", tc.Template, r) + } + }() + + assert.NoError(t, err, "error whilst migrating template '%s'", tc.Template) + + if err != nil { + variables := types.JSONToXValue(tc.Context.Variables) + tz, err := time.LoadLocation(tc.Context.Timezone) + require.NoError(t, err) + + env := test.NewTestEnvironment(utils.DateFormatDayMonthYear, tz, tc.Context.Now) + + fmt.Printf("TODO evaluate %s with vars %s and env %s", migratedTemplate, variables, env) + } + } +} diff --git a/legacy/testdata/legacy_tests.json b/legacy/testdata/legacy_tests.json new file mode 100644 index 000000000..856e3c369 --- /dev/null +++ b/legacy/testdata/legacy_tests.json @@ -0,0 +1,1323 @@ +[ + { + "template": "Hi Bob. Nice tests!", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "Hi Bob. Nice tests!", + "errors": [] + }, + { + "template": "My email is rowan@nyaruka.com.", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "My email is rowan@nyaruka.com.", + "errors": [] + }, + { + "template": "Twitter handle for Joe@Nyaruka is @@flow. @@@flow", + "context": { + "variables": { + "flow": "x" + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "Twitter handle for Joe@Nyaruka is @flow. @x", + "errors": [] + }, + { + "template": "@(TRUE) @( FALSE ) @(2) @(2.30) @(\"A\"\"a\")", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "TRUE FALSE 2 2.3 A\"a", + "errors": [] + }, + { + "template": "Hi @CONTACT @contact.name", + "context": { + "variables": { + "ConTact": { + "*": "Bob", + "NAME": "Bob" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "Hi Bob Bob", + "errors": [] + }, + { + "template": "Hi @(contact.name)", + "context": { + "variables": { + "contact": { + "*": "Bob", + "name": "Bob" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "Hi Bob", + "errors": [] + }, + { + "template": "Hi @flow.response_1.text", + "context": { + "variables": { + "flow": { + "response_1": { + "text": "Jim" + } + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "Hi Jim", + "errors": [] + }, + { + "template": "@(flow.X + flow.Y + flow.Z)", + "context": { + "variables": { + "flow": { + "x": 1.23, + "y": 2, + "z": "3" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "6.23", + "errors": [] + }, + { + "template": "Name: @contact", + "context": { + "variables": { + "contact": null + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "Name: ", + "errors": [] + }, + { + "template": "@extra", + "context": { + "variables": { + "extra": { + "color": "RED" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "{\"color\":\"RED\"}", + "errors": [] + }, + { + "template": "Answer is @(4 + 3 - 1 + -2 + 3 * 2)", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "Answer is 10", + "errors": [] + }, + { + "template": "@(100 / 3) @(2 * 100 / 3)", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "33.33333333 66.66666667", + "errors": [] + }, + { + "template": "@(contact.dob + 1) @(contact.dob - 3)", + "context": { + "variables": { + "contact": { + "dob": "01-12-2014" + } + }, + "timezone": "Africa/Kigali", + "date_style": "day_first" + }, + "url_encode": false, + "output": "02-12-2014 28-11-2014", + "errors": [] + }, + { + "template": "@(contact.joined + 1) @(contact.joined - 3)", + "context": { + "variables": { + "contact": { + "joined": "01-12-2014 09:00" + } + }, + "timezone": "Africa/Kigali", + "date_style": "day_first" + }, + "url_encode": false, + "output": "2014-12-02T09:00:00+02:00 2014-11-28T09:00:00+02:00", + "errors": [] + }, + { + "template": "@(DATE(2014, 7, 1) + 1) @(DATE(2014, 7, 1) - 3)", + "context": { + "variables": {}, + "timezone": "Africa/Kigali", + "date_style": "day_first" + }, + "url_encode": false, + "output": "02-07-2014 28-06-2014", + "errors": [] + }, + { + "template": "@(contact.joined + TIME(2, 30, 0)) @(contact.joined - TIME(2, 30, 0))", + "context": { + "variables": { + "contact": { + "joined": "01-12-2014 09:00" + } + }, + "timezone": "Africa/Kigali", + "date_style": "day_first" + }, + "url_encode": false, + "output": "2014-12-01T11:30:00+02:00 2014-12-01T06:30:00+02:00", + "errors": [] + }, + { + "template": "@(contact.joined + TIME(2, 30, 0)) @(contact.joined - TIME(2, 30, 0))", + "context": { + "variables": { + "contact": { + "joined": "01-12-2014" + } + }, + "timezone": "Africa/Kigali", + "date_style": "day_first" + }, + "url_encode": false, + "output": "2014-12-01T02:30:00+02:00 2014-11-30T21:30:00+02:00", + "errors": [] + }, + { + "template": "@(TRUE = TRUE) @(7 = 7) @(3.2 = 3.2) @(3.0 = 3) @(\"3\" = 3) @(\"3.0\" = 3.00) @(\"ab\" = \"ab\") @(date.d1 = date.d2)", + "context": { + "variables": { + "date": { + "d1": "14-08-2015 15:02", + "d2": "14-08-2015 15:02" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE", + "errors": [] + }, + { + "template": "@(TRUE = FALSE) @(7 = 8) @(3.2 = 2.6) @(\"3.0\" = \"3.00\") @(\"ab\" = \"cd\") @(date.d1 = date.d2)", + "context": { + "variables": { + "date": { + "d1": "14-08-2015 15:02", + "d2": "14-08-2015 15:03" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "FALSE FALSE FALSE FALSE FALSE FALSE", + "errors": [] + }, + { + "template": "@(TRUE <> FALSE) @(7 <> 8) @(3.2 <> 2.6) @(\"3.0\" <> \"3.00\") @(\"ab\" <> \"cd\") @(date.d1 <> date.d2)", + "context": { + "variables": { + "date": { + "d1": "14-08-2015 15:02", + "d2": "14-08-2015 15:03" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "TRUE TRUE TRUE TRUE TRUE TRUE", + "errors": [] + }, + { + "template": "@(TRUE <> TRUE) @(7 <> 7) @(3.2 <> 3.2) @(3.0 <> 3) @(\"3\" <> 3) @(\"3.0\" <> 3.00) @(\"ab\" <> \"AB\") @(date.d1 <> date.d2)", + "context": { + "variables": { + "date": { + "d1": "14-08-2015 15:02", + "d2": "14-08-2015 15:02" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE", + "errors": [] + }, + { + "template": "@(FALSE <= TRUE) @(TRUE <= TRUE) @(7 <= 7) @(7 <= 8) @(3.2 <= 3.2) @(3.0 <= 3) @(\"3\" <= 3) @(\"3.0\" <= 3.00) @(\"ab\" <= \"ab\") @(date.d1 <= date.d2)", + "context": { + "variables": { + "date": { + "d1": "14-08-2015 15:02", + "d2": "14-08-2015 15:03" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE", + "errors": [] + }, + { + "template": "@(TRUE <= FALSE) @(8 <= 7) @(3.3 <= 3.2) @(3.2 <= 3) @(\"4\" <= 3) @(\"3.2\" <= 3.00) @(\"ac\" <= \"ab\") @(date.d2 <= date.d1)", + "context": { + "variables": { + "date": { + "d1": "14-08-2015 15:02", + "d2": "14-08-2015 15:03" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE", + "errors": [] + }, + { + "template": "@(FALSE < TRUE) @(7 < 8) @(2.8 < 3) @(\"2.0\" < 3.00) @(\"ab\" < \"ac\") @(date.d1 < date.d2)", + "context": { + "variables": { + "date": { + "d1": "14-08-2015 15:02", + "d2": "14-08-2015 15:03" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "TRUE TRUE TRUE TRUE TRUE TRUE", + "errors": [] + }, + { + "template": "@(ABS(1)) @(ABS(-1))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 1", + "errors": [] + }, + { + "template": "@(AVERAGE(1)) @(AVERAGE(1, \"2\", 3)) @(AVERAGE(-1, -2))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 2 -1.5", + "errors": [] + }, + { + "template": "@(AND(1, true, \"true\")) @(AND(1, true, \"true\", 0))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "TRUE FALSE", + "errors": [] + }, + { + "template": "@(CHAR(9))@(CHAR(10))@(CHAR(32))@(char(65))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "\t\n A", + "errors": [] + }, + { + "template": "@(CLEAN(\"Hello \nwo\tr\rld\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "Hello world", + "errors": [] + }, + { + "template": "@(CODE(\"\t\")) @(CODE(\"\n\")) @(CODE(\"\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "9 10 @(CODE(\"\"))", + "errors": [ + "Error calling function CODE with arguments \"\"" + ] + }, + { + "template": "@(CONCATENATE(\"A\", 1, TRUE))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "A1TRUE", + "errors": [] + }, + { + "template": "@(DATE(1900, 1, 1)) @(DATE(2012, \"3\", 2.0))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "01-01-1900 02-03-2012", + "errors": [] + }, + { + "template": "@(DATEDIF(\"28/5/81\", \"23-11-15\", \"y\")) @(DATEDIF(\"1/1/2011\", \"31-12-2012\", \"Y\")) @(DATEDIF(\"20/9/14\", \"23/11/15\", \"m\")) @(DATEDIF(\"1/6/2001\", \"15/8/2002\", \"d\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "34 1 14 440", + "errors": [] + }, + { + "template": "@(DATEDIF(\"1/6/2001\", \"15/8/2002\", \"YD\")) @(DATEDIF(\"1/6/2001\", \"15/8/2002\", \"YM\")) @(DATEDIF(\"1/6/2001\", \"15/8/2002\", \"mD\")) @(DATEDIF(\"16/6/2001\", \"15/8/2002\", \"mD\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "75 2 14 30", + "errors": [] + }, + { + "template": "@(DATEVALUE(\"1/2/34\")) @(DATEVALUE(\"1-2-34\")) @(DATEVALUE(\"01 02 34\")) @(DATEVALUE(\"1 Feb 34\")) @(DATEVALUE(\"1. 2 '34\")) @(DATEVALUE(\"1st february 2034\")) @(DATEVALUE(\"1er février 2034\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "01-02-2034 01-02-2034 01-02-2034 01-02-2034 01-02-2034 01-02-2034 01-02-2034", + "errors": [] + }, + { + "template": "@(DATEVALUE(\"2/25-70\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "25-02-1970", + "errors": [] + }, + { + "template": "@(DATEVALUE(\"1 feb\")) @(DATEVALUE(\"Feb 1st\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first", + "now": "2016-02-01T13:08:12.790Z" + }, + "url_encode": false, + "output": "01-02-2017 01-02-2017", + "errors": [] + }, + { + "template": "@(DAY(\"10-9-2015\")) @(DAY(\"Feb 1st\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "10 1", + "errors": [] + }, + { + "template": "@(DAYS(\"15/3/11\", \"1/2/11\")) @(DAYS(flow.d1, flow.d2))", + "context": { + "variables": { + "flow": { + "d1": "2011-12-31T10:38:30.123456Z", + "d2": "1/1/2011" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "42 364", + "errors": [] + }, + { + "template": "@(EDATE(\"10-9-2015\", 1)) @(EDATE(\"Jan 1st 2014\", -1))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "10-10-2015 01-12-2013", + "errors": [] + }, + { + "template": "@(EXP(2))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "7.389056099", + "errors": [] + }, + { + "template": "@(FALSE())", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "FALSE", + "errors": [] + }, + { + "template": "@(FIELD(\"15+M+Seattle\", 1, \"+\"))|@(FIELD(\"15 M Seattle\", 2))|@(FIELD(\"15 M Seattle\", 3))|@(FIELD(\"15 M Seattle\", 4))|@(FIELD(\"واحد اثنين ثلاثة\", 2))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "15|M|Seattle||اثنين", + "errors": [] + }, + { + "template": "@(FIRST_WORD(\" \"))|@(FIRST_WORD(\" abc \"))|@(FIRST_WORD(\" abc def ghi\"))|@(FIRST_WORD(\"واحد اثنين ثلاثة\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "|abc|abc|واحد", + "errors": [] + }, + { + "template": "@(FIXED(1234.5678, 1)) @(FIXED(1234.5678, 2)) @(FIXED(1234.5678, 0)) @(FIXED(1234.5678, -1)) @(FIXED(1234.5678, -4)) @(FIXED(1234.1234, 2)) @(FIXED(1234.5678, 3, TRUE))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1,234.6 1,234.57 1,235 1,230 0 1,234.12 1234.568", + "errors": [] + }, + { + "template": "@(FORMAT_DATE(contact.joined)) @(FORMAT_DATE(contact.left))", + "context": { + "variables": { + "contact": { + "joined": "2017-11-30T08:59:12.1234567+02:00", + "left": "30-11-2017" + } + }, + "timezone": "Africa/Kigali", + "date_style": "day_first" + }, + "url_encode": false, + "output": "30-11-2017 08:59 30-11-2017 00:00", + "errors": [] + }, + { + "template": "@(FORMAT_LOCATION(contact.state)) @(FORMAT_LOCATION(contact.district))", + "context": { + "variables": { + "contact": { + "state": "Kigali", + "district": "Kigali > Gasabo" + } + }, + "timezone": "Africa/Kigali", + "date_style": "day_first" + }, + "url_encode": false, + "output": "Kigali Gasabo", + "errors": [] + }, + { + "template": "@(HOUR(\"10-9-2015 13:45:23\")) @(HOUR(\"Sep 9th 2:30PM\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "13 14", + "errors": [] + }, + { + "template": "@(IF(TRUE, 0, false)) @(IF(true, \"x\", \"y\")) @(IF(\"true\", \"x\", \"y\")) @(IF(False, 0, False)) @(IF(0, \"x\", \"y\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "0 x x FALSE y", + "errors": [] + }, + { + "template": "@(INT(8.9)) @(INT(-8.9))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "8 -9", + "errors": [] + }, + { + "template": "@(LEFT(\"abcdef\", 0))|@(LEFT(\"abcdef\", 2))|@(LEFT(\"واحد\", 2))|@(LEFT(\"err\", -1))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "|ab|وا|@(LEFT(\"err\", -1))", + "errors": [ + "Error calling function LEFT with arguments \"err\", -1" + ] + }, + { + "template": "@(LEN(\"\")) @(LEN(\" \")) @(LEN(\"qwérty\")) @(LEN(\"سلام\")) @(LEN(12345))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "0 1 6 4 5", + "errors": [] + }, + { + "template": "@(LOWER(\"\"))|@(LOWER(\"aBcD\"))|@(LOWER(\"Aواحد\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "|abcd|aواحد", + "errors": [] + }, + { + "template": "@(MAX(\"1\")) @(MAX(1, 3, 2, -5)) @(MAX(-2, -5))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 3 -2", + "errors": [] + }, + { + "template": "@(MIN(\"1\")) @(MIN(-1, -3, -2, 5)) @(MIN(-2, -5))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 -3 -5", + "errors": [] + }, + { + "template": "@(MINUTE(\"10-9-2015 13:45:23\")) @(MINUTE(\"Sep 10th 2:30PM\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "45 30", + "errors": [] + }, + { + "template": "@(MOD(3, 2)) @(MOD(-3, 2)) @(MOD(3, -2)) @(MOD(-3, -2)) @(MOD(3, 3)) @(MOD(2.5, 2))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 1 -1 -1 0 0.5", + "errors": [] + }, + { + "template": "@(MONTH(\"10-8-2015 13:45:23\")) @(MONTH(\"Sep 10th\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "8 9", + "errors": [] + }, + { + "template": "@(NOW())", + "context": { + "variables": {}, + "timezone": "Africa/Kigali", + "date_style": "day_first", + "now": "2014-10-03T09:41:12.790Z" + }, + "url_encode": false, + "output": "2014-10-03T11:41:12.790000+02:00", + "errors": [] + }, + { + "template": "@(PERCENT(\"0.25321\")) @(PERCENT(0.3333)) @(PERCENT(0.666666))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "25% 33% 67%", + "errors": [] + }, + { + "template": "@(POWER(\"4\", 2)) @(POWER(4, \"0.5\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "16 2", + "errors": [] + }, + { + "template": "@(OR(1, false, \"false\")) @(OR(0, false, \"FALSE\")) @(OR(0, true, \"false\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "TRUE FALSE TRUE", + "errors": [] + }, + { + "template": "@(PROPER(\"\"))|@(PROPER(\"f1rst sécOND-third_fourth\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "|F1Rst Sécond-Third_Fourth", + "errors": [] + }, + { + "template": "@(RAND())", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output_regex": "0.\\d+", + "errors": [] + }, + { + "template": "@(RANDBETWEEN(2, 4))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output_regex": "(2|3|4)", + "errors": [] + }, + { + "template": "@(READ_DIGITS(\"1234567890123456\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 2 3 4 , 5 6 7 8 , 9 0 1 2 , 3 4 5 6", + "errors": [] + }, + { + "template": "@(READ_DIGITS(\"+123456789012\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 2 3 , 4 5 6 , 7 8 9 , 0 1 2", + "errors": [] + }, + { + "template": "@(READ_DIGITS(\"123456789\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 2 3 , 4 5 , 6 7 8 9", + "errors": [] + }, + { + "template": "@(READ_DIGITS(\"123456\"))|@(READ_DIGITS(\"12345\"))|@(READ_DIGITS(\"123\"))|@(READ_DIGITS(\"\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 2 3 , 4 5 6|1,2,3,4,5|1,2,3|", + "errors": [] + }, + { + "template": "@(REMOVE_FIRST_WORD(\"\"))|@(REMOVE_FIRST_WORD(\"abc\"))|@(REMOVE_FIRST_WORD(\" abc \"))|@(REMOVE_FIRST_WORD(\" abc def-ghi \"))|@(REMOVE_FIRST_WORD(\"واحد اثنين ثلاثة\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "|||def-ghi |اثنين ثلاثة", + "errors": [] + }, + { + "template": "@(REPT(\"abc\", 3))|@(REPT(\"واحد\", 2))|@(REPT(\"err\", -1))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "abcabcabc|واحدواحد|@(REPT(\"err\", -1))", + "errors": [ + "Error calling function REPT with arguments \"err\", -1" + ] + }, + { + "template": "@(RIGHT(\"abcdef\", 0))|@(RIGHT(\"abcdef\", 2))|@(RIGHT(\"واحد\", 2))|@(RIGHT(\"err\", -1))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "|ef|حد|@(RIGHT(\"err\", -1))", + "errors": [ + "Error calling function RIGHT with arguments \"err\", -1" + ] + }, + { + "template": "@(ROUND(2.15, 1)) @(ROUND(2.149, 1)) @(ROUND(-1.475, 2)) @(ROUND(21.5, -1)) @(ROUND(626.3, -3)) @(ROUND(1.98, -1)) @(ROUND(-50.55, -2))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "2.2 2.1 -1.48 20 1000 0 -100", + "errors": [] + }, + { + "template": "@(ROUNDDOWN(3.2, 0)) @(ROUNDDOWN(76.9, 0)) @(ROUNDDOWN(3.14159, 3)) @(ROUNDDOWN(-3.14159, 1)) @(ROUNDDOWN(31415.92654, -2)) @(ROUNDDOWN(31499, -2))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "3 76 3.141 -3.1 31400 31400", + "errors": [] + }, + { + "template": "@(ROUNDUP(3.2, 0)) @(ROUNDUP(76.9, 0)) @(ROUNDUP(3.14159, 3)) @(ROUNDUP(-3.14159, 1)) @(ROUNDUP(31415.92654, -2)) @(ROUNDUP(31499, -2))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "4 77 3.142 -3.2 31500 31500", + "errors": [] + }, + { + "template": "@(SECOND(\"10-9-2015 13:45:23\")) @(SECOND(\"Sep 10th 2:30PM\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "23 0", + "errors": [] + }, + { + "template": "@(SUBSTITUTE(\"ab Ab cd\", \"ab\", \"xy\", -1))|@(SUBSTITUTE(\"ab ab cd\", \"ab\", \"xy\", -1))|@(SUBSTITUTE(\"ab ab cd\", \"ab\", \"xy\", 2))|@(SUBSTITUTE(\"واحد اثنين ثلاثة\", \"واحد\", \"ثلاثة\", -1))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "xy Ab cd|xy xy cd|ab xy cd|ثلاثة اثنين ثلاثة", + "errors": [] + }, + { + "template": "@(SUM(1)) @(SUM(1, 2, \"3\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "1 6", + "errors": [] + }, + { + "template": "@(TIME(\"13\", 45, 30))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "13:45", + "errors": [] + }, + { + "template": "@(TIMEVALUE(\"13:45.23\")) @(TIMEVALUE(\"1345\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "13:45 13:45", + "errors": [] + }, + { + "template": "@(TODAY())", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first", + "now": "2014-10-03T09:41:12.790Z" + }, + "url_encode": false, + "output": "03-10-2014", + "errors": [] + }, + { + "template": "@(TRUE())", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "TRUE", + "errors": [] + }, + { + "template": "@(TRUNC(8.9)) @(TRUNC(-8.9)) @(TRUNC(0.45))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "8 -8 0", + "errors": [] + }, + { + "template": "@(UNICHAR(9))@(UNICHAR(10))@(UNICHAR(32))@(UNICHAR(65))@(UNICHAR(1575))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "\t\n Aا", + "errors": [] + }, + { + "template": "@(UNICODE(\"\t\")) @(UNICODE(\"\n\")) @(UNICODE(\"ا\")) @(UNICODE(\"\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "9 10 1575 @(UNICODE(\"\"))", + "errors": [ + "Error calling function UNICODE with arguments \"\"" + ] + }, + { + "template": "@(UPPER(\"\"))|@(UPPER(\"aBcD\"))|@(UPPER(\"Aواحد\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "|ABCD|Aواحد", + "errors": [] + }, + { + "template": "@(WEEKDAY(date.d1)) @(WEEKDAY(date.d2))", + "context": { + "variables": { + "date": { + "d1": "15-08-2015", + "d2": "16-08-2015 13:45" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "7 1", + "errors": [] + }, + { + "template": "@(WORD(\" \", 1))|@(WORD(\" abc def ghi\", 1))|@(WORD(\"abc-def ghi jkl\", 3))|@(WORD(\"abc-def ghi jkl\", 3, TRUE))|@(WORD(\"abc-def ghi jkl\", \"3\", \"TRUE\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "|abc|ghi|jkl|jkl", + "errors": [] + }, + { + "template": "@(WORD(\"abc-def ghi jkl\", -1))|@(WORD(\" abc def ghi\", 6))|@(WORD(\"واحد اثنين ثلاثة\", 1))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "jkl||واحد", + "errors": [] + }, + { + "template": "@(WORD_COUNT(\"\")) @(WORD_COUNT(\" abc-def ghi jkl\")) @(WORD_COUNT(\" abc-def ghi jkl\", TRUE)) @(WORD_COUNT(\"واحد اثنين ثلاثة\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "0 4 3 3", + "errors": [] + }, + { + "template": "@(WORD_SLICE(\" abc def ghi-jkl \", 1, 3))|@(WORD_SLICE(\" abc def ghi-jkl \", 3))|@(WORD_SLICE(\" abc def ghi-jkl \", 3, 0, true))|@(WORD_SLICE(\" abc def ghi-jkl \", \"3\", \"0\", \"true\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "abc def|ghi jkl|ghi-jkl|ghi-jkl", + "errors": [] + }, + { + "template": "@(WORD_SLICE(\" abc def ghi-jkl \", 2, -1))|@(WORD_SLICE(\" abc def ghi-jkl \", -1, 0))|@(WORD_SLICE(\"واحد اثنين ثلاثة\", 1, 3))|@(WORD_SLICE(\" abc def ghi-jkl \", 0))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "def ghi|jkl|واحد اثنين|@(WORD_SLICE(\" abc def ghi-jkl \", 0))", + "errors": [ + "Error calling function WORD_SLICE with arguments \" abc def ghi-jkl \", 0" + ] + }, + { + "template": "@(YEAR(\"10-9-2015\")) @(YEAR(\"Feb 1st 99\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "2015 1999", + "errors": [] + }, + { + "template": "http://example.com/do.php?contact=@contact", + "context": { + "variables": { + "contact": { + "*": "Joe Flow" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": true, + "output": "http://example.com/do.php?contact=Joe%20Flow", + "errors": [] + }, + { + "template": "@(5 + (1 + )", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@(5 + (1 + )", + "errors": [] + }, + { + "template": "@(\")", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@(\")", + "errors": [] + }, + { + "template": "@SUM(1, 2)", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@SUM(1, 2)", + "errors": [] + }, + { + "template": "@contact.X", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@contact.X", + "errors": [ + "Undefined variable: contact.X" + ] + }, + { + "template": "@contact.name.something", + "context": { + "variables": { + "contact": { + "name": "Bob" + } + }, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@contact.name.something", + "errors": [ + "Undefined variable: contact.name.something" + ] + }, + { + "template": "@(FOO())", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@(FOO())", + "errors": [ + "Undefined function: FOO" + ] + }, + { + "template": "@(LEN())", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@(LEN())", + "errors": [ + "Too few arguments provided for function LEN" + ] + }, + { + "template": "@(LEN(\"a\", \"b\"))", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@(LEN(\"a\", \"b\"))", + "errors": [ + "Too many arguments provided for function LEN" + ] + }, + { + "template": "@('x')", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@('x')", + "errors": [ + "Expression error at: '" + ] + }, + { + "template": "@(0 / )", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@(0 / )", + "errors": [ + "Expression error at: )" + ] + }, + { + "template": "@(1.1.0)", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@(1.1.0)", + "errors": [ + "Expression is invalid" + ] + }, + { + "template": "@(2/ 0)", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@(2/ 0)", + "errors": [ + "Division by zero" + ] + }, + { + "template": "@(0 /0)", + "context": { + "variables": {}, + "timezone": "UTC", + "date_style": "day_first" + }, + "url_encode": false, + "output": "@(0 /0)", + "errors": [ + "Division by zero" + ] + } +] \ No newline at end of file diff --git a/test/environment.go b/test/environment.go new file mode 100644 index 000000000..8f3f3b406 --- /dev/null +++ b/test/environment.go @@ -0,0 +1,31 @@ +package test + +import ( + "time" + + "github.com/nyaruka/goflow/utils" +) + +// an extended environment that will let us override Now() so that it's constant +type testEnvironment struct { + utils.Environment + + now time.Time +} + +// NewTestEnvironment creates a new test environment +func NewTestEnvironment(dateFormat utils.DateFormat, tz *time.Location, now *time.Time) utils.Environment { + if now == nil { + t := time.Date(2018, 4, 11, 13, 24, 30, 123456000, tz) + now = &t + } + + return &testEnvironment{ + Environment: utils.NewEnvironment(dateFormat, utils.TimeFormatHourMinute, tz, utils.LanguageList{"eng", "spa"}), + now: *now, + } +} + +func (e *testEnvironment) Now() time.Time { + return e.now.In(e.Timezone()) +} diff --git a/test/session.go b/test/session.go index cadb7796e..0bb89038c 100644 --- a/test/session.go +++ b/test/session.go @@ -295,22 +295,6 @@ var initialEvents = `[ } ]` -// an extended environment that will let us override Now() so that it's constant -type testEnvironment struct { - utils.Environment -} - -// NewTestEnvironment creates a new test environment -func NewTestEnvironment(dateFormat utils.DateFormat, tz *time.Location) utils.Environment { - return &testEnvironment{ - utils.NewEnvironment(dateFormat, utils.TimeFormatHourMinute, tz, utils.LanguageList{"eng", "spa"}), - } -} - -func (e *testEnvironment) Now() time.Time { - return time.Date(2018, 4, 11, 13, 24, 30, 123456000, e.Timezone()) -} - // CreateTestSession creates an example session for testing func CreateTestSession(testServerPort int, actionToAdd flows.Action) (flows.Session, error) { // different tests different ports for the test HTTP server @@ -327,7 +311,7 @@ func CreateTestSession(testServerPort int, actionToAdd flows.Action) (flows.Sess // override the session environment tz, _ := time.LoadLocation("America/Guayaquil") - session.SetEnvironment(NewTestEnvironment(utils.DateFormatYearMonthDay, tz)) + session.SetEnvironment(NewTestEnvironment(utils.DateFormatYearMonthDay, tz, nil)) // optional modify the main flow by adding the provided action to the final empty node if actionToAdd != nil { From 9f5d05186dabb180dfff77978c5f4f5429cb7c9b Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Thu, 26 Apr 2018 16:06:40 -0500 Subject: [PATCH 2/8] Add a separate grammar for legacy expressions that supports <>, TRUE() etc --- antlr/.antlr/Excellent2Lexer.java | 252 -- antlr/.antlr/Excellent2Parser.java | 823 ------ antlr/.antlr/LexUnicode.interp | 24 - antlr/.antlr/LexUnicode.java | 190 -- antlr/.antlr/LexUnicode.tokens | 0 antlr/Excellent1.g4 | 74 + antlr/Excellent2.g4 | 5 +- excellent/gen/Excellent2.interp | 2 +- excellent/gen/excellent2_parser.go | 78 +- legacy/expressions.go | 10 +- legacy/expressions_test.go | 4 +- .../gen/Excellent1.interp | 2 +- .../gen/Excellent1.tokens | 2 +- .../gen/Excellent1Lexer.interp | 4 +- .../gen/Excellent1Lexer.tokens | 2 +- legacy/gen/excellent1_base_listener.go | 147 ++ legacy/gen/excellent1_base_visitor.go | 92 + legacy/gen/excellent1_lexer.go | 275 ++ legacy/gen/excellent1_listener.go | 135 + legacy/gen/excellent1_parser.go | 2220 +++++++++++++++++ legacy/gen/excellent1_visitor.go | 72 + 21 files changed, 3061 insertions(+), 1352 deletions(-) delete mode 100644 antlr/.antlr/Excellent2Lexer.java delete mode 100644 antlr/.antlr/Excellent2Parser.java delete mode 100644 antlr/.antlr/LexUnicode.interp delete mode 100644 antlr/.antlr/LexUnicode.java delete mode 100644 antlr/.antlr/LexUnicode.tokens create mode 100644 antlr/Excellent1.g4 rename antlr/.antlr/Excellent2.interp => legacy/gen/Excellent1.interp (99%) rename antlr/.antlr/Excellent2Lexer.tokens => legacy/gen/Excellent1.tokens (97%) rename antlr/.antlr/Excellent2Lexer.interp => legacy/gen/Excellent1Lexer.interp (99%) rename antlr/.antlr/Excellent2.tokens => legacy/gen/Excellent1Lexer.tokens (97%) create mode 100644 legacy/gen/excellent1_base_listener.go create mode 100644 legacy/gen/excellent1_base_visitor.go create mode 100644 legacy/gen/excellent1_lexer.go create mode 100644 legacy/gen/excellent1_listener.go create mode 100644 legacy/gen/excellent1_parser.go create mode 100644 legacy/gen/excellent1_visitor.go diff --git a/antlr/.antlr/Excellent2Lexer.java b/antlr/.antlr/Excellent2Lexer.java deleted file mode 100644 index 63b8dc745..000000000 --- a/antlr/.antlr/Excellent2Lexer.java +++ /dev/null @@ -1,252 +0,0 @@ -// Generated from /Users/rowan/Nyaruka/go/src/github.com/nyaruka/goflow/antlr/Excellent2.g4 by ANTLR 4.7.1 -import org.antlr.v4.runtime.Lexer; -import org.antlr.v4.runtime.CharStream; -import org.antlr.v4.runtime.Token; -import org.antlr.v4.runtime.TokenStream; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.misc.*; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) -public class Excellent2Lexer extends Lexer { - static { RuntimeMetaData.checkVersion("4.7.1", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - COMMA=1, LPAREN=2, RPAREN=3, LBRACK=4, RBRACK=5, DOT=6, PLUS=7, MINUS=8, - TIMES=9, DIVIDE=10, EXPONENT=11, EQ=12, NEQ=13, LTE=14, LT=15, GTE=16, - GT=17, AMPERSAND=18, DECIMAL=19, STRING=20, TRUE=21, FALSE=22, NULL=23, - NAME=24, WS=25, ERROR=26; - public static String[] channelNames = { - "DEFAULT_TOKEN_CHANNEL", "HIDDEN" - }; - - public static String[] modeNames = { - "DEFAULT_MODE" - }; - - public static final String[] ruleNames = { - "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", - "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", - "AMPERSAND", "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", - "ERROR", "UnicodeLetter", "UnicodeClass_LU", "UnicodeClass_LL", "UnicodeClass_LT", - "UnicodeClass_LM", "UnicodeClass_LO", "UnicodeDigit" - }; - - private static final String[] _LITERAL_NAMES = { - null, "','", "'('", "')'", "'['", "']'", "'.'", "'+'", "'-'", "'*'", "'/'", - "'^'", "'='", "'!='", "'<='", "'<'", "'>='", "'>'", "'&'" - }; - private static final String[] _SYMBOLIC_NAMES = { - null, "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", - "MINUS", "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", - "GT", "AMPERSAND", "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", - "WS", "ERROR" - }; - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } - - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - - public Excellent2Lexer(CharStream input) { - super(input); - _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @Override - public String getGrammarFileName() { return "Excellent2.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public String[] getChannelNames() { return channelNames; } - - @Override - public String[] getModeNames() { return modeNames; } - - @Override - public ATN getATN() { return _ATN; } - - public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\34\u00bd\b\1\4\2"+ - "\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4"+ - "\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ - "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+ - "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+ - " \4!\t!\4\"\t\"\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3"+ - "\b\3\t\3\t\3\n\3\n\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\16\3\17\3\17"+ - "\3\17\3\20\3\20\3\21\3\21\3\21\3\22\3\22\3\23\3\23\3\24\6\24n\n\24\r\24"+ - "\16\24o\3\24\3\24\6\24t\n\24\r\24\16\24u\5\24x\n\24\3\25\3\25\3\25\3\25"+ - "\7\25~\n\25\f\25\16\25\u0081\13\25\3\25\3\25\3\26\3\26\3\26\3\26\3\26"+ - "\3\27\3\27\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\31\6\31\u0096"+ - "\n\31\r\31\16\31\u0097\3\31\3\31\3\31\7\31\u009d\n\31\f\31\16\31\u00a0"+ - "\13\31\3\32\6\32\u00a3\n\32\r\32\16\32\u00a4\3\32\3\32\3\33\3\33\3\34"+ - "\3\34\3\34\3\34\3\34\5\34\u00b0\n\34\3\35\3\35\3\36\3\36\3\37\3\37\3 "+ - "\3 \3!\3!\3\"\3\"\2\2#\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27"+ - "\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33"+ - "\65\34\67\29\2;\2=\2?\2A\2C\2\3\2\24\3\2\62;\3\2$$\4\2VVvv\4\2TTtt\4\2"+ - "WWww\4\2GGgg\4\2HHhh\4\2CCcc\4\2NNnn\4\2UUuu\4\2PPpp\5\2\13\f\17\17\""+ - "\"T\2C\\\u00c2\u00d8\u00da\u00e0\u0102\u0138\u013b\u0149\u014c\u017f\u0183"+ - "\u0184\u0186\u018d\u0190\u0193\u0195\u0196\u0198\u019a\u019e\u019f\u01a1"+ - "\u01a2\u01a4\u01ab\u01ae\u01b5\u01b7\u01be\u01c6\u01cf\u01d1\u01dd\u01e0"+ - "\u01f0\u01f3\u01f6\u01f8\u01fa\u01fc\u0234\u023c\u023d\u023f\u0240\u0243"+ - "\u0248\u024a\u0250\u0372\u0374\u0378\u0381\u0388\u038c\u038e\u03a3\u03a5"+ - "\u03ad\u03d1\u03d6\u03da\u03f0\u03f6\u03f9\u03fb\u03fc\u03ff\u0431\u0462"+ - "\u0482\u048c\u04cf\u04d2\u0530\u0533\u0558\u10a2\u10c7\u10c9\u10cf\u1e02"+ - "\u1e96\u1ea0\u1f00\u1f0a\u1f11\u1f1a\u1f1f\u1f2a\u1f31\u1f3a\u1f41\u1f4a"+ - "\u1f4f\u1f5b\u1f61\u1f6a\u1f71\u1fba\u1fbd\u1fca\u1fcd\u1fda\u1fdd\u1fea"+ - "\u1fee\u1ffa\u1ffd\u2104\u2109\u210d\u210f\u2112\u2114\u2117\u211f\u2126"+ - "\u212f\u2132\u2135\u2140\u2141\u2147\u2185\u2c02\u2c30\u2c62\u2c66\u2c69"+ - "\u2c72\u2c74\u2c77\u2c80\u2c82\u2c84\u2ce4\u2ced\u2cef\u2cf4\ua642\ua644"+ - "\ua66e\ua682\ua69c\ua724\ua730\ua734\ua770\ua77b\ua788\ua78d\ua78f\ua792"+ - "\ua794\ua798\ua7af\ua7b2\ua7b3\uff23\uff3cS\2c|\u00b7\u00f8\u00fa\u0101"+ - "\u0103\u0179\u017c\u0182\u0185\u0187\u018a\u0194\u0197\u019d\u01a0\u01a3"+ - "\u01a5\u01a7\u01aa\u01af\u01b2\u01b6\u01b8\u01c1\u01c8\u01ce\u01d0\u01f5"+ - "\u01f7\u01fb\u01fd\u023b\u023e\u0244\u0249\u0295\u0297\u02b1\u0373\u0375"+ - "\u0379\u037f\u0392\u03d0\u03d2\u03d3\u03d7\u03d9\u03db\u03f5\u03f7\u0461"+ - "\u0463\u0483\u048d\u04c1\u04c4\u0531\u0563\u0589\u1d02\u1d2d\u1d6d\u1d79"+ - "\u1d7b\u1d9c\u1e03\u1e9f\u1ea1\u1f09\u1f12\u1f17\u1f22\u1f29\u1f32\u1f39"+ - "\u1f42\u1f47\u1f52\u1f59\u1f62\u1f69\u1f72\u1f7f\u1f82\u1f89\u1f92\u1f99"+ - "\u1fa2\u1fa9\u1fb2\u1fb6\u1fb8\u1fb9\u1fc0\u1fc6\u1fc8\u1fc9\u1fd2\u1fd5"+ - "\u1fd8\u1fd9\u1fe2\u1fe9\u1ff4\u1ff6\u1ff8\u1ff9\u210c\u2115\u2131\u213b"+ - "\u213e\u213f\u2148\u214b\u2150\u2186\u2c32\u2c60\u2c63\u2c6e\u2c73\u2c7d"+ - "\u2c83\u2cee\u2cf0\u2cf5\u2d02\u2d27\u2d29\u2d2f\ua643\ua66f\ua683\ua69d"+ - "\ua725\ua733\ua735\ua77a\ua77c\ua77e\ua781\ua789\ua78e\ua790\ua793\ua797"+ - "\ua799\ua7ab\ua7fc\uab5c\uab66\uab67\ufb02\ufb08\ufb15\ufb19\uff43\uff5c"+ - "\b\2\u01c7\u01cd\u01f4\u1f91\u1f9a\u1fa1\u1faa\u1fb1\u1fbe\u1fce\u1ffe"+ - "\u1ffe#\2\u02b2\u02c3\u02c8\u02d3\u02e2\u02e6\u02ee\u02f0\u0376\u037c"+ - "\u055b\u0642\u06e7\u06e8\u07f6\u07f7\u07fc\u081c\u0826\u082a\u0973\u0e48"+ - "\u0ec8\u10fe\u17d9\u1845\u1aa9\u1c7f\u1d2e\u1d6c\u1d7a\u1dc1\u2073\u2081"+ - "\u2092\u209e\u2c7e\u2c7f\u2d71\u2e31\u3007\u3037\u303d\u3100\ua017\ua4ff"+ - "\ua60e\ua681\ua69e\ua69f\ua719\ua721\ua772\ua78a\ua7fa\ua7fb\ua9d1\ua9e8"+ - "\uaa72\uaadf\uaaf5\uaaf6\uab5e\uab61\uff72\uffa1\u00ec\2\u00ac\u00bc\u01bd"+ - "\u01c5\u0296\u05ec\u05f2\u05f4\u0622\u0641\u0643\u064c\u0670\u0671\u0673"+ - "\u06d5\u06d7\u06fe\u0701\u0712\u0714\u0731\u074f\u07a7\u07b3\u07ec\u0802"+ - "\u0817\u0842\u085a\u08a2\u08b4\u0906\u093b\u093f\u0952\u095a\u0963\u0974"+ - "\u0982\u0987\u098e\u0991\u0992\u0995\u09aa\u09ac\u09b2\u09b4\u09bb\u09bf"+ - "\u09d0\u09de\u09df\u09e1\u09e3\u09f2\u09f3\u0a07\u0a0c\u0a11\u0a12\u0a15"+ - "\u0a2a\u0a2c\u0a32\u0a34\u0a35\u0a37\u0a38\u0a3a\u0a3b\u0a5b\u0a5e\u0a60"+ - "\u0a76\u0a87\u0a8f\u0a91\u0a93\u0a95\u0aaa\u0aac\u0ab2\u0ab4\u0ab5\u0ab7"+ - "\u0abb\u0abf\u0ad2\u0ae2\u0ae3\u0b07\u0b0e\u0b11\u0b12\u0b15\u0b2a\u0b2c"+ - "\u0b32\u0b34\u0b35\u0b37\u0b3b\u0b3f\u0b63\u0b73\u0b85\u0b87\u0b8c\u0b90"+ - "\u0b92\u0b94\u0b97\u0b9b\u0b9c\u0b9e\u0bac\u0bb0\u0bbb\u0bd2\u0c0e\u0c10"+ - "\u0c12\u0c14\u0c2a\u0c2c\u0c3b\u0c3f\u0c8e\u0c90\u0c92\u0c94\u0caa\u0cac"+ - "\u0cb5\u0cb7\u0cbb\u0cbf\u0ce0\u0ce2\u0ce3\u0cf3\u0cf4\u0d07\u0d0e\u0d10"+ - "\u0d12\u0d14\u0d3c\u0d3f\u0d50\u0d62\u0d63\u0d7c\u0d81\u0d87\u0d98\u0d9c"+ - "\u0db3\u0db5\u0dbd\u0dbf\u0dc8\u0e03\u0e32\u0e34\u0e35\u0e42\u0e47\u0e83"+ - "\u0e84\u0e86\u0e8c\u0e8f\u0e99\u0e9b\u0ea1\u0ea3\u0ea5\u0ea7\u0ea9\u0eac"+ - "\u0ead\u0eaf\u0eb2\u0eb4\u0eb5\u0ebf\u0ec6\u0ede\u0ee1\u0f02\u0f49\u0f4b"+ - "\u0f6e\u0f8a\u0f8e\u1002\u102c\u1041\u1057\u105c\u105f\u1063\u1072\u1077"+ - "\u1083\u1090\u10fc\u10ff\u124a\u124c\u124f\u1252\u1258\u125a\u125f\u1262"+ - "\u128a\u128c\u128f\u1292\u12b2\u12b4\u12b7\u12ba\u12c0\u12c2\u12c7\u12ca"+ - "\u12d8\u12da\u1312\u1314\u1317\u131a\u135c\u1382\u1391\u13a2\u13f6\u1403"+ - "\u166e\u1671\u1681\u1683\u169c\u16a2\u16ec\u16f3\u16fa\u1702\u170e\u1710"+ - "\u1713\u1722\u1733\u1742\u1753\u1762\u176e\u1770\u1772\u1782\u17b5\u17de"+ - "\u1844\u1846\u1879\u1882\u18aa\u18ac\u18f7\u1902\u1920\u1952\u196f\u1972"+ - "\u1976\u1982\u19ad\u19c3\u19c9\u1a02\u1a18\u1a22\u1a56\u1b07\u1b35\u1b47"+ - "\u1b4d\u1b85\u1ba2\u1bb0\u1bb1\u1bbc\u1be7\u1c02\u1c25\u1c4f\u1c51\u1c5c"+ - "\u1c79\u1ceb\u1cee\u1cf0\u1cf3\u1cf7\u1cf8\u2137\u213a\u2d32\u2d69\u2d82"+ - "\u2d98\u2da2\u2da8\u2daa\u2db0\u2db2\u2db8\u2dba\u2dc0\u2dc2\u2dc8\u2dca"+ - "\u2dd0\u2dd2\u2dd8\u2dda\u2de0\u3008\u303e\u3043\u3098\u30a1\u30fc\u3101"+ - "\u312f\u3133\u3190\u31a2\u31bc\u31f2\u3201\u3402\u4db7\u4e02\u9fce\ua002"+ - "\ua016\ua018\ua48e\ua4d2\ua4f9\ua502\ua60d\ua612\ua621\ua62c\ua62d\ua670"+ - "\ua6e7\ua7f9\ua803\ua805\ua807\ua809\ua80c\ua80e\ua824\ua842\ua875\ua884"+ - "\ua8b5\ua8f4\ua8f9\ua8fd\ua927\ua932\ua948\ua962\ua97e\ua986\ua9b4\ua9e2"+ - "\ua9e6\ua9e9\ua9f1\ua9fc\uaa00\uaa02\uaa2a\uaa42\uaa44\uaa46\uaa4d\uaa62"+ - "\uaa71\uaa73\uaa78\uaa7c\uaab1\uaab3\uaabf\uaac2\uaac4\uaadd\uaade\uaae2"+ - "\uaaec\uaaf4\uab08\uab0b\uab10\uab13\uab18\uab22\uab28\uab2a\uab30\uabc2"+ - "\uabe4\uac02\ud7a5\ud7b2\ud7c8\ud7cd\ud7fd\uf902\ufa6f\ufa72\ufadb\ufb1f"+ - "\ufb2a\ufb2c\ufb38\ufb3a\ufb3e\ufb40\ufbb3\ufbd5\ufd3f\ufd52\ufd91\ufd94"+ - "\ufdc9\ufdf2\ufdfd\ufe72\ufe76\ufe78\ufefe\uff68\uff71\uff73\uff9f\uffa2"+ - "\uffc0\uffc4\uffc9\uffcc\uffd1\uffd4\uffd9\uffdc\uffde\'\2\62;\u0662\u066b"+ - "\u06f2\u06fb\u07c2\u07cb\u0968\u0971\u09e8\u09f1\u0a68\u0a71\u0ae8\u0af1"+ - "\u0b68\u0b71\u0be8\u0bf1\u0c68\u0c71\u0ce8\u0cf1\u0d68\u0d71\u0de8\u0df1"+ - "\u0e52\u0e5b\u0ed2\u0edb\u0f22\u0f2b\u1042\u104b\u1092\u109b\u17e2\u17eb"+ - "\u1812\u181b\u1948\u1951\u19d2\u19db\u1a82\u1a8b\u1a92\u1a9b\u1b52\u1b5b"+ - "\u1bb2\u1bbb\u1c42\u1c4b\u1c52\u1c5b\ua622\ua62b\ua8d2\ua8db\ua902\ua90b"+ - "\ua9d2\ua9db\ua9f2\ua9fb\uaa52\uaa5b\uabf2\uabfb\uff12\uff1b\2\u00c3\2"+ - "\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2"+ - "\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2"+ - "\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2"+ - "\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2"+ - "\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\3E\3\2\2\2\5G\3\2\2\2\7I\3\2\2"+ - "\2\tK\3\2\2\2\13M\3\2\2\2\rO\3\2\2\2\17Q\3\2\2\2\21S\3\2\2\2\23U\3\2\2"+ - "\2\25W\3\2\2\2\27Y\3\2\2\2\31[\3\2\2\2\33]\3\2\2\2\35`\3\2\2\2\37c\3\2"+ - "\2\2!e\3\2\2\2#h\3\2\2\2%j\3\2\2\2\'m\3\2\2\2)y\3\2\2\2+\u0084\3\2\2\2"+ - "-\u0089\3\2\2\2/\u008f\3\2\2\2\61\u0095\3\2\2\2\63\u00a2\3\2\2\2\65\u00a8"+ - "\3\2\2\2\67\u00af\3\2\2\29\u00b1\3\2\2\2;\u00b3\3\2\2\2=\u00b5\3\2\2\2"+ - "?\u00b7\3\2\2\2A\u00b9\3\2\2\2C\u00bb\3\2\2\2EF\7.\2\2F\4\3\2\2\2GH\7"+ - "*\2\2H\6\3\2\2\2IJ\7+\2\2J\b\3\2\2\2KL\7]\2\2L\n\3\2\2\2MN\7_\2\2N\f\3"+ - "\2\2\2OP\7\60\2\2P\16\3\2\2\2QR\7-\2\2R\20\3\2\2\2ST\7/\2\2T\22\3\2\2"+ - "\2UV\7,\2\2V\24\3\2\2\2WX\7\61\2\2X\26\3\2\2\2YZ\7`\2\2Z\30\3\2\2\2[\\"+ - "\7?\2\2\\\32\3\2\2\2]^\7#\2\2^_\7?\2\2_\34\3\2\2\2`a\7>\2\2ab\7?\2\2b"+ - "\36\3\2\2\2cd\7>\2\2d \3\2\2\2ef\7@\2\2fg\7?\2\2g\"\3\2\2\2hi\7@\2\2i"+ - "$\3\2\2\2jk\7(\2\2k&\3\2\2\2ln\t\2\2\2ml\3\2\2\2no\3\2\2\2om\3\2\2\2o"+ - "p\3\2\2\2pw\3\2\2\2qs\7\60\2\2rt\t\2\2\2sr\3\2\2\2tu\3\2\2\2us\3\2\2\2"+ - "uv\3\2\2\2vx\3\2\2\2wq\3\2\2\2wx\3\2\2\2x(\3\2\2\2y\177\7$\2\2z~\n\3\2"+ - "\2{|\7$\2\2|~\7$\2\2}z\3\2\2\2}{\3\2\2\2~\u0081\3\2\2\2\177}\3\2\2\2\177"+ - "\u0080\3\2\2\2\u0080\u0082\3\2\2\2\u0081\177\3\2\2\2\u0082\u0083\7$\2"+ - "\2\u0083*\3\2\2\2\u0084\u0085\t\4\2\2\u0085\u0086\t\5\2\2\u0086\u0087"+ - "\t\6\2\2\u0087\u0088\t\7\2\2\u0088,\3\2\2\2\u0089\u008a\t\b\2\2\u008a"+ - "\u008b\t\t\2\2\u008b\u008c\t\n\2\2\u008c\u008d\t\13\2\2\u008d\u008e\t"+ - "\7\2\2\u008e.\3\2\2\2\u008f\u0090\t\f\2\2\u0090\u0091\t\6\2\2\u0091\u0092"+ - "\t\n\2\2\u0092\u0093\t\n\2\2\u0093\60\3\2\2\2\u0094\u0096\5\67\34\2\u0095"+ - "\u0094\3\2\2\2\u0096\u0097\3\2\2\2\u0097\u0095\3\2\2\2\u0097\u0098\3\2"+ - "\2\2\u0098\u009e\3\2\2\2\u0099\u009d\5\67\34\2\u009a\u009d\5C\"\2\u009b"+ - "\u009d\7a\2\2\u009c\u0099\3\2\2\2\u009c\u009a\3\2\2\2\u009c\u009b\3\2"+ - "\2\2\u009d\u00a0\3\2\2\2\u009e\u009c\3\2\2\2\u009e\u009f\3\2\2\2\u009f"+ - "\62\3\2\2\2\u00a0\u009e\3\2\2\2\u00a1\u00a3\t\r\2\2\u00a2\u00a1\3\2\2"+ - "\2\u00a3\u00a4\3\2\2\2\u00a4\u00a2\3\2\2\2\u00a4\u00a5\3\2\2\2\u00a5\u00a6"+ - "\3\2\2\2\u00a6\u00a7\b\32\2\2\u00a7\64\3\2\2\2\u00a8\u00a9\13\2\2\2\u00a9"+ - "\66\3\2\2\2\u00aa\u00b0\59\35\2\u00ab\u00b0\5;\36\2\u00ac\u00b0\5=\37"+ - "\2\u00ad\u00b0\5? \2\u00ae\u00b0\5A!\2\u00af\u00aa\3\2\2\2\u00af\u00ab"+ - "\3\2\2\2\u00af\u00ac\3\2\2\2\u00af\u00ad\3\2\2\2\u00af\u00ae\3\2\2\2\u00b0"+ - "8\3\2\2\2\u00b1\u00b2\t\16\2\2\u00b2:\3\2\2\2\u00b3\u00b4\t\17\2\2\u00b4"+ - "<\3\2\2\2\u00b5\u00b6\t\20\2\2\u00b6>\3\2\2\2\u00b7\u00b8\t\21\2\2\u00b8"+ - "@\3\2\2\2\u00b9\u00ba\t\22\2\2\u00baB\3\2\2\2\u00bb\u00bc\t\23\2\2\u00bc"+ - "D\3\2\2\2\r\2ouw}\177\u0097\u009c\u009e\u00a4\u00af\3\b\2\2"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/antlr/.antlr/Excellent2Parser.java b/antlr/.antlr/Excellent2Parser.java deleted file mode 100644 index 95923f5dd..000000000 --- a/antlr/.antlr/Excellent2Parser.java +++ /dev/null @@ -1,823 +0,0 @@ -// Generated from /Users/rowan/Nyaruka/go/src/github.com/nyaruka/goflow/antlr/Excellent2.g4 by ANTLR 4.7.1 -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.misc.*; -import org.antlr.v4.runtime.tree.*; -import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) -public class Excellent2Parser extends Parser { - static { RuntimeMetaData.checkVersion("4.7.1", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - COMMA=1, LPAREN=2, RPAREN=3, LBRACK=4, RBRACK=5, DOT=6, PLUS=7, MINUS=8, - TIMES=9, DIVIDE=10, EXPONENT=11, EQ=12, NEQ=13, LTE=14, LT=15, GTE=16, - GT=17, AMPERSAND=18, DECIMAL=19, STRING=20, TRUE=21, FALSE=22, NULL=23, - NAME=24, WS=25, ERROR=26; - public static final int - RULE_parse = 0, RULE_atom = 1, RULE_expression = 2, RULE_fnname = 3, RULE_parameters = 4; - public static final String[] ruleNames = { - "parse", "atom", "expression", "fnname", "parameters" - }; - - private static final String[] _LITERAL_NAMES = { - null, "','", "'('", "')'", "'['", "']'", "'.'", "'+'", "'-'", "'*'", "'/'", - "'^'", "'='", "'!='", "'<='", "'<'", "'>='", "'>'", "'&'" - }; - private static final String[] _SYMBOLIC_NAMES = { - null, "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", - "MINUS", "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", - "GT", "AMPERSAND", "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", - "WS", "ERROR" - }; - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } - - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - @Override - public String getGrammarFileName() { return "Excellent2.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public ATN getATN() { return _ATN; } - - public Excellent2Parser(TokenStream input) { - super(input); - _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - public static class ParseContext extends ParserRuleContext { - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public TerminalNode EOF() { return getToken(Excellent2Parser.EOF, 0); } - public ParseContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_parse; } - } - - public final ParseContext parse() throws RecognitionException { - ParseContext _localctx = new ParseContext(_ctx, getState()); - enterRule(_localctx, 0, RULE_parse); - try { - enterOuterAlt(_localctx, 1); - { - setState(10); - expression(0); - setState(11); - match(EOF); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class AtomContext extends ParserRuleContext { - public AtomContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_atom; } - - public AtomContext() { } - public void copyFrom(AtomContext ctx) { - super.copyFrom(ctx); - } - } - public static class DecimalLiteralContext extends AtomContext { - public TerminalNode DECIMAL() { return getToken(Excellent2Parser.DECIMAL, 0); } - public DecimalLiteralContext(AtomContext ctx) { copyFrom(ctx); } - } - public static class DotLookupContext extends AtomContext { - public List atom() { - return getRuleContexts(AtomContext.class); - } - public AtomContext atom(int i) { - return getRuleContext(AtomContext.class,i); - } - public TerminalNode DOT() { return getToken(Excellent2Parser.DOT, 0); } - public DotLookupContext(AtomContext ctx) { copyFrom(ctx); } - } - public static class NullContext extends AtomContext { - public TerminalNode NULL() { return getToken(Excellent2Parser.NULL, 0); } - public NullContext(AtomContext ctx) { copyFrom(ctx); } - } - public static class StringLiteralContext extends AtomContext { - public TerminalNode STRING() { return getToken(Excellent2Parser.STRING, 0); } - public StringLiteralContext(AtomContext ctx) { copyFrom(ctx); } - } - public static class FunctionCallContext extends AtomContext { - public FnnameContext fnname() { - return getRuleContext(FnnameContext.class,0); - } - public TerminalNode LPAREN() { return getToken(Excellent2Parser.LPAREN, 0); } - public TerminalNode RPAREN() { return getToken(Excellent2Parser.RPAREN, 0); } - public ParametersContext parameters() { - return getRuleContext(ParametersContext.class,0); - } - public FunctionCallContext(AtomContext ctx) { copyFrom(ctx); } - } - public static class TrueContext extends AtomContext { - public TerminalNode TRUE() { return getToken(Excellent2Parser.TRUE, 0); } - public TrueContext(AtomContext ctx) { copyFrom(ctx); } - } - public static class FalseContext extends AtomContext { - public TerminalNode FALSE() { return getToken(Excellent2Parser.FALSE, 0); } - public FalseContext(AtomContext ctx) { copyFrom(ctx); } - } - public static class ArrayLookupContext extends AtomContext { - public AtomContext atom() { - return getRuleContext(AtomContext.class,0); - } - public TerminalNode LBRACK() { return getToken(Excellent2Parser.LBRACK, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public TerminalNode RBRACK() { return getToken(Excellent2Parser.RBRACK, 0); } - public ArrayLookupContext(AtomContext ctx) { copyFrom(ctx); } - } - public static class ContextReferenceContext extends AtomContext { - public TerminalNode NAME() { return getToken(Excellent2Parser.NAME, 0); } - public ContextReferenceContext(AtomContext ctx) { copyFrom(ctx); } - } - - public final AtomContext atom() throws RecognitionException { - return atom(0); - } - - private AtomContext atom(int _p) throws RecognitionException { - ParserRuleContext _parentctx = _ctx; - int _parentState = getState(); - AtomContext _localctx = new AtomContext(_ctx, _parentState); - AtomContext _prevctx = _localctx; - int _startState = 2; - enterRecursionRule(_localctx, 2, RULE_atom, _p); - int _la; - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(27); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { - case 1: - { - _localctx = new FunctionCallContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - - setState(14); - fnname(); - setState(15); - match(LPAREN); - setState(17); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LPAREN) | (1L << MINUS) | (1L << DECIMAL) | (1L << STRING) | (1L << TRUE) | (1L << FALSE) | (1L << NULL) | (1L << NAME))) != 0)) { - { - setState(16); - parameters(); - } - } - - setState(19); - match(RPAREN); - } - break; - case 2: - { - _localctx = new ContextReferenceContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - setState(21); - match(NAME); - } - break; - case 3: - { - _localctx = new StringLiteralContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - setState(22); - match(STRING); - } - break; - case 4: - { - _localctx = new DecimalLiteralContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - setState(23); - match(DECIMAL); - } - break; - case 5: - { - _localctx = new TrueContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - setState(24); - match(TRUE); - } - break; - case 6: - { - _localctx = new FalseContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - setState(25); - match(FALSE); - } - break; - case 7: - { - _localctx = new NullContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - setState(26); - match(NULL); - } - break; - } - _ctx.stop = _input.LT(-1); - setState(39); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,3,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - if ( _parseListeners!=null ) triggerExitRuleEvent(); - _prevctx = _localctx; - { - setState(37); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) { - case 1: - { - _localctx = new DotLookupContext(new AtomContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_atom); - setState(29); - if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); - setState(30); - match(DOT); - setState(31); - atom(9); - } - break; - case 2: - { - _localctx = new ArrayLookupContext(new AtomContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_atom); - setState(32); - if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(33); - match(LBRACK); - setState(34); - expression(0); - setState(35); - match(RBRACK); - } - break; - } - } - } - setState(41); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,3,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - unrollRecursionContexts(_parentctx); - } - return _localctx; - } - - public static class ExpressionContext extends ParserRuleContext { - public ExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_expression; } - - public ExpressionContext() { } - public void copyFrom(ExpressionContext ctx) { - super.copyFrom(ctx); - } - } - public static class ParenthesesContext extends ExpressionContext { - public TerminalNode LPAREN() { return getToken(Excellent2Parser.LPAREN, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public TerminalNode RPAREN() { return getToken(Excellent2Parser.RPAREN, 0); } - public ParenthesesContext(ExpressionContext ctx) { copyFrom(ctx); } - } - public static class NegationContext extends ExpressionContext { - public TerminalNode MINUS() { return getToken(Excellent2Parser.MINUS, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public NegationContext(ExpressionContext ctx) { copyFrom(ctx); } - } - public static class ComparisonContext extends ExpressionContext { - public Token op; - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public TerminalNode LTE() { return getToken(Excellent2Parser.LTE, 0); } - public TerminalNode LT() { return getToken(Excellent2Parser.LT, 0); } - public TerminalNode GTE() { return getToken(Excellent2Parser.GTE, 0); } - public TerminalNode GT() { return getToken(Excellent2Parser.GT, 0); } - public ComparisonContext(ExpressionContext ctx) { copyFrom(ctx); } - } - public static class ConcatenationContext extends ExpressionContext { - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public TerminalNode AMPERSAND() { return getToken(Excellent2Parser.AMPERSAND, 0); } - public ConcatenationContext(ExpressionContext ctx) { copyFrom(ctx); } - } - public static class MultiplicationOrDivisionContext extends ExpressionContext { - public Token op; - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public TerminalNode TIMES() { return getToken(Excellent2Parser.TIMES, 0); } - public TerminalNode DIVIDE() { return getToken(Excellent2Parser.DIVIDE, 0); } - public MultiplicationOrDivisionContext(ExpressionContext ctx) { copyFrom(ctx); } - } - public static class AtomReferenceContext extends ExpressionContext { - public AtomContext atom() { - return getRuleContext(AtomContext.class,0); - } - public AtomReferenceContext(ExpressionContext ctx) { copyFrom(ctx); } - } - public static class AdditionOrSubtractionContext extends ExpressionContext { - public Token op; - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public TerminalNode PLUS() { return getToken(Excellent2Parser.PLUS, 0); } - public TerminalNode MINUS() { return getToken(Excellent2Parser.MINUS, 0); } - public AdditionOrSubtractionContext(ExpressionContext ctx) { copyFrom(ctx); } - } - public static class EqualityContext extends ExpressionContext { - public Token op; - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public TerminalNode EQ() { return getToken(Excellent2Parser.EQ, 0); } - public TerminalNode NEQ() { return getToken(Excellent2Parser.NEQ, 0); } - public EqualityContext(ExpressionContext ctx) { copyFrom(ctx); } - } - public static class ExponentContext extends ExpressionContext { - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public TerminalNode EXPONENT() { return getToken(Excellent2Parser.EXPONENT, 0); } - public ExponentContext(ExpressionContext ctx) { copyFrom(ctx); } - } - - public final ExpressionContext expression() throws RecognitionException { - return expression(0); - } - - private ExpressionContext expression(int _p) throws RecognitionException { - ParserRuleContext _parentctx = _ctx; - int _parentState = getState(); - ExpressionContext _localctx = new ExpressionContext(_ctx, _parentState); - ExpressionContext _prevctx = _localctx; - int _startState = 4; - enterRecursionRule(_localctx, 4, RULE_expression, _p); - int _la; - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(50); - _errHandler.sync(this); - switch (_input.LA(1)) { - case DECIMAL: - case STRING: - case TRUE: - case FALSE: - case NULL: - case NAME: - { - _localctx = new AtomReferenceContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - - setState(43); - atom(0); - } - break; - case MINUS: - { - _localctx = new NegationContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - setState(44); - match(MINUS); - setState(45); - expression(8); - } - break; - case LPAREN: - { - _localctx = new ParenthesesContext(_localctx); - _ctx = _localctx; - _prevctx = _localctx; - setState(46); - match(LPAREN); - setState(47); - expression(0); - setState(48); - match(RPAREN); - } - break; - default: - throw new NoViableAltException(this); - } - _ctx.stop = _input.LT(-1); - setState(72); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,6,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - if ( _parseListeners!=null ) triggerExitRuleEvent(); - _prevctx = _localctx; - { - setState(70); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) { - case 1: - { - _localctx = new ExponentContext(new ExpressionContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(52); - if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(53); - match(EXPONENT); - setState(54); - expression(8); - } - break; - case 2: - { - _localctx = new MultiplicationOrDivisionContext(new ExpressionContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(55); - if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); - setState(56); - ((MultiplicationOrDivisionContext)_localctx).op = _input.LT(1); - _la = _input.LA(1); - if ( !(_la==TIMES || _la==DIVIDE) ) { - ((MultiplicationOrDivisionContext)_localctx).op = (Token)_errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - setState(57); - expression(7); - } - break; - case 3: - { - _localctx = new AdditionOrSubtractionContext(new ExpressionContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(58); - if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); - setState(59); - ((AdditionOrSubtractionContext)_localctx).op = _input.LT(1); - _la = _input.LA(1); - if ( !(_la==PLUS || _la==MINUS) ) { - ((AdditionOrSubtractionContext)_localctx).op = (Token)_errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - setState(60); - expression(6); - } - break; - case 4: - { - _localctx = new ComparisonContext(new ExpressionContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(61); - if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); - setState(62); - ((ComparisonContext)_localctx).op = _input.LT(1); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LTE) | (1L << LT) | (1L << GTE) | (1L << GT))) != 0)) ) { - ((ComparisonContext)_localctx).op = (Token)_errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - setState(63); - expression(5); - } - break; - case 5: - { - _localctx = new EqualityContext(new ExpressionContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(64); - if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); - setState(65); - ((EqualityContext)_localctx).op = _input.LT(1); - _la = _input.LA(1); - if ( !(_la==EQ || _la==NEQ) ) { - ((EqualityContext)_localctx).op = (Token)_errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - setState(66); - expression(4); - } - break; - case 6: - { - _localctx = new ConcatenationContext(new ExpressionContext(_parentctx, _parentState)); - pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(67); - if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(68); - match(AMPERSAND); - setState(69); - expression(3); - } - break; - } - } - } - setState(74); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,6,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - unrollRecursionContexts(_parentctx); - } - return _localctx; - } - - public static class FnnameContext extends ParserRuleContext { - public TerminalNode NAME() { return getToken(Excellent2Parser.NAME, 0); } - public TerminalNode TRUE() { return getToken(Excellent2Parser.TRUE, 0); } - public TerminalNode FALSE() { return getToken(Excellent2Parser.FALSE, 0); } - public FnnameContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_fnname; } - } - - public final FnnameContext fnname() throws RecognitionException { - FnnameContext _localctx = new FnnameContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_fnname); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(75); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << TRUE) | (1L << FALSE) | (1L << NAME))) != 0)) ) { - _errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public static class ParametersContext extends ParserRuleContext { - public ParametersContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_parameters; } - - public ParametersContext() { } - public void copyFrom(ParametersContext ctx) { - super.copyFrom(ctx); - } - } - public static class FunctionParametersContext extends ParametersContext { - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public List COMMA() { return getTokens(Excellent2Parser.COMMA); } - public TerminalNode COMMA(int i) { - return getToken(Excellent2Parser.COMMA, i); - } - public FunctionParametersContext(ParametersContext ctx) { copyFrom(ctx); } - } - - public final ParametersContext parameters() throws RecognitionException { - ParametersContext _localctx = new ParametersContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_parameters); - int _la; - try { - _localctx = new FunctionParametersContext(_localctx); - enterOuterAlt(_localctx, 1); - { - setState(77); - expression(0); - setState(82); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==COMMA) { - { - { - setState(78); - match(COMMA); - setState(79); - expression(0); - } - } - setState(84); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { - switch (ruleIndex) { - case 1: - return atom_sempred((AtomContext)_localctx, predIndex); - case 2: - return expression_sempred((ExpressionContext)_localctx, predIndex); - } - return true; - } - private boolean atom_sempred(AtomContext _localctx, int predIndex) { - switch (predIndex) { - case 0: - return precpred(_ctx, 8); - case 1: - return precpred(_ctx, 7); - } - return true; - } - private boolean expression_sempred(ExpressionContext _localctx, int predIndex) { - switch (predIndex) { - case 2: - return precpred(_ctx, 7); - case 3: - return precpred(_ctx, 6); - case 4: - return precpred(_ctx, 5); - case 5: - return precpred(_ctx, 4); - case 6: - return precpred(_ctx, 3); - case 7: - return precpred(_ctx, 2); - } - return true; - } - - public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\34X\4\2\t\2\4\3\t"+ - "\3\4\4\t\4\4\5\t\5\4\6\t\6\3\2\3\2\3\2\3\3\3\3\3\3\3\3\5\3\24\n\3\3\3"+ - "\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3\36\n\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3"+ - "\3\7\3(\n\3\f\3\16\3+\13\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4\65\n\4"+ - "\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3"+ - "\4\7\4I\n\4\f\4\16\4L\13\4\3\5\3\5\3\6\3\6\3\6\7\6S\n\6\f\6\16\6V\13\6"+ - "\3\6\2\4\4\6\7\2\4\6\b\n\2\7\3\2\13\f\3\2\t\n\3\2\20\23\3\2\16\17\4\2"+ - "\27\30\32\32\2d\2\f\3\2\2\2\4\35\3\2\2\2\6\64\3\2\2\2\bM\3\2\2\2\nO\3"+ - "\2\2\2\f\r\5\6\4\2\r\16\7\2\2\3\16\3\3\2\2\2\17\20\b\3\1\2\20\21\5\b\5"+ - "\2\21\23\7\4\2\2\22\24\5\n\6\2\23\22\3\2\2\2\23\24\3\2\2\2\24\25\3\2\2"+ - "\2\25\26\7\5\2\2\26\36\3\2\2\2\27\36\7\32\2\2\30\36\7\26\2\2\31\36\7\25"+ - "\2\2\32\36\7\27\2\2\33\36\7\30\2\2\34\36\7\31\2\2\35\17\3\2\2\2\35\27"+ - "\3\2\2\2\35\30\3\2\2\2\35\31\3\2\2\2\35\32\3\2\2\2\35\33\3\2\2\2\35\34"+ - "\3\2\2\2\36)\3\2\2\2\37 \f\n\2\2 !\7\b\2\2!(\5\4\3\13\"#\f\t\2\2#$\7\6"+ - "\2\2$%\5\6\4\2%&\7\7\2\2&(\3\2\2\2\'\37\3\2\2\2\'\"\3\2\2\2(+\3\2\2\2"+ - ")\'\3\2\2\2)*\3\2\2\2*\5\3\2\2\2+)\3\2\2\2,-\b\4\1\2-\65\5\4\3\2./\7\n"+ - "\2\2/\65\5\6\4\n\60\61\7\4\2\2\61\62\5\6\4\2\62\63\7\5\2\2\63\65\3\2\2"+ - "\2\64,\3\2\2\2\64.\3\2\2\2\64\60\3\2\2\2\65J\3\2\2\2\66\67\f\t\2\2\67"+ - "8\7\r\2\28I\5\6\4\n9:\f\b\2\2:;\t\2\2\2;I\5\6\4\t<=\f\7\2\2=>\t\3\2\2"+ - ">I\5\6\4\b?@\f\6\2\2@A\t\4\2\2AI\5\6\4\7BC\f\5\2\2CD\t\5\2\2DI\5\6\4\6"+ - "EF\f\4\2\2FG\7\24\2\2GI\5\6\4\5H\66\3\2\2\2H9\3\2\2\2H<\3\2\2\2H?\3\2"+ - "\2\2HB\3\2\2\2HE\3\2\2\2IL\3\2\2\2JH\3\2\2\2JK\3\2\2\2K\7\3\2\2\2LJ\3"+ - "\2\2\2MN\t\6\2\2N\t\3\2\2\2OT\5\6\4\2PQ\7\3\2\2QS\5\6\4\2RP\3\2\2\2SV"+ - "\3\2\2\2TR\3\2\2\2TU\3\2\2\2U\13\3\2\2\2VT\3\2\2\2\n\23\35\')\64HJT"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/antlr/.antlr/LexUnicode.interp b/antlr/.antlr/LexUnicode.interp deleted file mode 100644 index 3cbc6a724..000000000 --- a/antlr/.antlr/LexUnicode.interp +++ /dev/null @@ -1,24 +0,0 @@ -token literal names: -null - -token symbolic names: -null - -rule names: -UnicodeLetter -UnicodeClass_LU -UnicodeClass_LL -UnicodeClass_LT -UnicodeClass_LM -UnicodeClass_LO -UnicodeDigit - -channel names: -DEFAULT_TOKEN_CHANNEL -HIDDEN - -mode names: -DEFAULT_MODE - -atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 2, 36, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 23, 10, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 2, 2, 9, 3, 2, 5, 2, 7, 2, 9, 2, 11, 2, 13, 2, 15, 2, 3, 2, 8, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, 332, 383, 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, 418, 420, 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, 504, 506, 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, 897, 904, 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, 1020, 1023, 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, 4295, 4297, 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, 7985, 7994, 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, 8141, 8154, 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, 8468, 8471, 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, 11312, 11362, 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, 11501, 11503, 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, 42864, 42875, 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, 65315, 65340, 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, 391, 394, 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, 456, 462, 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, 885, 889, 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, 1155, 1165, 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, 7580, 7683, 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, 8007, 8018, 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, 8105, 8114, 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, 8153, 8162, 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, 8511, 8520, 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, 11395, 11502, 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, 42653, 42789, 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, 42899, 42903, 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, 64281, 65347, 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, 8126, 8142, 8190, 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, 886, 892, 1371, 1602, 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, 3656, 3784, 4350, 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, 8321, 8338, 8350, 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, 40983, 42239, 42510, 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, 43003, 43473, 43496, 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, 236, 2, 172, 188, 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, 1648, 1649, 1651, 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, 1971, 2028, 2050, 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, 2394, 2403, 2420, 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, 2484, 2491, 2495, 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, 2577, 2578, 2581, 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, 2651, 2654, 2656, 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, 2740, 2741, 2743, 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, 2837, 2858, 2860, 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, 2951, 2956, 2960, 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, 3026, 3086, 3088, 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, 3220, 3242, 3244, 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, 3335, 3342, 3344, 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, 3463, 3480, 3484, 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, 3650, 3655, 3715, 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, 3751, 3753, 3756, 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, 3842, 3913, 3915, 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, 4195, 4210, 4215, 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, 4698, 4703, 4706, 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, 4802, 4807, 4810, 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, 5026, 5110, 5123, 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, 5890, 5902, 5904, 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, 6018, 6069, 6110, 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, 6482, 6511, 6514, 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, 6919, 6965, 6983, 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, 7247, 7249, 7260, 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, 11570, 11625, 11650, 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, 11712, 11714, 11720, 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, 12355, 12440, 12449, 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, 12801, 13314, 19895, 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, 42242, 42509, 42514, 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, 43015, 43017, 43020, 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, 43261, 43303, 43314, 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, 43505, 43516, 43520, 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, 43635, 43640, 43644, 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, 43756, 43764, 43784, 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, 43970, 44004, 44034, 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, 64219, 64287, 64298, 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, 64850, 64913, 64916, 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, 65393, 65395, 65439, 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, 65500, 65502, 39, 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, 2417, 2536, 2545, 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, 3185, 3304, 3313, 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, 3883, 4162, 4171, 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, 6619, 6786, 6795, 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, 7259, 42530, 42539, 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, 43602, 43611, 44018, 44027, 65298, 65307, 2, 32, 3, 22, 3, 2, 2, 2, 5, 24, 3, 2, 2, 2, 7, 26, 3, 2, 2, 2, 9, 28, 3, 2, 2, 2, 11, 30, 3, 2, 2, 2, 13, 32, 3, 2, 2, 2, 15, 34, 3, 2, 2, 2, 17, 23, 5, 5, 3, 2, 18, 23, 5, 7, 4, 2, 19, 23, 5, 9, 5, 2, 20, 23, 5, 11, 6, 2, 21, 23, 5, 13, 7, 2, 22, 17, 3, 2, 2, 2, 22, 18, 3, 2, 2, 2, 22, 19, 3, 2, 2, 2, 22, 20, 3, 2, 2, 2, 22, 21, 3, 2, 2, 2, 23, 4, 3, 2, 2, 2, 24, 25, 9, 2, 2, 2, 25, 6, 3, 2, 2, 2, 26, 27, 9, 3, 2, 2, 27, 8, 3, 2, 2, 2, 28, 29, 9, 4, 2, 2, 29, 10, 3, 2, 2, 2, 30, 31, 9, 5, 2, 2, 31, 12, 3, 2, 2, 2, 32, 33, 9, 6, 2, 2, 33, 14, 3, 2, 2, 2, 34, 35, 9, 7, 2, 2, 35, 16, 3, 2, 2, 2, 4, 2, 22, 2] \ No newline at end of file diff --git a/antlr/.antlr/LexUnicode.java b/antlr/.antlr/LexUnicode.java deleted file mode 100644 index 6b0c6ef15..000000000 --- a/antlr/.antlr/LexUnicode.java +++ /dev/null @@ -1,190 +0,0 @@ -// Generated from /Users/rowan/Nyaruka/go/src/github.com/nyaruka/goflow/antlr/LexUnicode.g4 by ANTLR 4.7.1 -import org.antlr.v4.runtime.Lexer; -import org.antlr.v4.runtime.CharStream; -import org.antlr.v4.runtime.Token; -import org.antlr.v4.runtime.TokenStream; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.misc.*; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) -public class LexUnicode extends Lexer { - static { RuntimeMetaData.checkVersion("4.7.1", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static String[] channelNames = { - "DEFAULT_TOKEN_CHANNEL", "HIDDEN" - }; - - public static String[] modeNames = { - "DEFAULT_MODE" - }; - - public static final String[] ruleNames = { - "UnicodeLetter", "UnicodeClass_LU", "UnicodeClass_LL", "UnicodeClass_LT", - "UnicodeClass_LM", "UnicodeClass_LO", "UnicodeDigit" - }; - - private static final String[] _LITERAL_NAMES = { - }; - private static final String[] _SYMBOLIC_NAMES = { - }; - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } - - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - - public LexUnicode(CharStream input) { - super(input); - _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @Override - public String getGrammarFileName() { return "LexUnicode.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public String[] getChannelNames() { return channelNames; } - - @Override - public String[] getModeNames() { return modeNames; } - - @Override - public ATN getATN() { return _ATN; } - - public static final String _serializedATN = - "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\2$\b\1\4\2\t\2\4"+ - "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\3\2\3\2\3\2\3\2\3\2\5\2"+ - "\27\n\2\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3\b\2\2\t\3\2\5\2"+ - "\7\2\t\2\13\2\r\2\17\2\3\2\bT\2C\\\u00c2\u00d8\u00da\u00e0\u0102\u0138"+ - "\u013b\u0149\u014c\u017f\u0183\u0184\u0186\u018d\u0190\u0193\u0195\u0196"+ - "\u0198\u019a\u019e\u019f\u01a1\u01a2\u01a4\u01ab\u01ae\u01b5\u01b7\u01be"+ - "\u01c6\u01cf\u01d1\u01dd\u01e0\u01f0\u01f3\u01f6\u01f8\u01fa\u01fc\u0234"+ - "\u023c\u023d\u023f\u0240\u0243\u0248\u024a\u0250\u0372\u0374\u0378\u0381"+ - "\u0388\u038c\u038e\u03a3\u03a5\u03ad\u03d1\u03d6\u03da\u03f0\u03f6\u03f9"+ - "\u03fb\u03fc\u03ff\u0431\u0462\u0482\u048c\u04cf\u04d2\u0530\u0533\u0558"+ - "\u10a2\u10c7\u10c9\u10cf\u1e02\u1e96\u1ea0\u1f00\u1f0a\u1f11\u1f1a\u1f1f"+ - "\u1f2a\u1f31\u1f3a\u1f41\u1f4a\u1f4f\u1f5b\u1f61\u1f6a\u1f71\u1fba\u1fbd"+ - "\u1fca\u1fcd\u1fda\u1fdd\u1fea\u1fee\u1ffa\u1ffd\u2104\u2109\u210d\u210f"+ - "\u2112\u2114\u2117\u211f\u2126\u212f\u2132\u2135\u2140\u2141\u2147\u2185"+ - "\u2c02\u2c30\u2c62\u2c66\u2c69\u2c72\u2c74\u2c77\u2c80\u2c82\u2c84\u2ce4"+ - "\u2ced\u2cef\u2cf4\ua642\ua644\ua66e\ua682\ua69c\ua724\ua730\ua734\ua770"+ - "\ua77b\ua788\ua78d\ua78f\ua792\ua794\ua798\ua7af\ua7b2\ua7b3\uff23\uff3c"+ - "S\2c|\u00b7\u00f8\u00fa\u0101\u0103\u0179\u017c\u0182\u0185\u0187\u018a"+ - "\u0194\u0197\u019d\u01a0\u01a3\u01a5\u01a7\u01aa\u01af\u01b2\u01b6\u01b8"+ - "\u01c1\u01c8\u01ce\u01d0\u01f5\u01f7\u01fb\u01fd\u023b\u023e\u0244\u0249"+ - "\u0295\u0297\u02b1\u0373\u0375\u0379\u037f\u0392\u03d0\u03d2\u03d3\u03d7"+ - "\u03d9\u03db\u03f5\u03f7\u0461\u0463\u0483\u048d\u04c1\u04c4\u0531\u0563"+ - "\u0589\u1d02\u1d2d\u1d6d\u1d79\u1d7b\u1d9c\u1e03\u1e9f\u1ea1\u1f09\u1f12"+ - "\u1f17\u1f22\u1f29\u1f32\u1f39\u1f42\u1f47\u1f52\u1f59\u1f62\u1f69\u1f72"+ - "\u1f7f\u1f82\u1f89\u1f92\u1f99\u1fa2\u1fa9\u1fb2\u1fb6\u1fb8\u1fb9\u1fc0"+ - "\u1fc6\u1fc8\u1fc9\u1fd2\u1fd5\u1fd8\u1fd9\u1fe2\u1fe9\u1ff4\u1ff6\u1ff8"+ - "\u1ff9\u210c\u2115\u2131\u213b\u213e\u213f\u2148\u214b\u2150\u2186\u2c32"+ - "\u2c60\u2c63\u2c6e\u2c73\u2c7d\u2c83\u2cee\u2cf0\u2cf5\u2d02\u2d27\u2d29"+ - "\u2d2f\ua643\ua66f\ua683\ua69d\ua725\ua733\ua735\ua77a\ua77c\ua77e\ua781"+ - "\ua789\ua78e\ua790\ua793\ua797\ua799\ua7ab\ua7fc\uab5c\uab66\uab67\ufb02"+ - "\ufb08\ufb15\ufb19\uff43\uff5c\b\2\u01c7\u01cd\u01f4\u1f91\u1f9a\u1fa1"+ - "\u1faa\u1fb1\u1fbe\u1fce\u1ffe\u1ffe#\2\u02b2\u02c3\u02c8\u02d3\u02e2"+ - "\u02e6\u02ee\u02f0\u0376\u037c\u055b\u0642\u06e7\u06e8\u07f6\u07f7\u07fc"+ - "\u081c\u0826\u082a\u0973\u0e48\u0ec8\u10fe\u17d9\u1845\u1aa9\u1c7f\u1d2e"+ - "\u1d6c\u1d7a\u1dc1\u2073\u2081\u2092\u209e\u2c7e\u2c7f\u2d71\u2e31\u3007"+ - "\u3037\u303d\u3100\ua017\ua4ff\ua60e\ua681\ua69e\ua69f\ua719\ua721\ua772"+ - "\ua78a\ua7fa\ua7fb\ua9d1\ua9e8\uaa72\uaadf\uaaf5\uaaf6\uab5e\uab61\uff72"+ - "\uffa1\u00ec\2\u00ac\u00bc\u01bd\u01c5\u0296\u05ec\u05f2\u05f4\u0622\u0641"+ - "\u0643\u064c\u0670\u0671\u0673\u06d5\u06d7\u06fe\u0701\u0712\u0714\u0731"+ - "\u074f\u07a7\u07b3\u07ec\u0802\u0817\u0842\u085a\u08a2\u08b4\u0906\u093b"+ - "\u093f\u0952\u095a\u0963\u0974\u0982\u0987\u098e\u0991\u0992\u0995\u09aa"+ - "\u09ac\u09b2\u09b4\u09bb\u09bf\u09d0\u09de\u09df\u09e1\u09e3\u09f2\u09f3"+ - "\u0a07\u0a0c\u0a11\u0a12\u0a15\u0a2a\u0a2c\u0a32\u0a34\u0a35\u0a37\u0a38"+ - "\u0a3a\u0a3b\u0a5b\u0a5e\u0a60\u0a76\u0a87\u0a8f\u0a91\u0a93\u0a95\u0aaa"+ - "\u0aac\u0ab2\u0ab4\u0ab5\u0ab7\u0abb\u0abf\u0ad2\u0ae2\u0ae3\u0b07\u0b0e"+ - "\u0b11\u0b12\u0b15\u0b2a\u0b2c\u0b32\u0b34\u0b35\u0b37\u0b3b\u0b3f\u0b63"+ - "\u0b73\u0b85\u0b87\u0b8c\u0b90\u0b92\u0b94\u0b97\u0b9b\u0b9c\u0b9e\u0bac"+ - "\u0bb0\u0bbb\u0bd2\u0c0e\u0c10\u0c12\u0c14\u0c2a\u0c2c\u0c3b\u0c3f\u0c8e"+ - "\u0c90\u0c92\u0c94\u0caa\u0cac\u0cb5\u0cb7\u0cbb\u0cbf\u0ce0\u0ce2\u0ce3"+ - "\u0cf3\u0cf4\u0d07\u0d0e\u0d10\u0d12\u0d14\u0d3c\u0d3f\u0d50\u0d62\u0d63"+ - "\u0d7c\u0d81\u0d87\u0d98\u0d9c\u0db3\u0db5\u0dbd\u0dbf\u0dc8\u0e03\u0e32"+ - "\u0e34\u0e35\u0e42\u0e47\u0e83\u0e84\u0e86\u0e8c\u0e8f\u0e99\u0e9b\u0ea1"+ - "\u0ea3\u0ea5\u0ea7\u0ea9\u0eac\u0ead\u0eaf\u0eb2\u0eb4\u0eb5\u0ebf\u0ec6"+ - "\u0ede\u0ee1\u0f02\u0f49\u0f4b\u0f6e\u0f8a\u0f8e\u1002\u102c\u1041\u1057"+ - "\u105c\u105f\u1063\u1072\u1077\u1083\u1090\u10fc\u10ff\u124a\u124c\u124f"+ - "\u1252\u1258\u125a\u125f\u1262\u128a\u128c\u128f\u1292\u12b2\u12b4\u12b7"+ - "\u12ba\u12c0\u12c2\u12c7\u12ca\u12d8\u12da\u1312\u1314\u1317\u131a\u135c"+ - "\u1382\u1391\u13a2\u13f6\u1403\u166e\u1671\u1681\u1683\u169c\u16a2\u16ec"+ - "\u16f3\u16fa\u1702\u170e\u1710\u1713\u1722\u1733\u1742\u1753\u1762\u176e"+ - "\u1770\u1772\u1782\u17b5\u17de\u1844\u1846\u1879\u1882\u18aa\u18ac\u18f7"+ - "\u1902\u1920\u1952\u196f\u1972\u1976\u1982\u19ad\u19c3\u19c9\u1a02\u1a18"+ - "\u1a22\u1a56\u1b07\u1b35\u1b47\u1b4d\u1b85\u1ba2\u1bb0\u1bb1\u1bbc\u1be7"+ - "\u1c02\u1c25\u1c4f\u1c51\u1c5c\u1c79\u1ceb\u1cee\u1cf0\u1cf3\u1cf7\u1cf8"+ - "\u2137\u213a\u2d32\u2d69\u2d82\u2d98\u2da2\u2da8\u2daa\u2db0\u2db2\u2db8"+ - "\u2dba\u2dc0\u2dc2\u2dc8\u2dca\u2dd0\u2dd2\u2dd8\u2dda\u2de0\u3008\u303e"+ - "\u3043\u3098\u30a1\u30fc\u3101\u312f\u3133\u3190\u31a2\u31bc\u31f2\u3201"+ - "\u3402\u4db7\u4e02\u9fce\ua002\ua016\ua018\ua48e\ua4d2\ua4f9\ua502\ua60d"+ - "\ua612\ua621\ua62c\ua62d\ua670\ua6e7\ua7f9\ua803\ua805\ua807\ua809\ua80c"+ - "\ua80e\ua824\ua842\ua875\ua884\ua8b5\ua8f4\ua8f9\ua8fd\ua927\ua932\ua948"+ - "\ua962\ua97e\ua986\ua9b4\ua9e2\ua9e6\ua9e9\ua9f1\ua9fc\uaa00\uaa02\uaa2a"+ - "\uaa42\uaa44\uaa46\uaa4d\uaa62\uaa71\uaa73\uaa78\uaa7c\uaab1\uaab3\uaabf"+ - "\uaac2\uaac4\uaadd\uaade\uaae2\uaaec\uaaf4\uab08\uab0b\uab10\uab13\uab18"+ - "\uab22\uab28\uab2a\uab30\uabc2\uabe4\uac02\ud7a5\ud7b2\ud7c8\ud7cd\ud7fd"+ - "\uf902\ufa6f\ufa72\ufadb\ufb1f\ufb2a\ufb2c\ufb38\ufb3a\ufb3e\ufb40\ufbb3"+ - "\ufbd5\ufd3f\ufd52\ufd91\ufd94\ufdc9\ufdf2\ufdfd\ufe72\ufe76\ufe78\ufefe"+ - "\uff68\uff71\uff73\uff9f\uffa2\uffc0\uffc4\uffc9\uffcc\uffd1\uffd4\uffd9"+ - "\uffdc\uffde\'\2\62;\u0662\u066b\u06f2\u06fb\u07c2\u07cb\u0968\u0971\u09e8"+ - "\u09f1\u0a68\u0a71\u0ae8\u0af1\u0b68\u0b71\u0be8\u0bf1\u0c68\u0c71\u0ce8"+ - "\u0cf1\u0d68\u0d71\u0de8\u0df1\u0e52\u0e5b\u0ed2\u0edb\u0f22\u0f2b\u1042"+ - "\u104b\u1092\u109b\u17e2\u17eb\u1812\u181b\u1948\u1951\u19d2\u19db\u1a82"+ - "\u1a8b\u1a92\u1a9b\u1b52\u1b5b\u1bb2\u1bbb\u1c42\u1c4b\u1c52\u1c5b\ua622"+ - "\ua62b\ua8d2\ua8db\ua902\ua90b\ua9d2\ua9db\ua9f2\ua9fb\uaa52\uaa5b\uabf2"+ - "\uabfb\uff12\uff1b\2 \3\26\3\2\2\2\5\30\3\2\2\2\7\32\3\2\2\2\t\34\3\2"+ - "\2\2\13\36\3\2\2\2\r \3\2\2\2\17\"\3\2\2\2\21\27\5\5\3\2\22\27\5\7\4\2"+ - "\23\27\5\t\5\2\24\27\5\13\6\2\25\27\5\r\7\2\26\21\3\2\2\2\26\22\3\2\2"+ - "\2\26\23\3\2\2\2\26\24\3\2\2\2\26\25\3\2\2\2\27\4\3\2\2\2\30\31\t\2\2"+ - "\2\31\6\3\2\2\2\32\33\t\3\2\2\33\b\3\2\2\2\34\35\t\4\2\2\35\n\3\2\2\2"+ - "\36\37\t\5\2\2\37\f\3\2\2\2 !\t\6\2\2!\16\3\2\2\2\"#\t\7\2\2#\20\3\2\2"+ - "\2\4\2\26\2"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/antlr/.antlr/LexUnicode.tokens b/antlr/.antlr/LexUnicode.tokens deleted file mode 100644 index e69de29bb..000000000 diff --git a/antlr/Excellent1.g4 b/antlr/Excellent1.g4 new file mode 100644 index 000000000..d8467a91b --- /dev/null +++ b/antlr/Excellent1.g4 @@ -0,0 +1,74 @@ +grammar Excellent1; + +// rebuild with % antlr4 -Dlanguage=Go Excellent1.g4 -o ../legacy/gen -package gen -visitor + +import LexUnicode; + +COMMA : ','; +LPAREN : '('; +RPAREN : ')'; +LBRACK : '['; +RBRACK : ']'; + +DOT : '.'; + +PLUS : '+'; +MINUS : '-'; +TIMES : '*'; +DIVIDE : '/'; +EXPONENT : '^'; + +EQ : '='; +NEQ : '<>'; + +LTE : '<='; +LT : '<'; +GTE : '>='; +GT : '>'; + +AMPERSAND : '&'; + +DECIMAL : [0-9]+('.'[0-9]+)?; +STRING : '"' (~["] | '""')* '"'; + +TRUE : [Tt][Rr][Uu][Ee]; +FALSE : [Ff][Aa][Ll][Ss][Ee]; +NULL : [Nn][Uu][Ll][Ll]; + +NAME : UnicodeLetter+ (UnicodeLetter | UnicodeDigit | '_')*; // variable names, e.g. contact.name or function names, e.g. SUM + +WS : [ \t\n\r]+ -> skip; // ignore whitespace + +ERROR : . ; + +parse : expression EOF; + +atom : fnname LPAREN parameters? RPAREN # functionCall + | atom DOT atom # dotLookup + | atom LBRACK expression RBRACK # arrayLookup + | NAME # contextReference + | STRING # stringLiteral + | DECIMAL # decimalLiteral + | TRUE # true + | FALSE # false + | NULL # null + ; + +expression : atom # atomReference + | MINUS expression # negation + | expression EXPONENT expression # exponent + | expression op=(TIMES | DIVIDE) expression # multiplicationOrDivision + | expression op=(PLUS | MINUS) expression # additionOrSubtraction + | expression op=(LTE | LT | GTE | GT) expression # comparison + | expression op=(EQ | NEQ) expression # equality + | expression AMPERSAND expression # concatenation + | LPAREN expression RPAREN # parentheses + ; + +fnname : NAME + | TRUE + | FALSE + ; + +parameters : expression (COMMA expression)* # functionParameters + ; \ No newline at end of file diff --git a/antlr/Excellent2.g4 b/antlr/Excellent2.g4 index a816b912b..91eb14940 100644 --- a/antlr/Excellent2.g4 +++ b/antlr/Excellent2.g4 @@ -65,10 +65,7 @@ expression : atom # atomReference | LPAREN expression RPAREN # parentheses ; -fnname : NAME - | TRUE - | FALSE - ; +fnname : NAME; parameters : expression (COMMA expression)* # functionParameters ; \ No newline at end of file diff --git a/excellent/gen/Excellent2.interp b/excellent/gen/Excellent2.interp index dc5c1a3af..100b01fd2 100644 --- a/excellent/gen/Excellent2.interp +++ b/excellent/gen/Excellent2.interp @@ -65,4 +65,4 @@ parameters atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 28, 88, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 20, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 30, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 40, 10, 3, 12, 3, 14, 3, 43, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 53, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 73, 10, 4, 12, 4, 14, 4, 76, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 7, 6, 83, 10, 6, 12, 6, 14, 6, 86, 11, 6, 3, 6, 2, 4, 4, 6, 7, 2, 4, 6, 8, 10, 2, 7, 3, 2, 11, 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, 2, 14, 15, 4, 2, 23, 24, 26, 26, 2, 100, 2, 12, 3, 2, 2, 2, 4, 29, 3, 2, 2, 2, 6, 52, 3, 2, 2, 2, 8, 77, 3, 2, 2, 2, 10, 79, 3, 2, 2, 2, 12, 13, 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, 30, 3, 2, 2, 2, 23, 30, 7, 26, 2, 2, 24, 30, 7, 22, 2, 2, 25, 30, 7, 21, 2, 2, 26, 30, 7, 23, 2, 2, 27, 30, 7, 24, 2, 2, 28, 30, 7, 25, 2, 2, 29, 15, 3, 2, 2, 2, 29, 23, 3, 2, 2, 2, 29, 24, 3, 2, 2, 2, 29, 25, 3, 2, 2, 2, 29, 26, 3, 2, 2, 2, 29, 27, 3, 2, 2, 2, 29, 28, 3, 2, 2, 2, 30, 41, 3, 2, 2, 2, 31, 32, 12, 10, 2, 2, 32, 33, 7, 8, 2, 2, 33, 40, 5, 4, 3, 11, 34, 35, 12, 9, 2, 2, 35, 36, 7, 6, 2, 2, 36, 37, 5, 6, 4, 2, 37, 38, 7, 7, 2, 2, 38, 40, 3, 2, 2, 2, 39, 31, 3, 2, 2, 2, 39, 34, 3, 2, 2, 2, 40, 43, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 5, 3, 2, 2, 2, 43, 41, 3, 2, 2, 2, 44, 45, 8, 4, 1, 2, 45, 53, 5, 4, 3, 2, 46, 47, 7, 10, 2, 2, 47, 53, 5, 6, 4, 10, 48, 49, 7, 4, 2, 2, 49, 50, 5, 6, 4, 2, 50, 51, 7, 5, 2, 2, 51, 53, 3, 2, 2, 2, 52, 44, 3, 2, 2, 2, 52, 46, 3, 2, 2, 2, 52, 48, 3, 2, 2, 2, 53, 74, 3, 2, 2, 2, 54, 55, 12, 9, 2, 2, 55, 56, 7, 13, 2, 2, 56, 73, 5, 6, 4, 10, 57, 58, 12, 8, 2, 2, 58, 59, 9, 2, 2, 2, 59, 73, 5, 6, 4, 9, 60, 61, 12, 7, 2, 2, 61, 62, 9, 3, 2, 2, 62, 73, 5, 6, 4, 8, 63, 64, 12, 6, 2, 2, 64, 65, 9, 4, 2, 2, 65, 73, 5, 6, 4, 7, 66, 67, 12, 5, 2, 2, 67, 68, 9, 5, 2, 2, 68, 73, 5, 6, 4, 6, 69, 70, 12, 4, 2, 2, 70, 71, 7, 20, 2, 2, 71, 73, 5, 6, 4, 5, 72, 54, 3, 2, 2, 2, 72, 57, 3, 2, 2, 2, 72, 60, 3, 2, 2, 2, 72, 63, 3, 2, 2, 2, 72, 66, 3, 2, 2, 2, 72, 69, 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 7, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 78, 9, 6, 2, 2, 78, 9, 3, 2, 2, 2, 79, 84, 5, 6, 4, 2, 80, 81, 7, 3, 2, 2, 81, 83, 5, 6, 4, 2, 82, 80, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 11, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 10, 19, 29, 39, 41, 52, 72, 74, 84] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 28, 88, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 20, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 30, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 40, 10, 3, 12, 3, 14, 3, 43, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 53, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 73, 10, 4, 12, 4, 14, 4, 76, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 7, 6, 83, 10, 6, 12, 6, 14, 6, 86, 11, 6, 3, 6, 2, 4, 4, 6, 7, 2, 4, 6, 8, 10, 2, 6, 3, 2, 11, 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, 2, 14, 15, 2, 100, 2, 12, 3, 2, 2, 2, 4, 29, 3, 2, 2, 2, 6, 52, 3, 2, 2, 2, 8, 77, 3, 2, 2, 2, 10, 79, 3, 2, 2, 2, 12, 13, 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, 30, 3, 2, 2, 2, 23, 30, 7, 26, 2, 2, 24, 30, 7, 22, 2, 2, 25, 30, 7, 21, 2, 2, 26, 30, 7, 23, 2, 2, 27, 30, 7, 24, 2, 2, 28, 30, 7, 25, 2, 2, 29, 15, 3, 2, 2, 2, 29, 23, 3, 2, 2, 2, 29, 24, 3, 2, 2, 2, 29, 25, 3, 2, 2, 2, 29, 26, 3, 2, 2, 2, 29, 27, 3, 2, 2, 2, 29, 28, 3, 2, 2, 2, 30, 41, 3, 2, 2, 2, 31, 32, 12, 10, 2, 2, 32, 33, 7, 8, 2, 2, 33, 40, 5, 4, 3, 11, 34, 35, 12, 9, 2, 2, 35, 36, 7, 6, 2, 2, 36, 37, 5, 6, 4, 2, 37, 38, 7, 7, 2, 2, 38, 40, 3, 2, 2, 2, 39, 31, 3, 2, 2, 2, 39, 34, 3, 2, 2, 2, 40, 43, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 5, 3, 2, 2, 2, 43, 41, 3, 2, 2, 2, 44, 45, 8, 4, 1, 2, 45, 53, 5, 4, 3, 2, 46, 47, 7, 10, 2, 2, 47, 53, 5, 6, 4, 10, 48, 49, 7, 4, 2, 2, 49, 50, 5, 6, 4, 2, 50, 51, 7, 5, 2, 2, 51, 53, 3, 2, 2, 2, 52, 44, 3, 2, 2, 2, 52, 46, 3, 2, 2, 2, 52, 48, 3, 2, 2, 2, 53, 74, 3, 2, 2, 2, 54, 55, 12, 9, 2, 2, 55, 56, 7, 13, 2, 2, 56, 73, 5, 6, 4, 10, 57, 58, 12, 8, 2, 2, 58, 59, 9, 2, 2, 2, 59, 73, 5, 6, 4, 9, 60, 61, 12, 7, 2, 2, 61, 62, 9, 3, 2, 2, 62, 73, 5, 6, 4, 8, 63, 64, 12, 6, 2, 2, 64, 65, 9, 4, 2, 2, 65, 73, 5, 6, 4, 7, 66, 67, 12, 5, 2, 2, 67, 68, 9, 5, 2, 2, 68, 73, 5, 6, 4, 6, 69, 70, 12, 4, 2, 2, 70, 71, 7, 20, 2, 2, 71, 73, 5, 6, 4, 5, 72, 54, 3, 2, 2, 2, 72, 57, 3, 2, 2, 2, 72, 60, 3, 2, 2, 2, 72, 63, 3, 2, 2, 2, 72, 66, 3, 2, 2, 2, 72, 69, 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 7, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 78, 7, 26, 2, 2, 78, 9, 3, 2, 2, 2, 79, 84, 5, 6, 4, 2, 80, 81, 7, 3, 2, 2, 81, 83, 5, 6, 4, 2, 82, 80, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 11, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 10, 19, 29, 39, 41, 52, 72, 74, 84] \ No newline at end of file diff --git a/excellent/gen/excellent2_parser.go b/excellent/gen/excellent2_parser.go index d2e214152..57d6e7d08 100644 --- a/excellent/gen/excellent2_parser.go +++ b/excellent/gen/excellent2_parser.go @@ -24,36 +24,36 @@ var parserATN = []uint16{ 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 73, 10, 4, 12, 4, 14, 4, 76, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 7, 6, 83, 10, 6, 12, 6, 14, 6, 86, 11, 6, 3, 6, 2, 4, 4, - 6, 7, 2, 4, 6, 8, 10, 2, 7, 3, 2, 11, 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, - 2, 14, 15, 4, 2, 23, 24, 26, 26, 2, 100, 2, 12, 3, 2, 2, 2, 4, 29, 3, 2, - 2, 2, 6, 52, 3, 2, 2, 2, 8, 77, 3, 2, 2, 2, 10, 79, 3, 2, 2, 2, 12, 13, - 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, - 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, - 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, - 30, 3, 2, 2, 2, 23, 30, 7, 26, 2, 2, 24, 30, 7, 22, 2, 2, 25, 30, 7, 21, - 2, 2, 26, 30, 7, 23, 2, 2, 27, 30, 7, 24, 2, 2, 28, 30, 7, 25, 2, 2, 29, - 15, 3, 2, 2, 2, 29, 23, 3, 2, 2, 2, 29, 24, 3, 2, 2, 2, 29, 25, 3, 2, 2, - 2, 29, 26, 3, 2, 2, 2, 29, 27, 3, 2, 2, 2, 29, 28, 3, 2, 2, 2, 30, 41, - 3, 2, 2, 2, 31, 32, 12, 10, 2, 2, 32, 33, 7, 8, 2, 2, 33, 40, 5, 4, 3, - 11, 34, 35, 12, 9, 2, 2, 35, 36, 7, 6, 2, 2, 36, 37, 5, 6, 4, 2, 37, 38, - 7, 7, 2, 2, 38, 40, 3, 2, 2, 2, 39, 31, 3, 2, 2, 2, 39, 34, 3, 2, 2, 2, - 40, 43, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 5, 3, 2, - 2, 2, 43, 41, 3, 2, 2, 2, 44, 45, 8, 4, 1, 2, 45, 53, 5, 4, 3, 2, 46, 47, - 7, 10, 2, 2, 47, 53, 5, 6, 4, 10, 48, 49, 7, 4, 2, 2, 49, 50, 5, 6, 4, - 2, 50, 51, 7, 5, 2, 2, 51, 53, 3, 2, 2, 2, 52, 44, 3, 2, 2, 2, 52, 46, - 3, 2, 2, 2, 52, 48, 3, 2, 2, 2, 53, 74, 3, 2, 2, 2, 54, 55, 12, 9, 2, 2, - 55, 56, 7, 13, 2, 2, 56, 73, 5, 6, 4, 10, 57, 58, 12, 8, 2, 2, 58, 59, - 9, 2, 2, 2, 59, 73, 5, 6, 4, 9, 60, 61, 12, 7, 2, 2, 61, 62, 9, 3, 2, 2, - 62, 73, 5, 6, 4, 8, 63, 64, 12, 6, 2, 2, 64, 65, 9, 4, 2, 2, 65, 73, 5, - 6, 4, 7, 66, 67, 12, 5, 2, 2, 67, 68, 9, 5, 2, 2, 68, 73, 5, 6, 4, 6, 69, - 70, 12, 4, 2, 2, 70, 71, 7, 20, 2, 2, 71, 73, 5, 6, 4, 5, 72, 54, 3, 2, - 2, 2, 72, 57, 3, 2, 2, 2, 72, 60, 3, 2, 2, 2, 72, 63, 3, 2, 2, 2, 72, 66, - 3, 2, 2, 2, 72, 69, 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, - 74, 75, 3, 2, 2, 2, 75, 7, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 78, 9, 6, - 2, 2, 78, 9, 3, 2, 2, 2, 79, 84, 5, 6, 4, 2, 80, 81, 7, 3, 2, 2, 81, 83, - 5, 6, 4, 2, 82, 80, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, - 84, 85, 3, 2, 2, 2, 85, 11, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 10, 19, 29, - 39, 41, 52, 72, 74, 84, + 6, 7, 2, 4, 6, 8, 10, 2, 6, 3, 2, 11, 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, + 2, 14, 15, 2, 100, 2, 12, 3, 2, 2, 2, 4, 29, 3, 2, 2, 2, 6, 52, 3, 2, 2, + 2, 8, 77, 3, 2, 2, 2, 10, 79, 3, 2, 2, 2, 12, 13, 5, 6, 4, 2, 13, 14, 7, + 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, + 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, + 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, 30, 3, 2, 2, 2, 23, 30, + 7, 26, 2, 2, 24, 30, 7, 22, 2, 2, 25, 30, 7, 21, 2, 2, 26, 30, 7, 23, 2, + 2, 27, 30, 7, 24, 2, 2, 28, 30, 7, 25, 2, 2, 29, 15, 3, 2, 2, 2, 29, 23, + 3, 2, 2, 2, 29, 24, 3, 2, 2, 2, 29, 25, 3, 2, 2, 2, 29, 26, 3, 2, 2, 2, + 29, 27, 3, 2, 2, 2, 29, 28, 3, 2, 2, 2, 30, 41, 3, 2, 2, 2, 31, 32, 12, + 10, 2, 2, 32, 33, 7, 8, 2, 2, 33, 40, 5, 4, 3, 11, 34, 35, 12, 9, 2, 2, + 35, 36, 7, 6, 2, 2, 36, 37, 5, 6, 4, 2, 37, 38, 7, 7, 2, 2, 38, 40, 3, + 2, 2, 2, 39, 31, 3, 2, 2, 2, 39, 34, 3, 2, 2, 2, 40, 43, 3, 2, 2, 2, 41, + 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 5, 3, 2, 2, 2, 43, 41, 3, 2, 2, + 2, 44, 45, 8, 4, 1, 2, 45, 53, 5, 4, 3, 2, 46, 47, 7, 10, 2, 2, 47, 53, + 5, 6, 4, 10, 48, 49, 7, 4, 2, 2, 49, 50, 5, 6, 4, 2, 50, 51, 7, 5, 2, 2, + 51, 53, 3, 2, 2, 2, 52, 44, 3, 2, 2, 2, 52, 46, 3, 2, 2, 2, 52, 48, 3, + 2, 2, 2, 53, 74, 3, 2, 2, 2, 54, 55, 12, 9, 2, 2, 55, 56, 7, 13, 2, 2, + 56, 73, 5, 6, 4, 10, 57, 58, 12, 8, 2, 2, 58, 59, 9, 2, 2, 2, 59, 73, 5, + 6, 4, 9, 60, 61, 12, 7, 2, 2, 61, 62, 9, 3, 2, 2, 62, 73, 5, 6, 4, 8, 63, + 64, 12, 6, 2, 2, 64, 65, 9, 4, 2, 2, 65, 73, 5, 6, 4, 7, 66, 67, 12, 5, + 2, 2, 67, 68, 9, 5, 2, 2, 68, 73, 5, 6, 4, 6, 69, 70, 12, 4, 2, 2, 70, + 71, 7, 20, 2, 2, 71, 73, 5, 6, 4, 5, 72, 54, 3, 2, 2, 2, 72, 57, 3, 2, + 2, 2, 72, 60, 3, 2, 2, 2, 72, 63, 3, 2, 2, 2, 72, 66, 3, 2, 2, 2, 72, 69, + 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, + 75, 7, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 78, 7, 26, 2, 2, 78, 9, 3, 2, + 2, 2, 79, 84, 5, 6, 4, 2, 80, 81, 7, 3, 2, 2, 81, 83, 5, 6, 4, 2, 82, 80, + 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, + 85, 11, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 10, 19, 29, 39, 41, 52, 72, 74, + 84, } var deserializer = antlr.NewATNDeserializer(nil) var deserializedATN = deserializer.DeserializeFromUInt16(parserATN) @@ -1915,14 +1915,6 @@ func (s *FnnameContext) NAME() antlr.TerminalNode { return s.GetToken(Excellent2ParserNAME, 0) } -func (s *FnnameContext) TRUE() antlr.TerminalNode { - return s.GetToken(Excellent2ParserTRUE, 0) -} - -func (s *FnnameContext) FALSE() antlr.TerminalNode { - return s.GetToken(Excellent2ParserFALSE, 0) -} - func (s *FnnameContext) GetRuleContext() antlr.RuleContext { return s } @@ -1956,7 +1948,6 @@ func (s *FnnameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *Excellent2Parser) Fnname() (localctx IFnnameContext) { localctx = NewFnnameContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 6, Excellent2ParserRULE_fnname) - var _la int defer func() { p.ExitRule() @@ -1977,14 +1968,7 @@ func (p *Excellent2Parser) Fnname() (localctx IFnnameContext) { p.EnterOuterAlt(localctx, 1) { p.SetState(75) - _la = p.GetTokenStream().LA(1) - - if !(((_la)&-(0x1f+1)) == 0 && ((1< 4)`, new: `@(1 != 4)`}, {old: `@(1 < 4)`, new: `@(1 < 4)`}, {old: `@(1 <= 4)`, new: `@(1 <= 4)`}, {old: `@(1 > 4)`, new: `@(1 > 4)`}, @@ -252,7 +254,7 @@ type legacyTest struct { } // TestLegacyTests runs the tests from https://github.com/rapidpro/expressions, migrating each template first -func TestLegacyTests(t *testing.T) { +func XTestLegacyTests(t *testing.T) { legacyTestData, err := ioutil.ReadFile("testdata/legacy_tests.json") require.NoError(t, err) diff --git a/antlr/.antlr/Excellent2.interp b/legacy/gen/Excellent1.interp similarity index 99% rename from antlr/.antlr/Excellent2.interp rename to legacy/gen/Excellent1.interp index dc5c1a3af..25f2caff2 100644 --- a/antlr/.antlr/Excellent2.interp +++ b/legacy/gen/Excellent1.interp @@ -12,7 +12,7 @@ null '/' '^' '=' -'!=' +'<>' '<=' '<' '>=' diff --git a/antlr/.antlr/Excellent2Lexer.tokens b/legacy/gen/Excellent1.tokens similarity index 97% rename from antlr/.antlr/Excellent2Lexer.tokens rename to legacy/gen/Excellent1.tokens index 52e89064c..709791104 100644 --- a/antlr/.antlr/Excellent2Lexer.tokens +++ b/legacy/gen/Excellent1.tokens @@ -36,7 +36,7 @@ ERROR=26 '/'=10 '^'=11 '='=12 -'!='=13 +'<>'=13 '<='=14 '<'=15 '>='=16 diff --git a/antlr/.antlr/Excellent2Lexer.interp b/legacy/gen/Excellent1Lexer.interp similarity index 99% rename from antlr/.antlr/Excellent2Lexer.interp rename to legacy/gen/Excellent1Lexer.interp index cd3d70b03..9647513ba 100644 --- a/antlr/.antlr/Excellent2Lexer.interp +++ b/legacy/gen/Excellent1Lexer.interp @@ -12,7 +12,7 @@ null '/' '^' '=' -'!=' +'<>' '<=' '<' '>=' @@ -99,4 +99,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 28, 189, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 110, 10, 20, 13, 20, 14, 20, 111, 3, 20, 3, 20, 6, 20, 116, 10, 20, 13, 20, 14, 20, 117, 5, 20, 120, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 126, 10, 21, 12, 21, 14, 21, 129, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 6, 25, 150, 10, 25, 13, 25, 14, 25, 151, 3, 25, 3, 25, 3, 25, 7, 25, 157, 10, 25, 12, 25, 14, 25, 160, 11, 25, 3, 26, 6, 26, 163, 10, 26, 13, 26, 14, 26, 164, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 176, 10, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 2, 2, 35, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 2, 57, 2, 59, 2, 61, 2, 63, 2, 65, 2, 67, 2, 3, 2, 20, 3, 2, 50, 59, 3, 2, 36, 36, 4, 2, 86, 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, 119, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, 99, 4, 2, 78, 78, 110, 110, 4, 2, 85, 85, 117, 117, 4, 2, 80, 80, 112, 112, 5, 2, 11, 12, 15, 15, 34, 34, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, 332, 383, 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, 418, 420, 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, 504, 506, 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, 897, 904, 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, 1020, 1023, 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, 4295, 4297, 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, 7985, 7994, 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, 8141, 8154, 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, 8468, 8471, 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, 11312, 11362, 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, 11501, 11503, 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, 42864, 42875, 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, 65315, 65340, 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, 391, 394, 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, 456, 462, 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, 885, 889, 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, 1155, 1165, 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, 7580, 7683, 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, 8007, 8018, 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, 8105, 8114, 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, 8153, 8162, 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, 8511, 8520, 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, 11395, 11502, 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, 42653, 42789, 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, 42899, 42903, 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, 64281, 65347, 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, 8126, 8142, 8190, 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, 886, 892, 1371, 1602, 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, 3656, 3784, 4350, 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, 8321, 8338, 8350, 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, 40983, 42239, 42510, 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, 43003, 43473, 43496, 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, 236, 2, 172, 188, 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, 1648, 1649, 1651, 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, 1971, 2028, 2050, 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, 2394, 2403, 2420, 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, 2484, 2491, 2495, 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, 2577, 2578, 2581, 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, 2651, 2654, 2656, 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, 2740, 2741, 2743, 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, 2837, 2858, 2860, 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, 2951, 2956, 2960, 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, 3026, 3086, 3088, 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, 3220, 3242, 3244, 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, 3335, 3342, 3344, 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, 3463, 3480, 3484, 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, 3650, 3655, 3715, 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, 3751, 3753, 3756, 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, 3842, 3913, 3915, 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, 4195, 4210, 4215, 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, 4698, 4703, 4706, 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, 4802, 4807, 4810, 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, 5026, 5110, 5123, 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, 5890, 5902, 5904, 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, 6018, 6069, 6110, 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, 6482, 6511, 6514, 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, 6919, 6965, 6983, 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, 7247, 7249, 7260, 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, 11570, 11625, 11650, 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, 11712, 11714, 11720, 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, 12355, 12440, 12449, 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, 12801, 13314, 19895, 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, 42242, 42509, 42514, 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, 43015, 43017, 43020, 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, 43261, 43303, 43314, 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, 43505, 43516, 43520, 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, 43635, 43640, 43644, 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, 43756, 43764, 43784, 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, 43970, 44004, 44034, 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, 64219, 64287, 64298, 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, 64850, 64913, 64916, 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, 65393, 65395, 65439, 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, 65500, 65502, 39, 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, 2417, 2536, 2545, 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, 3185, 3304, 3313, 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, 3883, 4162, 4171, 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, 6619, 6786, 6795, 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, 7259, 42530, 42539, 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, 43602, 43611, 44018, 44027, 65298, 65307, 2, 195, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 3, 69, 3, 2, 2, 2, 5, 71, 3, 2, 2, 2, 7, 73, 3, 2, 2, 2, 9, 75, 3, 2, 2, 2, 11, 77, 3, 2, 2, 2, 13, 79, 3, 2, 2, 2, 15, 81, 3, 2, 2, 2, 17, 83, 3, 2, 2, 2, 19, 85, 3, 2, 2, 2, 21, 87, 3, 2, 2, 2, 23, 89, 3, 2, 2, 2, 25, 91, 3, 2, 2, 2, 27, 93, 3, 2, 2, 2, 29, 96, 3, 2, 2, 2, 31, 99, 3, 2, 2, 2, 33, 101, 3, 2, 2, 2, 35, 104, 3, 2, 2, 2, 37, 106, 3, 2, 2, 2, 39, 109, 3, 2, 2, 2, 41, 121, 3, 2, 2, 2, 43, 132, 3, 2, 2, 2, 45, 137, 3, 2, 2, 2, 47, 143, 3, 2, 2, 2, 49, 149, 3, 2, 2, 2, 51, 162, 3, 2, 2, 2, 53, 168, 3, 2, 2, 2, 55, 175, 3, 2, 2, 2, 57, 177, 3, 2, 2, 2, 59, 179, 3, 2, 2, 2, 61, 181, 3, 2, 2, 2, 63, 183, 3, 2, 2, 2, 65, 185, 3, 2, 2, 2, 67, 187, 3, 2, 2, 2, 69, 70, 7, 46, 2, 2, 70, 4, 3, 2, 2, 2, 71, 72, 7, 42, 2, 2, 72, 6, 3, 2, 2, 2, 73, 74, 7, 43, 2, 2, 74, 8, 3, 2, 2, 2, 75, 76, 7, 93, 2, 2, 76, 10, 3, 2, 2, 2, 77, 78, 7, 95, 2, 2, 78, 12, 3, 2, 2, 2, 79, 80, 7, 48, 2, 2, 80, 14, 3, 2, 2, 2, 81, 82, 7, 45, 2, 2, 82, 16, 3, 2, 2, 2, 83, 84, 7, 47, 2, 2, 84, 18, 3, 2, 2, 2, 85, 86, 7, 44, 2, 2, 86, 20, 3, 2, 2, 2, 87, 88, 7, 49, 2, 2, 88, 22, 3, 2, 2, 2, 89, 90, 7, 96, 2, 2, 90, 24, 3, 2, 2, 2, 91, 92, 7, 63, 2, 2, 92, 26, 3, 2, 2, 2, 93, 94, 7, 35, 2, 2, 94, 95, 7, 63, 2, 2, 95, 28, 3, 2, 2, 2, 96, 97, 7, 62, 2, 2, 97, 98, 7, 63, 2, 2, 98, 30, 3, 2, 2, 2, 99, 100, 7, 62, 2, 2, 100, 32, 3, 2, 2, 2, 101, 102, 7, 64, 2, 2, 102, 103, 7, 63, 2, 2, 103, 34, 3, 2, 2, 2, 104, 105, 7, 64, 2, 2, 105, 36, 3, 2, 2, 2, 106, 107, 7, 40, 2, 2, 107, 38, 3, 2, 2, 2, 108, 110, 9, 2, 2, 2, 109, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 119, 3, 2, 2, 2, 113, 115, 7, 48, 2, 2, 114, 116, 9, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 117, 3, 2, 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 120, 3, 2, 2, 2, 119, 113, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 40, 3, 2, 2, 2, 121, 127, 7, 36, 2, 2, 122, 126, 10, 3, 2, 2, 123, 124, 7, 36, 2, 2, 124, 126, 7, 36, 2, 2, 125, 122, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 129, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 130, 3, 2, 2, 2, 129, 127, 3, 2, 2, 2, 130, 131, 7, 36, 2, 2, 131, 42, 3, 2, 2, 2, 132, 133, 9, 4, 2, 2, 133, 134, 9, 5, 2, 2, 134, 135, 9, 6, 2, 2, 135, 136, 9, 7, 2, 2, 136, 44, 3, 2, 2, 2, 137, 138, 9, 8, 2, 2, 138, 139, 9, 9, 2, 2, 139, 140, 9, 10, 2, 2, 140, 141, 9, 11, 2, 2, 141, 142, 9, 7, 2, 2, 142, 46, 3, 2, 2, 2, 143, 144, 9, 12, 2, 2, 144, 145, 9, 6, 2, 2, 145, 146, 9, 10, 2, 2, 146, 147, 9, 10, 2, 2, 147, 48, 3, 2, 2, 2, 148, 150, 5, 55, 28, 2, 149, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 158, 3, 2, 2, 2, 153, 157, 5, 55, 28, 2, 154, 157, 5, 67, 34, 2, 155, 157, 7, 97, 2, 2, 156, 153, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 155, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 50, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 161, 163, 9, 13, 2, 2, 162, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 8, 26, 2, 2, 167, 52, 3, 2, 2, 2, 168, 169, 11, 2, 2, 2, 169, 54, 3, 2, 2, 2, 170, 176, 5, 57, 29, 2, 171, 176, 5, 59, 30, 2, 172, 176, 5, 61, 31, 2, 173, 176, 5, 63, 32, 2, 174, 176, 5, 65, 33, 2, 175, 170, 3, 2, 2, 2, 175, 171, 3, 2, 2, 2, 175, 172, 3, 2, 2, 2, 175, 173, 3, 2, 2, 2, 175, 174, 3, 2, 2, 2, 176, 56, 3, 2, 2, 2, 177, 178, 9, 14, 2, 2, 178, 58, 3, 2, 2, 2, 179, 180, 9, 15, 2, 2, 180, 60, 3, 2, 2, 2, 181, 182, 9, 16, 2, 2, 182, 62, 3, 2, 2, 2, 183, 184, 9, 17, 2, 2, 184, 64, 3, 2, 2, 2, 185, 186, 9, 18, 2, 2, 186, 66, 3, 2, 2, 2, 187, 188, 9, 19, 2, 2, 188, 68, 3, 2, 2, 2, 13, 2, 111, 117, 119, 125, 127, 151, 156, 158, 164, 175, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 28, 189, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 110, 10, 20, 13, 20, 14, 20, 111, 3, 20, 3, 20, 6, 20, 116, 10, 20, 13, 20, 14, 20, 117, 5, 20, 120, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 126, 10, 21, 12, 21, 14, 21, 129, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 6, 25, 150, 10, 25, 13, 25, 14, 25, 151, 3, 25, 3, 25, 3, 25, 7, 25, 157, 10, 25, 12, 25, 14, 25, 160, 11, 25, 3, 26, 6, 26, 163, 10, 26, 13, 26, 14, 26, 164, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 176, 10, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 2, 2, 35, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 2, 57, 2, 59, 2, 61, 2, 63, 2, 65, 2, 67, 2, 3, 2, 20, 3, 2, 50, 59, 3, 2, 36, 36, 4, 2, 86, 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, 119, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, 99, 4, 2, 78, 78, 110, 110, 4, 2, 85, 85, 117, 117, 4, 2, 80, 80, 112, 112, 5, 2, 11, 12, 15, 15, 34, 34, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, 332, 383, 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, 418, 420, 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, 504, 506, 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, 897, 904, 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, 1020, 1023, 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, 4295, 4297, 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, 7985, 7994, 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, 8141, 8154, 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, 8468, 8471, 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, 11312, 11362, 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, 11501, 11503, 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, 42864, 42875, 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, 65315, 65340, 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, 391, 394, 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, 456, 462, 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, 885, 889, 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, 1155, 1165, 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, 7580, 7683, 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, 8007, 8018, 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, 8105, 8114, 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, 8153, 8162, 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, 8511, 8520, 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, 11395, 11502, 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, 42653, 42789, 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, 42899, 42903, 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, 64281, 65347, 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, 8126, 8142, 8190, 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, 886, 892, 1371, 1602, 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, 3656, 3784, 4350, 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, 8321, 8338, 8350, 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, 40983, 42239, 42510, 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, 43003, 43473, 43496, 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, 236, 2, 172, 188, 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, 1648, 1649, 1651, 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, 1971, 2028, 2050, 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, 2394, 2403, 2420, 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, 2484, 2491, 2495, 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, 2577, 2578, 2581, 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, 2651, 2654, 2656, 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, 2740, 2741, 2743, 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, 2837, 2858, 2860, 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, 2951, 2956, 2960, 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, 3026, 3086, 3088, 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, 3220, 3242, 3244, 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, 3335, 3342, 3344, 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, 3463, 3480, 3484, 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, 3650, 3655, 3715, 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, 3751, 3753, 3756, 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, 3842, 3913, 3915, 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, 4195, 4210, 4215, 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, 4698, 4703, 4706, 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, 4802, 4807, 4810, 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, 5026, 5110, 5123, 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, 5890, 5902, 5904, 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, 6018, 6069, 6110, 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, 6482, 6511, 6514, 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, 6919, 6965, 6983, 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, 7247, 7249, 7260, 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, 11570, 11625, 11650, 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, 11712, 11714, 11720, 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, 12355, 12440, 12449, 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, 12801, 13314, 19895, 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, 42242, 42509, 42514, 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, 43015, 43017, 43020, 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, 43261, 43303, 43314, 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, 43505, 43516, 43520, 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, 43635, 43640, 43644, 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, 43756, 43764, 43784, 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, 43970, 44004, 44034, 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, 64219, 64287, 64298, 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, 64850, 64913, 64916, 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, 65393, 65395, 65439, 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, 65500, 65502, 39, 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, 2417, 2536, 2545, 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, 3185, 3304, 3313, 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, 3883, 4162, 4171, 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, 6619, 6786, 6795, 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, 7259, 42530, 42539, 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, 43602, 43611, 44018, 44027, 65298, 65307, 2, 195, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 3, 69, 3, 2, 2, 2, 5, 71, 3, 2, 2, 2, 7, 73, 3, 2, 2, 2, 9, 75, 3, 2, 2, 2, 11, 77, 3, 2, 2, 2, 13, 79, 3, 2, 2, 2, 15, 81, 3, 2, 2, 2, 17, 83, 3, 2, 2, 2, 19, 85, 3, 2, 2, 2, 21, 87, 3, 2, 2, 2, 23, 89, 3, 2, 2, 2, 25, 91, 3, 2, 2, 2, 27, 93, 3, 2, 2, 2, 29, 96, 3, 2, 2, 2, 31, 99, 3, 2, 2, 2, 33, 101, 3, 2, 2, 2, 35, 104, 3, 2, 2, 2, 37, 106, 3, 2, 2, 2, 39, 109, 3, 2, 2, 2, 41, 121, 3, 2, 2, 2, 43, 132, 3, 2, 2, 2, 45, 137, 3, 2, 2, 2, 47, 143, 3, 2, 2, 2, 49, 149, 3, 2, 2, 2, 51, 162, 3, 2, 2, 2, 53, 168, 3, 2, 2, 2, 55, 175, 3, 2, 2, 2, 57, 177, 3, 2, 2, 2, 59, 179, 3, 2, 2, 2, 61, 181, 3, 2, 2, 2, 63, 183, 3, 2, 2, 2, 65, 185, 3, 2, 2, 2, 67, 187, 3, 2, 2, 2, 69, 70, 7, 46, 2, 2, 70, 4, 3, 2, 2, 2, 71, 72, 7, 42, 2, 2, 72, 6, 3, 2, 2, 2, 73, 74, 7, 43, 2, 2, 74, 8, 3, 2, 2, 2, 75, 76, 7, 93, 2, 2, 76, 10, 3, 2, 2, 2, 77, 78, 7, 95, 2, 2, 78, 12, 3, 2, 2, 2, 79, 80, 7, 48, 2, 2, 80, 14, 3, 2, 2, 2, 81, 82, 7, 45, 2, 2, 82, 16, 3, 2, 2, 2, 83, 84, 7, 47, 2, 2, 84, 18, 3, 2, 2, 2, 85, 86, 7, 44, 2, 2, 86, 20, 3, 2, 2, 2, 87, 88, 7, 49, 2, 2, 88, 22, 3, 2, 2, 2, 89, 90, 7, 96, 2, 2, 90, 24, 3, 2, 2, 2, 91, 92, 7, 63, 2, 2, 92, 26, 3, 2, 2, 2, 93, 94, 7, 62, 2, 2, 94, 95, 7, 64, 2, 2, 95, 28, 3, 2, 2, 2, 96, 97, 7, 62, 2, 2, 97, 98, 7, 63, 2, 2, 98, 30, 3, 2, 2, 2, 99, 100, 7, 62, 2, 2, 100, 32, 3, 2, 2, 2, 101, 102, 7, 64, 2, 2, 102, 103, 7, 63, 2, 2, 103, 34, 3, 2, 2, 2, 104, 105, 7, 64, 2, 2, 105, 36, 3, 2, 2, 2, 106, 107, 7, 40, 2, 2, 107, 38, 3, 2, 2, 2, 108, 110, 9, 2, 2, 2, 109, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 119, 3, 2, 2, 2, 113, 115, 7, 48, 2, 2, 114, 116, 9, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 117, 3, 2, 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 120, 3, 2, 2, 2, 119, 113, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 40, 3, 2, 2, 2, 121, 127, 7, 36, 2, 2, 122, 126, 10, 3, 2, 2, 123, 124, 7, 36, 2, 2, 124, 126, 7, 36, 2, 2, 125, 122, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 129, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 130, 3, 2, 2, 2, 129, 127, 3, 2, 2, 2, 130, 131, 7, 36, 2, 2, 131, 42, 3, 2, 2, 2, 132, 133, 9, 4, 2, 2, 133, 134, 9, 5, 2, 2, 134, 135, 9, 6, 2, 2, 135, 136, 9, 7, 2, 2, 136, 44, 3, 2, 2, 2, 137, 138, 9, 8, 2, 2, 138, 139, 9, 9, 2, 2, 139, 140, 9, 10, 2, 2, 140, 141, 9, 11, 2, 2, 141, 142, 9, 7, 2, 2, 142, 46, 3, 2, 2, 2, 143, 144, 9, 12, 2, 2, 144, 145, 9, 6, 2, 2, 145, 146, 9, 10, 2, 2, 146, 147, 9, 10, 2, 2, 147, 48, 3, 2, 2, 2, 148, 150, 5, 55, 28, 2, 149, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 158, 3, 2, 2, 2, 153, 157, 5, 55, 28, 2, 154, 157, 5, 67, 34, 2, 155, 157, 7, 97, 2, 2, 156, 153, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 155, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 50, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 161, 163, 9, 13, 2, 2, 162, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 8, 26, 2, 2, 167, 52, 3, 2, 2, 2, 168, 169, 11, 2, 2, 2, 169, 54, 3, 2, 2, 2, 170, 176, 5, 57, 29, 2, 171, 176, 5, 59, 30, 2, 172, 176, 5, 61, 31, 2, 173, 176, 5, 63, 32, 2, 174, 176, 5, 65, 33, 2, 175, 170, 3, 2, 2, 2, 175, 171, 3, 2, 2, 2, 175, 172, 3, 2, 2, 2, 175, 173, 3, 2, 2, 2, 175, 174, 3, 2, 2, 2, 176, 56, 3, 2, 2, 2, 177, 178, 9, 14, 2, 2, 178, 58, 3, 2, 2, 2, 179, 180, 9, 15, 2, 2, 180, 60, 3, 2, 2, 2, 181, 182, 9, 16, 2, 2, 182, 62, 3, 2, 2, 2, 183, 184, 9, 17, 2, 2, 184, 64, 3, 2, 2, 2, 185, 186, 9, 18, 2, 2, 186, 66, 3, 2, 2, 2, 187, 188, 9, 19, 2, 2, 188, 68, 3, 2, 2, 2, 13, 2, 111, 117, 119, 125, 127, 151, 156, 158, 164, 175, 3, 8, 2, 2] \ No newline at end of file diff --git a/antlr/.antlr/Excellent2.tokens b/legacy/gen/Excellent1Lexer.tokens similarity index 97% rename from antlr/.antlr/Excellent2.tokens rename to legacy/gen/Excellent1Lexer.tokens index 52e89064c..709791104 100644 --- a/antlr/.antlr/Excellent2.tokens +++ b/legacy/gen/Excellent1Lexer.tokens @@ -36,7 +36,7 @@ ERROR=26 '/'=10 '^'=11 '='=12 -'!='=13 +'<>'=13 '<='=14 '<'=15 '>='=16 diff --git a/legacy/gen/excellent1_base_listener.go b/legacy/gen/excellent1_base_listener.go new file mode 100644 index 000000000..c3dde0829 --- /dev/null +++ b/legacy/gen/excellent1_base_listener.go @@ -0,0 +1,147 @@ +// Code generated from Excellent1.g4 by ANTLR 4.7.1. DO NOT EDIT. + +package gen // Excellent1 +import "github.com/antlr/antlr4/runtime/Go/antlr" + +// BaseExcellent1Listener is a complete listener for a parse tree produced by Excellent1Parser. +type BaseExcellent1Listener struct{} + +var _ Excellent1Listener = &BaseExcellent1Listener{} + +// VisitTerminal is called when a terminal node is visited. +func (s *BaseExcellent1Listener) VisitTerminal(node antlr.TerminalNode) {} + +// VisitErrorNode is called when an error node is visited. +func (s *BaseExcellent1Listener) VisitErrorNode(node antlr.ErrorNode) {} + +// EnterEveryRule is called when any rule is entered. +func (s *BaseExcellent1Listener) EnterEveryRule(ctx antlr.ParserRuleContext) {} + +// ExitEveryRule is called when any rule is exited. +func (s *BaseExcellent1Listener) ExitEveryRule(ctx antlr.ParserRuleContext) {} + +// EnterParse is called when production parse is entered. +func (s *BaseExcellent1Listener) EnterParse(ctx *ParseContext) {} + +// ExitParse is called when production parse is exited. +func (s *BaseExcellent1Listener) ExitParse(ctx *ParseContext) {} + +// EnterDecimalLiteral is called when production decimalLiteral is entered. +func (s *BaseExcellent1Listener) EnterDecimalLiteral(ctx *DecimalLiteralContext) {} + +// ExitDecimalLiteral is called when production decimalLiteral is exited. +func (s *BaseExcellent1Listener) ExitDecimalLiteral(ctx *DecimalLiteralContext) {} + +// EnterDotLookup is called when production dotLookup is entered. +func (s *BaseExcellent1Listener) EnterDotLookup(ctx *DotLookupContext) {} + +// ExitDotLookup is called when production dotLookup is exited. +func (s *BaseExcellent1Listener) ExitDotLookup(ctx *DotLookupContext) {} + +// EnterNull is called when production null is entered. +func (s *BaseExcellent1Listener) EnterNull(ctx *NullContext) {} + +// ExitNull is called when production null is exited. +func (s *BaseExcellent1Listener) ExitNull(ctx *NullContext) {} + +// EnterStringLiteral is called when production stringLiteral is entered. +func (s *BaseExcellent1Listener) EnterStringLiteral(ctx *StringLiteralContext) {} + +// ExitStringLiteral is called when production stringLiteral is exited. +func (s *BaseExcellent1Listener) ExitStringLiteral(ctx *StringLiteralContext) {} + +// EnterFunctionCall is called when production functionCall is entered. +func (s *BaseExcellent1Listener) EnterFunctionCall(ctx *FunctionCallContext) {} + +// ExitFunctionCall is called when production functionCall is exited. +func (s *BaseExcellent1Listener) ExitFunctionCall(ctx *FunctionCallContext) {} + +// EnterTrue is called when production true is entered. +func (s *BaseExcellent1Listener) EnterTrue(ctx *TrueContext) {} + +// ExitTrue is called when production true is exited. +func (s *BaseExcellent1Listener) ExitTrue(ctx *TrueContext) {} + +// EnterFalse is called when production false is entered. +func (s *BaseExcellent1Listener) EnterFalse(ctx *FalseContext) {} + +// ExitFalse is called when production false is exited. +func (s *BaseExcellent1Listener) ExitFalse(ctx *FalseContext) {} + +// EnterArrayLookup is called when production arrayLookup is entered. +func (s *BaseExcellent1Listener) EnterArrayLookup(ctx *ArrayLookupContext) {} + +// ExitArrayLookup is called when production arrayLookup is exited. +func (s *BaseExcellent1Listener) ExitArrayLookup(ctx *ArrayLookupContext) {} + +// EnterContextReference is called when production contextReference is entered. +func (s *BaseExcellent1Listener) EnterContextReference(ctx *ContextReferenceContext) {} + +// ExitContextReference is called when production contextReference is exited. +func (s *BaseExcellent1Listener) ExitContextReference(ctx *ContextReferenceContext) {} + +// EnterParentheses is called when production parentheses is entered. +func (s *BaseExcellent1Listener) EnterParentheses(ctx *ParenthesesContext) {} + +// ExitParentheses is called when production parentheses is exited. +func (s *BaseExcellent1Listener) ExitParentheses(ctx *ParenthesesContext) {} + +// EnterNegation is called when production negation is entered. +func (s *BaseExcellent1Listener) EnterNegation(ctx *NegationContext) {} + +// ExitNegation is called when production negation is exited. +func (s *BaseExcellent1Listener) ExitNegation(ctx *NegationContext) {} + +// EnterComparison is called when production comparison is entered. +func (s *BaseExcellent1Listener) EnterComparison(ctx *ComparisonContext) {} + +// ExitComparison is called when production comparison is exited. +func (s *BaseExcellent1Listener) ExitComparison(ctx *ComparisonContext) {} + +// EnterConcatenation is called when production concatenation is entered. +func (s *BaseExcellent1Listener) EnterConcatenation(ctx *ConcatenationContext) {} + +// ExitConcatenation is called when production concatenation is exited. +func (s *BaseExcellent1Listener) ExitConcatenation(ctx *ConcatenationContext) {} + +// EnterMultiplicationOrDivision is called when production multiplicationOrDivision is entered. +func (s *BaseExcellent1Listener) EnterMultiplicationOrDivision(ctx *MultiplicationOrDivisionContext) {} + +// ExitMultiplicationOrDivision is called when production multiplicationOrDivision is exited. +func (s *BaseExcellent1Listener) ExitMultiplicationOrDivision(ctx *MultiplicationOrDivisionContext) {} + +// EnterAtomReference is called when production atomReference is entered. +func (s *BaseExcellent1Listener) EnterAtomReference(ctx *AtomReferenceContext) {} + +// ExitAtomReference is called when production atomReference is exited. +func (s *BaseExcellent1Listener) ExitAtomReference(ctx *AtomReferenceContext) {} + +// EnterAdditionOrSubtraction is called when production additionOrSubtraction is entered. +func (s *BaseExcellent1Listener) EnterAdditionOrSubtraction(ctx *AdditionOrSubtractionContext) {} + +// ExitAdditionOrSubtraction is called when production additionOrSubtraction is exited. +func (s *BaseExcellent1Listener) ExitAdditionOrSubtraction(ctx *AdditionOrSubtractionContext) {} + +// EnterEquality is called when production equality is entered. +func (s *BaseExcellent1Listener) EnterEquality(ctx *EqualityContext) {} + +// ExitEquality is called when production equality is exited. +func (s *BaseExcellent1Listener) ExitEquality(ctx *EqualityContext) {} + +// EnterExponent is called when production exponent is entered. +func (s *BaseExcellent1Listener) EnterExponent(ctx *ExponentContext) {} + +// ExitExponent is called when production exponent is exited. +func (s *BaseExcellent1Listener) ExitExponent(ctx *ExponentContext) {} + +// EnterFnname is called when production fnname is entered. +func (s *BaseExcellent1Listener) EnterFnname(ctx *FnnameContext) {} + +// ExitFnname is called when production fnname is exited. +func (s *BaseExcellent1Listener) ExitFnname(ctx *FnnameContext) {} + +// EnterFunctionParameters is called when production functionParameters is entered. +func (s *BaseExcellent1Listener) EnterFunctionParameters(ctx *FunctionParametersContext) {} + +// ExitFunctionParameters is called when production functionParameters is exited. +func (s *BaseExcellent1Listener) ExitFunctionParameters(ctx *FunctionParametersContext) {} diff --git a/legacy/gen/excellent1_base_visitor.go b/legacy/gen/excellent1_base_visitor.go new file mode 100644 index 000000000..146bd5684 --- /dev/null +++ b/legacy/gen/excellent1_base_visitor.go @@ -0,0 +1,92 @@ +// Code generated from Excellent1.g4 by ANTLR 4.7.1. DO NOT EDIT. + +package gen // Excellent1 +import "github.com/antlr/antlr4/runtime/Go/antlr" + +type BaseExcellent1Visitor struct { + *antlr.BaseParseTreeVisitor +} + +func (v *BaseExcellent1Visitor) VisitParse(ctx *ParseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitDecimalLiteral(ctx *DecimalLiteralContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitDotLookup(ctx *DotLookupContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitNull(ctx *NullContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitStringLiteral(ctx *StringLiteralContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitFunctionCall(ctx *FunctionCallContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitTrue(ctx *TrueContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitFalse(ctx *FalseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitArrayLookup(ctx *ArrayLookupContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitContextReference(ctx *ContextReferenceContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitParentheses(ctx *ParenthesesContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitNegation(ctx *NegationContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitComparison(ctx *ComparisonContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitConcatenation(ctx *ConcatenationContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitMultiplicationOrDivision(ctx *MultiplicationOrDivisionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitAtomReference(ctx *AtomReferenceContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitAdditionOrSubtraction(ctx *AdditionOrSubtractionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitEquality(ctx *EqualityContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitExponent(ctx *ExponentContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitFnname(ctx *FnnameContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent1Visitor) VisitFunctionParameters(ctx *FunctionParametersContext) interface{} { + return v.VisitChildren(ctx) +} diff --git a/legacy/gen/excellent1_lexer.go b/legacy/gen/excellent1_lexer.go new file mode 100644 index 000000000..c397155a7 --- /dev/null +++ b/legacy/gen/excellent1_lexer.go @@ -0,0 +1,275 @@ +// Code generated from Excellent1.g4 by ANTLR 4.7.1. DO NOT EDIT. + +package gen + +import ( + "fmt" + "unicode" + + "github.com/antlr/antlr4/runtime/Go/antlr" +) + +// Suppress unused import error +var _ = fmt.Printf +var _ = unicode.IsLetter + +var serializedLexerAtn = []uint16{ + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 28, 189, + 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, + 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, + 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, + 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, + 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, + 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, + 4, 34, 9, 34, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, + 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, + 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, + 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 110, + 10, 20, 13, 20, 14, 20, 111, 3, 20, 3, 20, 6, 20, 116, 10, 20, 13, 20, + 14, 20, 117, 5, 20, 120, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 126, + 10, 21, 12, 21, 14, 21, 129, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, + 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, + 24, 3, 24, 3, 24, 3, 25, 6, 25, 150, 10, 25, 13, 25, 14, 25, 151, 3, 25, + 3, 25, 3, 25, 7, 25, 157, 10, 25, 12, 25, 14, 25, 160, 11, 25, 3, 26, 6, + 26, 163, 10, 26, 13, 26, 14, 26, 164, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, + 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 176, 10, 28, 3, 29, 3, 29, 3, 30, 3, + 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 2, 2, 35, 3, + 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, + 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, + 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 2, 57, 2, 59, 2, 61, + 2, 63, 2, 65, 2, 67, 2, 3, 2, 20, 3, 2, 50, 59, 3, 2, 36, 36, 4, 2, 86, + 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, 119, 4, 2, 71, + 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, 99, 4, 2, 78, 78, + 110, 110, 4, 2, 85, 85, 117, 117, 4, 2, 80, 80, 112, 112, 5, 2, 11, 12, + 15, 15, 34, 34, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, + 332, 383, 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, + 418, 420, 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, + 504, 506, 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, + 897, 904, 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, + 1020, 1023, 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, + 4295, 4297, 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, + 7985, 7994, 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, + 8141, 8154, 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, + 8468, 8471, 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, + 11312, 11362, 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, + 11501, 11503, 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, + 42864, 42875, 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, + 65315, 65340, 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, + 391, 394, 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, + 456, 462, 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, + 885, 889, 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, + 1155, 1165, 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, + 7580, 7683, 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, + 8007, 8018, 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, + 8105, 8114, 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, + 8153, 8162, 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, + 8511, 8520, 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, + 11395, 11502, 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, + 42653, 42789, 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, + 42899, 42903, 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, + 64281, 65347, 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, + 8126, 8142, 8190, 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, + 886, 892, 1371, 1602, 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, + 3656, 3784, 4350, 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, + 8321, 8338, 8350, 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, + 40983, 42239, 42510, 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, + 43003, 43473, 43496, 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, + 236, 2, 172, 188, 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, + 1648, 1649, 1651, 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, + 1971, 2028, 2050, 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, + 2394, 2403, 2420, 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, + 2484, 2491, 2495, 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, + 2577, 2578, 2581, 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, + 2651, 2654, 2656, 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, + 2740, 2741, 2743, 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, + 2837, 2858, 2860, 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, + 2951, 2956, 2960, 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, + 3026, 3086, 3088, 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, + 3220, 3242, 3244, 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, + 3335, 3342, 3344, 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, + 3463, 3480, 3484, 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, + 3650, 3655, 3715, 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, + 3751, 3753, 3756, 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, + 3842, 3913, 3915, 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, + 4195, 4210, 4215, 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, + 4698, 4703, 4706, 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, + 4802, 4807, 4810, 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, + 5026, 5110, 5123, 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, + 5890, 5902, 5904, 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, + 6018, 6069, 6110, 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, + 6482, 6511, 6514, 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, + 6919, 6965, 6983, 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, + 7247, 7249, 7260, 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, + 11570, 11625, 11650, 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, + 11712, 11714, 11720, 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, + 12355, 12440, 12449, 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, + 12801, 13314, 19895, 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, + 42242, 42509, 42514, 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, + 43015, 43017, 43020, 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, + 43261, 43303, 43314, 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, + 43505, 43516, 43520, 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, + 43635, 43640, 43644, 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, + 43756, 43764, 43784, 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, + 43970, 44004, 44034, 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, + 64219, 64287, 64298, 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, + 64850, 64913, 64916, 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, + 65393, 65395, 65439, 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, + 65500, 65502, 39, 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, + 2417, 2536, 2545, 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, + 3185, 3304, 3313, 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, + 3883, 4162, 4171, 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, + 6619, 6786, 6795, 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, + 7259, 42530, 42539, 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, + 43602, 43611, 44018, 44027, 65298, 65307, 2, 195, 2, 3, 3, 2, 2, 2, 2, + 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, + 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, + 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, + 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, + 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, + 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, + 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 3, 69, 3, 2, 2, 2, 5, 71, 3, 2, 2, 2, 7, + 73, 3, 2, 2, 2, 9, 75, 3, 2, 2, 2, 11, 77, 3, 2, 2, 2, 13, 79, 3, 2, 2, + 2, 15, 81, 3, 2, 2, 2, 17, 83, 3, 2, 2, 2, 19, 85, 3, 2, 2, 2, 21, 87, + 3, 2, 2, 2, 23, 89, 3, 2, 2, 2, 25, 91, 3, 2, 2, 2, 27, 93, 3, 2, 2, 2, + 29, 96, 3, 2, 2, 2, 31, 99, 3, 2, 2, 2, 33, 101, 3, 2, 2, 2, 35, 104, 3, + 2, 2, 2, 37, 106, 3, 2, 2, 2, 39, 109, 3, 2, 2, 2, 41, 121, 3, 2, 2, 2, + 43, 132, 3, 2, 2, 2, 45, 137, 3, 2, 2, 2, 47, 143, 3, 2, 2, 2, 49, 149, + 3, 2, 2, 2, 51, 162, 3, 2, 2, 2, 53, 168, 3, 2, 2, 2, 55, 175, 3, 2, 2, + 2, 57, 177, 3, 2, 2, 2, 59, 179, 3, 2, 2, 2, 61, 181, 3, 2, 2, 2, 63, 183, + 3, 2, 2, 2, 65, 185, 3, 2, 2, 2, 67, 187, 3, 2, 2, 2, 69, 70, 7, 46, 2, + 2, 70, 4, 3, 2, 2, 2, 71, 72, 7, 42, 2, 2, 72, 6, 3, 2, 2, 2, 73, 74, 7, + 43, 2, 2, 74, 8, 3, 2, 2, 2, 75, 76, 7, 93, 2, 2, 76, 10, 3, 2, 2, 2, 77, + 78, 7, 95, 2, 2, 78, 12, 3, 2, 2, 2, 79, 80, 7, 48, 2, 2, 80, 14, 3, 2, + 2, 2, 81, 82, 7, 45, 2, 2, 82, 16, 3, 2, 2, 2, 83, 84, 7, 47, 2, 2, 84, + 18, 3, 2, 2, 2, 85, 86, 7, 44, 2, 2, 86, 20, 3, 2, 2, 2, 87, 88, 7, 49, + 2, 2, 88, 22, 3, 2, 2, 2, 89, 90, 7, 96, 2, 2, 90, 24, 3, 2, 2, 2, 91, + 92, 7, 63, 2, 2, 92, 26, 3, 2, 2, 2, 93, 94, 7, 62, 2, 2, 94, 95, 7, 64, + 2, 2, 95, 28, 3, 2, 2, 2, 96, 97, 7, 62, 2, 2, 97, 98, 7, 63, 2, 2, 98, + 30, 3, 2, 2, 2, 99, 100, 7, 62, 2, 2, 100, 32, 3, 2, 2, 2, 101, 102, 7, + 64, 2, 2, 102, 103, 7, 63, 2, 2, 103, 34, 3, 2, 2, 2, 104, 105, 7, 64, + 2, 2, 105, 36, 3, 2, 2, 2, 106, 107, 7, 40, 2, 2, 107, 38, 3, 2, 2, 2, + 108, 110, 9, 2, 2, 2, 109, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, + 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 119, 3, 2, 2, 2, 113, 115, + 7, 48, 2, 2, 114, 116, 9, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 117, 3, 2, + 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 120, 3, 2, 2, 2, + 119, 113, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 40, 3, 2, 2, 2, 121, 127, + 7, 36, 2, 2, 122, 126, 10, 3, 2, 2, 123, 124, 7, 36, 2, 2, 124, 126, 7, + 36, 2, 2, 125, 122, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 129, 3, 2, 2, + 2, 127, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 130, 3, 2, 2, 2, 129, + 127, 3, 2, 2, 2, 130, 131, 7, 36, 2, 2, 131, 42, 3, 2, 2, 2, 132, 133, + 9, 4, 2, 2, 133, 134, 9, 5, 2, 2, 134, 135, 9, 6, 2, 2, 135, 136, 9, 7, + 2, 2, 136, 44, 3, 2, 2, 2, 137, 138, 9, 8, 2, 2, 138, 139, 9, 9, 2, 2, + 139, 140, 9, 10, 2, 2, 140, 141, 9, 11, 2, 2, 141, 142, 9, 7, 2, 2, 142, + 46, 3, 2, 2, 2, 143, 144, 9, 12, 2, 2, 144, 145, 9, 6, 2, 2, 145, 146, + 9, 10, 2, 2, 146, 147, 9, 10, 2, 2, 147, 48, 3, 2, 2, 2, 148, 150, 5, 55, + 28, 2, 149, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, + 151, 152, 3, 2, 2, 2, 152, 158, 3, 2, 2, 2, 153, 157, 5, 55, 28, 2, 154, + 157, 5, 67, 34, 2, 155, 157, 7, 97, 2, 2, 156, 153, 3, 2, 2, 2, 156, 154, + 3, 2, 2, 2, 156, 155, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, + 2, 2, 158, 159, 3, 2, 2, 2, 159, 50, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, + 161, 163, 9, 13, 2, 2, 162, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, + 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, + 8, 26, 2, 2, 167, 52, 3, 2, 2, 2, 168, 169, 11, 2, 2, 2, 169, 54, 3, 2, + 2, 2, 170, 176, 5, 57, 29, 2, 171, 176, 5, 59, 30, 2, 172, 176, 5, 61, + 31, 2, 173, 176, 5, 63, 32, 2, 174, 176, 5, 65, 33, 2, 175, 170, 3, 2, + 2, 2, 175, 171, 3, 2, 2, 2, 175, 172, 3, 2, 2, 2, 175, 173, 3, 2, 2, 2, + 175, 174, 3, 2, 2, 2, 176, 56, 3, 2, 2, 2, 177, 178, 9, 14, 2, 2, 178, + 58, 3, 2, 2, 2, 179, 180, 9, 15, 2, 2, 180, 60, 3, 2, 2, 2, 181, 182, 9, + 16, 2, 2, 182, 62, 3, 2, 2, 2, 183, 184, 9, 17, 2, 2, 184, 64, 3, 2, 2, + 2, 185, 186, 9, 18, 2, 2, 186, 66, 3, 2, 2, 2, 187, 188, 9, 19, 2, 2, 188, + 68, 3, 2, 2, 2, 13, 2, 111, 117, 119, 125, 127, 151, 156, 158, 164, 175, + 3, 8, 2, 2, +} + +var lexerDeserializer = antlr.NewATNDeserializer(nil) +var lexerAtn = lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn) + +var lexerChannelNames = []string{ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", +} + +var lexerModeNames = []string{ + "DEFAULT_MODE", +} + +var lexerLiteralNames = []string{ + "", "','", "'('", "')'", "'['", "']'", "'.'", "'+'", "'-'", "'*'", "'/'", + "'^'", "'='", "'<>'", "'<='", "'<'", "'>='", "'>'", "'&'", +} + +var lexerSymbolicNames = []string{ + "", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", + "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", "AMPERSAND", + "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", +} + +var lexerRuleNames = []string{ + "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", + "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", "AMPERSAND", + "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", "UnicodeLetter", + "UnicodeClass_LU", "UnicodeClass_LL", "UnicodeClass_LT", "UnicodeClass_LM", + "UnicodeClass_LO", "UnicodeDigit", +} + +type Excellent1Lexer struct { + *antlr.BaseLexer + channelNames []string + modeNames []string + // TODO: EOF string +} + +var lexerDecisionToDFA = make([]*antlr.DFA, len(lexerAtn.DecisionToState)) + +func init() { + for index, ds := range lexerAtn.DecisionToState { + lexerDecisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +func NewExcellent1Lexer(input antlr.CharStream) *Excellent1Lexer { + + l := new(Excellent1Lexer) + + l.BaseLexer = antlr.NewBaseLexer(input) + l.Interpreter = antlr.NewLexerATNSimulator(l, lexerAtn, lexerDecisionToDFA, antlr.NewPredictionContextCache()) + + l.channelNames = lexerChannelNames + l.modeNames = lexerModeNames + l.RuleNames = lexerRuleNames + l.LiteralNames = lexerLiteralNames + l.SymbolicNames = lexerSymbolicNames + l.GrammarFileName = "Excellent1.g4" + // TODO: l.EOF = antlr.TokenEOF + + return l +} + +// Excellent1Lexer tokens. +const ( + Excellent1LexerCOMMA = 1 + Excellent1LexerLPAREN = 2 + Excellent1LexerRPAREN = 3 + Excellent1LexerLBRACK = 4 + Excellent1LexerRBRACK = 5 + Excellent1LexerDOT = 6 + Excellent1LexerPLUS = 7 + Excellent1LexerMINUS = 8 + Excellent1LexerTIMES = 9 + Excellent1LexerDIVIDE = 10 + Excellent1LexerEXPONENT = 11 + Excellent1LexerEQ = 12 + Excellent1LexerNEQ = 13 + Excellent1LexerLTE = 14 + Excellent1LexerLT = 15 + Excellent1LexerGTE = 16 + Excellent1LexerGT = 17 + Excellent1LexerAMPERSAND = 18 + Excellent1LexerDECIMAL = 19 + Excellent1LexerSTRING = 20 + Excellent1LexerTRUE = 21 + Excellent1LexerFALSE = 22 + Excellent1LexerNULL = 23 + Excellent1LexerNAME = 24 + Excellent1LexerWS = 25 + Excellent1LexerERROR = 26 +) diff --git a/legacy/gen/excellent1_listener.go b/legacy/gen/excellent1_listener.go new file mode 100644 index 000000000..05babd0e7 --- /dev/null +++ b/legacy/gen/excellent1_listener.go @@ -0,0 +1,135 @@ +// Code generated from Excellent1.g4 by ANTLR 4.7.1. DO NOT EDIT. + +package gen // Excellent1 +import "github.com/antlr/antlr4/runtime/Go/antlr" + +// Excellent1Listener is a complete listener for a parse tree produced by Excellent1Parser. +type Excellent1Listener interface { + antlr.ParseTreeListener + + // EnterParse is called when entering the parse production. + EnterParse(c *ParseContext) + + // EnterDecimalLiteral is called when entering the decimalLiteral production. + EnterDecimalLiteral(c *DecimalLiteralContext) + + // EnterDotLookup is called when entering the dotLookup production. + EnterDotLookup(c *DotLookupContext) + + // EnterNull is called when entering the null production. + EnterNull(c *NullContext) + + // EnterStringLiteral is called when entering the stringLiteral production. + EnterStringLiteral(c *StringLiteralContext) + + // EnterFunctionCall is called when entering the functionCall production. + EnterFunctionCall(c *FunctionCallContext) + + // EnterTrue is called when entering the true production. + EnterTrue(c *TrueContext) + + // EnterFalse is called when entering the false production. + EnterFalse(c *FalseContext) + + // EnterArrayLookup is called when entering the arrayLookup production. + EnterArrayLookup(c *ArrayLookupContext) + + // EnterContextReference is called when entering the contextReference production. + EnterContextReference(c *ContextReferenceContext) + + // EnterParentheses is called when entering the parentheses production. + EnterParentheses(c *ParenthesesContext) + + // EnterNegation is called when entering the negation production. + EnterNegation(c *NegationContext) + + // EnterComparison is called when entering the comparison production. + EnterComparison(c *ComparisonContext) + + // EnterConcatenation is called when entering the concatenation production. + EnterConcatenation(c *ConcatenationContext) + + // EnterMultiplicationOrDivision is called when entering the multiplicationOrDivision production. + EnterMultiplicationOrDivision(c *MultiplicationOrDivisionContext) + + // EnterAtomReference is called when entering the atomReference production. + EnterAtomReference(c *AtomReferenceContext) + + // EnterAdditionOrSubtraction is called when entering the additionOrSubtraction production. + EnterAdditionOrSubtraction(c *AdditionOrSubtractionContext) + + // EnterEquality is called when entering the equality production. + EnterEquality(c *EqualityContext) + + // EnterExponent is called when entering the exponent production. + EnterExponent(c *ExponentContext) + + // EnterFnname is called when entering the fnname production. + EnterFnname(c *FnnameContext) + + // EnterFunctionParameters is called when entering the functionParameters production. + EnterFunctionParameters(c *FunctionParametersContext) + + // ExitParse is called when exiting the parse production. + ExitParse(c *ParseContext) + + // ExitDecimalLiteral is called when exiting the decimalLiteral production. + ExitDecimalLiteral(c *DecimalLiteralContext) + + // ExitDotLookup is called when exiting the dotLookup production. + ExitDotLookup(c *DotLookupContext) + + // ExitNull is called when exiting the null production. + ExitNull(c *NullContext) + + // ExitStringLiteral is called when exiting the stringLiteral production. + ExitStringLiteral(c *StringLiteralContext) + + // ExitFunctionCall is called when exiting the functionCall production. + ExitFunctionCall(c *FunctionCallContext) + + // ExitTrue is called when exiting the true production. + ExitTrue(c *TrueContext) + + // ExitFalse is called when exiting the false production. + ExitFalse(c *FalseContext) + + // ExitArrayLookup is called when exiting the arrayLookup production. + ExitArrayLookup(c *ArrayLookupContext) + + // ExitContextReference is called when exiting the contextReference production. + ExitContextReference(c *ContextReferenceContext) + + // ExitParentheses is called when exiting the parentheses production. + ExitParentheses(c *ParenthesesContext) + + // ExitNegation is called when exiting the negation production. + ExitNegation(c *NegationContext) + + // ExitComparison is called when exiting the comparison production. + ExitComparison(c *ComparisonContext) + + // ExitConcatenation is called when exiting the concatenation production. + ExitConcatenation(c *ConcatenationContext) + + // ExitMultiplicationOrDivision is called when exiting the multiplicationOrDivision production. + ExitMultiplicationOrDivision(c *MultiplicationOrDivisionContext) + + // ExitAtomReference is called when exiting the atomReference production. + ExitAtomReference(c *AtomReferenceContext) + + // ExitAdditionOrSubtraction is called when exiting the additionOrSubtraction production. + ExitAdditionOrSubtraction(c *AdditionOrSubtractionContext) + + // ExitEquality is called when exiting the equality production. + ExitEquality(c *EqualityContext) + + // ExitExponent is called when exiting the exponent production. + ExitExponent(c *ExponentContext) + + // ExitFnname is called when exiting the fnname production. + ExitFnname(c *FnnameContext) + + // ExitFunctionParameters is called when exiting the functionParameters production. + ExitFunctionParameters(c *FunctionParametersContext) +} diff --git a/legacy/gen/excellent1_parser.go b/legacy/gen/excellent1_parser.go new file mode 100644 index 000000000..ff5ffcfa1 --- /dev/null +++ b/legacy/gen/excellent1_parser.go @@ -0,0 +1,2220 @@ +// Code generated from Excellent1.g4 by ANTLR 4.7.1. DO NOT EDIT. + +package gen // Excellent1 +import ( + "fmt" + "reflect" + "strconv" + + "github.com/antlr/antlr4/runtime/Go/antlr" +) + +// Suppress unused import errors +var _ = fmt.Printf +var _ = reflect.Copy +var _ = strconv.Itoa + +var parserATN = []uint16{ + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 28, 88, 4, + 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 3, 2, 3, 2, 3, + 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 20, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 5, 3, 30, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 7, 3, 40, 10, 3, 12, 3, 14, 3, 43, 11, 3, 3, 4, 3, 4, 3, + 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 53, 10, 4, 3, 4, 3, 4, 3, 4, 3, + 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, + 4, 3, 4, 3, 4, 7, 4, 73, 10, 4, 12, 4, 14, 4, 76, 11, 4, 3, 5, 3, 5, 3, + 6, 3, 6, 3, 6, 7, 6, 83, 10, 6, 12, 6, 14, 6, 86, 11, 6, 3, 6, 2, 4, 4, + 6, 7, 2, 4, 6, 8, 10, 2, 7, 3, 2, 11, 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, + 2, 14, 15, 4, 2, 23, 24, 26, 26, 2, 100, 2, 12, 3, 2, 2, 2, 4, 29, 3, 2, + 2, 2, 6, 52, 3, 2, 2, 2, 8, 77, 3, 2, 2, 2, 10, 79, 3, 2, 2, 2, 12, 13, + 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, + 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, + 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, + 30, 3, 2, 2, 2, 23, 30, 7, 26, 2, 2, 24, 30, 7, 22, 2, 2, 25, 30, 7, 21, + 2, 2, 26, 30, 7, 23, 2, 2, 27, 30, 7, 24, 2, 2, 28, 30, 7, 25, 2, 2, 29, + 15, 3, 2, 2, 2, 29, 23, 3, 2, 2, 2, 29, 24, 3, 2, 2, 2, 29, 25, 3, 2, 2, + 2, 29, 26, 3, 2, 2, 2, 29, 27, 3, 2, 2, 2, 29, 28, 3, 2, 2, 2, 30, 41, + 3, 2, 2, 2, 31, 32, 12, 10, 2, 2, 32, 33, 7, 8, 2, 2, 33, 40, 5, 4, 3, + 11, 34, 35, 12, 9, 2, 2, 35, 36, 7, 6, 2, 2, 36, 37, 5, 6, 4, 2, 37, 38, + 7, 7, 2, 2, 38, 40, 3, 2, 2, 2, 39, 31, 3, 2, 2, 2, 39, 34, 3, 2, 2, 2, + 40, 43, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 5, 3, 2, + 2, 2, 43, 41, 3, 2, 2, 2, 44, 45, 8, 4, 1, 2, 45, 53, 5, 4, 3, 2, 46, 47, + 7, 10, 2, 2, 47, 53, 5, 6, 4, 10, 48, 49, 7, 4, 2, 2, 49, 50, 5, 6, 4, + 2, 50, 51, 7, 5, 2, 2, 51, 53, 3, 2, 2, 2, 52, 44, 3, 2, 2, 2, 52, 46, + 3, 2, 2, 2, 52, 48, 3, 2, 2, 2, 53, 74, 3, 2, 2, 2, 54, 55, 12, 9, 2, 2, + 55, 56, 7, 13, 2, 2, 56, 73, 5, 6, 4, 10, 57, 58, 12, 8, 2, 2, 58, 59, + 9, 2, 2, 2, 59, 73, 5, 6, 4, 9, 60, 61, 12, 7, 2, 2, 61, 62, 9, 3, 2, 2, + 62, 73, 5, 6, 4, 8, 63, 64, 12, 6, 2, 2, 64, 65, 9, 4, 2, 2, 65, 73, 5, + 6, 4, 7, 66, 67, 12, 5, 2, 2, 67, 68, 9, 5, 2, 2, 68, 73, 5, 6, 4, 6, 69, + 70, 12, 4, 2, 2, 70, 71, 7, 20, 2, 2, 71, 73, 5, 6, 4, 5, 72, 54, 3, 2, + 2, 2, 72, 57, 3, 2, 2, 2, 72, 60, 3, 2, 2, 2, 72, 63, 3, 2, 2, 2, 72, 66, + 3, 2, 2, 2, 72, 69, 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, + 74, 75, 3, 2, 2, 2, 75, 7, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 78, 9, 6, + 2, 2, 78, 9, 3, 2, 2, 2, 79, 84, 5, 6, 4, 2, 80, 81, 7, 3, 2, 2, 81, 83, + 5, 6, 4, 2, 82, 80, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, + 84, 85, 3, 2, 2, 2, 85, 11, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 10, 19, 29, + 39, 41, 52, 72, 74, 84, +} +var deserializer = antlr.NewATNDeserializer(nil) +var deserializedATN = deserializer.DeserializeFromUInt16(parserATN) + +var literalNames = []string{ + "", "','", "'('", "')'", "'['", "']'", "'.'", "'+'", "'-'", "'*'", "'/'", + "'^'", "'='", "'<>'", "'<='", "'<'", "'>='", "'>'", "'&'", +} +var symbolicNames = []string{ + "", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", + "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", "AMPERSAND", + "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", +} + +var ruleNames = []string{ + "parse", "atom", "expression", "fnname", "parameters", +} +var decisionToDFA = make([]*antlr.DFA, len(deserializedATN.DecisionToState)) + +func init() { + for index, ds := range deserializedATN.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(ds, index) + } +} + +type Excellent1Parser struct { + *antlr.BaseParser +} + +func NewExcellent1Parser(input antlr.TokenStream) *Excellent1Parser { + this := new(Excellent1Parser) + + this.BaseParser = antlr.NewBaseParser(input) + + this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache()) + this.RuleNames = ruleNames + this.LiteralNames = literalNames + this.SymbolicNames = symbolicNames + this.GrammarFileName = "Excellent1.g4" + + return this +} + +// Excellent1Parser tokens. +const ( + Excellent1ParserEOF = antlr.TokenEOF + Excellent1ParserCOMMA = 1 + Excellent1ParserLPAREN = 2 + Excellent1ParserRPAREN = 3 + Excellent1ParserLBRACK = 4 + Excellent1ParserRBRACK = 5 + Excellent1ParserDOT = 6 + Excellent1ParserPLUS = 7 + Excellent1ParserMINUS = 8 + Excellent1ParserTIMES = 9 + Excellent1ParserDIVIDE = 10 + Excellent1ParserEXPONENT = 11 + Excellent1ParserEQ = 12 + Excellent1ParserNEQ = 13 + Excellent1ParserLTE = 14 + Excellent1ParserLT = 15 + Excellent1ParserGTE = 16 + Excellent1ParserGT = 17 + Excellent1ParserAMPERSAND = 18 + Excellent1ParserDECIMAL = 19 + Excellent1ParserSTRING = 20 + Excellent1ParserTRUE = 21 + Excellent1ParserFALSE = 22 + Excellent1ParserNULL = 23 + Excellent1ParserNAME = 24 + Excellent1ParserWS = 25 + Excellent1ParserERROR = 26 +) + +// Excellent1Parser rules. +const ( + Excellent1ParserRULE_parse = 0 + Excellent1ParserRULE_atom = 1 + Excellent1ParserRULE_expression = 2 + Excellent1ParserRULE_fnname = 3 + Excellent1ParserRULE_parameters = 4 +) + +// IParseContext is an interface to support dynamic dispatch. +type IParseContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsParseContext differentiates from other interfaces. + IsParseContext() +} + +type ParseContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyParseContext() *ParseContext { + var p = new(ParseContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = Excellent1ParserRULE_parse + return p +} + +func (*ParseContext) IsParseContext() {} + +func NewParseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParseContext { + var p = new(ParseContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = Excellent1ParserRULE_parse + + return p +} + +func (s *ParseContext) GetParser() antlr.Parser { return s.parser } + +func (s *ParseContext) Expression() IExpressionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ParseContext) EOF() antlr.TerminalNode { + return s.GetToken(Excellent1ParserEOF, 0) +} + +func (s *ParseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ParseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ParseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterParse(s) + } +} + +func (s *ParseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitParse(s) + } +} + +func (s *ParseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitParse(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *Excellent1Parser) Parse() (localctx IParseContext) { + localctx = NewParseContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 0, Excellent1ParserRULE_parse) + + defer func() { + p.ExitRule() + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(10) + p.expression(0) + } + { + p.SetState(11) + p.Match(Excellent1ParserEOF) + } + + return localctx +} + +// IAtomContext is an interface to support dynamic dispatch. +type IAtomContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // IsAtomContext differentiates from other interfaces. + IsAtomContext() +} + +type AtomContext struct { + *antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAtomContext() *AtomContext { + var p = new(AtomContext) + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + p.RuleIndex = Excellent1ParserRULE_atom + return p +} + +func (*AtomContext) IsAtomContext() {} + +func NewAtomContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AtomContext { + var p = new(AtomContext) + + p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + + p.parser = parser + p.RuleIndex = Excellent1ParserRULE_atom + + return p +} + +func (s *AtomContext) GetParser() antlr.Parser { return s.parser } + +func (s *AtomContext) CopyFrom(ctx *AtomContext) { + s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) +} + +func (s *AtomContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AtomContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type DecimalLiteralContext struct { + *AtomContext +} + +func NewDecimalLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DecimalLiteralContext { + var p = new(DecimalLiteralContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *DecimalLiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DecimalLiteralContext) DECIMAL() antlr.TerminalNode { + return s.GetToken(Excellent1ParserDECIMAL, 0) +} + +func (s *DecimalLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterDecimalLiteral(s) + } +} + +func (s *DecimalLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitDecimalLiteral(s) + } +} + +func (s *DecimalLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitDecimalLiteral(s) + + default: + return t.VisitChildren(s) + } +} + +type DotLookupContext struct { + *AtomContext +} + +func NewDotLookupContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DotLookupContext { + var p = new(DotLookupContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *DotLookupContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DotLookupContext) AllAtom() []IAtomContext { + var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IAtomContext)(nil)).Elem()) + var tst = make([]IAtomContext, len(ts)) + + for i, t := range ts { + if t != nil { + tst[i] = t.(IAtomContext) + } + } + + return tst +} + +func (s *DotLookupContext) Atom(i int) IAtomContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAtomContext)(nil)).Elem(), i) + + if t == nil { + return nil + } + + return t.(IAtomContext) +} + +func (s *DotLookupContext) DOT() antlr.TerminalNode { + return s.GetToken(Excellent1ParserDOT, 0) +} + +func (s *DotLookupContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterDotLookup(s) + } +} + +func (s *DotLookupContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitDotLookup(s) + } +} + +func (s *DotLookupContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitDotLookup(s) + + default: + return t.VisitChildren(s) + } +} + +type NullContext struct { + *AtomContext +} + +func NewNullContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullContext { + var p = new(NullContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *NullContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NullContext) NULL() antlr.TerminalNode { + return s.GetToken(Excellent1ParserNULL, 0) +} + +func (s *NullContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterNull(s) + } +} + +func (s *NullContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitNull(s) + } +} + +func (s *NullContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitNull(s) + + default: + return t.VisitChildren(s) + } +} + +type StringLiteralContext struct { + *AtomContext +} + +func NewStringLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringLiteralContext { + var p = new(StringLiteralContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *StringLiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *StringLiteralContext) STRING() antlr.TerminalNode { + return s.GetToken(Excellent1ParserSTRING, 0) +} + +func (s *StringLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterStringLiteral(s) + } +} + +func (s *StringLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitStringLiteral(s) + } +} + +func (s *StringLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitStringLiteral(s) + + default: + return t.VisitChildren(s) + } +} + +type FunctionCallContext struct { + *AtomContext +} + +func NewFunctionCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FunctionCallContext { + var p = new(FunctionCallContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *FunctionCallContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FunctionCallContext) Fnname() IFnnameContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IFnnameContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IFnnameContext) +} + +func (s *FunctionCallContext) LPAREN() antlr.TerminalNode { + return s.GetToken(Excellent1ParserLPAREN, 0) +} + +func (s *FunctionCallContext) RPAREN() antlr.TerminalNode { + return s.GetToken(Excellent1ParserRPAREN, 0) +} + +func (s *FunctionCallContext) Parameters() IParametersContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IParametersContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IParametersContext) +} + +func (s *FunctionCallContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterFunctionCall(s) + } +} + +func (s *FunctionCallContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitFunctionCall(s) + } +} + +func (s *FunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitFunctionCall(s) + + default: + return t.VisitChildren(s) + } +} + +type TrueContext struct { + *AtomContext +} + +func NewTrueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TrueContext { + var p = new(TrueContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *TrueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TrueContext) TRUE() antlr.TerminalNode { + return s.GetToken(Excellent1ParserTRUE, 0) +} + +func (s *TrueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterTrue(s) + } +} + +func (s *TrueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitTrue(s) + } +} + +func (s *TrueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitTrue(s) + + default: + return t.VisitChildren(s) + } +} + +type FalseContext struct { + *AtomContext +} + +func NewFalseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FalseContext { + var p = new(FalseContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *FalseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FalseContext) FALSE() antlr.TerminalNode { + return s.GetToken(Excellent1ParserFALSE, 0) +} + +func (s *FalseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterFalse(s) + } +} + +func (s *FalseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitFalse(s) + } +} + +func (s *FalseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitFalse(s) + + default: + return t.VisitChildren(s) + } +} + +type ArrayLookupContext struct { + *AtomContext +} + +func NewArrayLookupContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ArrayLookupContext { + var p = new(ArrayLookupContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *ArrayLookupContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ArrayLookupContext) Atom() IAtomContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IAtomContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IAtomContext) +} + +func (s *ArrayLookupContext) LBRACK() antlr.TerminalNode { + return s.GetToken(Excellent1ParserLBRACK, 0) +} + +func (s *ArrayLookupContext) Expression() IExpressionContext { + var t = s.GetTypedRuleContext(reflect.TypeOf((*IExpressionContext)(nil)).Elem(), 0) + + if t == nil { + return nil + } + + return t.(IExpressionContext) +} + +func (s *ArrayLookupContext) RBRACK() antlr.TerminalNode { + return s.GetToken(Excellent1ParserRBRACK, 0) +} + +func (s *ArrayLookupContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterArrayLookup(s) + } +} + +func (s *ArrayLookupContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitArrayLookup(s) + } +} + +func (s *ArrayLookupContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitArrayLookup(s) + + default: + return t.VisitChildren(s) + } +} + +type ContextReferenceContext struct { + *AtomContext +} + +func NewContextReferenceContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ContextReferenceContext { + var p = new(ContextReferenceContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *ContextReferenceContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ContextReferenceContext) NAME() antlr.TerminalNode { + return s.GetToken(Excellent1ParserNAME, 0) +} + +func (s *ContextReferenceContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.EnterContextReference(s) + } +} + +func (s *ContextReferenceContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent1Listener); ok { + listenerT.ExitContextReference(s) + } +} + +func (s *ContextReferenceContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent1Visitor: + return t.VisitContextReference(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *Excellent1Parser) Atom() (localctx IAtomContext) { + return p.atom(0) +} + +func (p *Excellent1Parser) atom(_p int) (localctx IAtomContext) { + var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + _parentState := p.GetState() + localctx = NewAtomContext(p, p.GetParserRuleContext(), _parentState) + var _prevctx IAtomContext = localctx + var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. + _startState := 2 + p.EnterRecursionRule(localctx, 2, Excellent1ParserRULE_atom, _p) + var _la int + + defer func() { + p.UnrollRecursionContexts(_parentctx) + }() + + defer func() { + if err := recover(); err != nil { + if v, ok := err.(antlr.RecognitionException); ok { + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + } else { + panic(err) + } + } + }() + + var _alt int + + p.EnterOuterAlt(localctx, 1) + p.SetState(27) + p.GetErrorHandler().Sync(p) + switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 1, p.GetParserRuleContext()) { + case 1: + localctx = NewFunctionCallContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + + { + p.SetState(14) + p.Fnname() + } + { + p.SetState(15) + p.Match(Excellent1ParserLPAREN) + } + p.SetState(17) + p.GetErrorHandler().Sync(p) + _la = p.GetTokenStream().LA(1) + + if ((_la)&-(0x1f+1)) == 0 && ((1< Date: Thu, 26 Apr 2018 16:12:44 -0500 Subject: [PATCH 3/8] Remove array support in legacy expressions --- antlr/Excellent1.g4 | 2 - antlr/Excellent2.g4 | 8 +- excellent/gen/Excellent2.interp | 6 +- excellent/gen/Excellent2.tokens | 4 +- excellent/gen/Excellent2Lexer.interp | 10 +- excellent/gen/Excellent2Lexer.tokens | 4 +- excellent/gen/excellent2_base_listener.go | 24 +- excellent/gen/excellent2_base_visitor.go | 16 +- excellent/gen/excellent2_lexer.go | 54 ++-- excellent/gen/excellent2_listener.go | 24 +- excellent/gen/excellent2_parser.go | 196 ++++++------ excellent/gen/excellent2_visitor.go | 12 +- excellent/visitor.go | 36 +-- legacy/expressions.go | 11 - legacy/gen/Excellent1.interp | 2 +- legacy/gen/excellent1_base_listener.go | 12 - legacy/gen/excellent1_base_visitor.go | 8 - legacy/gen/excellent1_listener.go | 12 - legacy/gen/excellent1_parser.go | 350 ++++++---------------- legacy/gen/excellent1_visitor.go | 6 - 20 files changed, 296 insertions(+), 501 deletions(-) diff --git a/antlr/Excellent1.g4 b/antlr/Excellent1.g4 index d8467a91b..0585e286e 100644 --- a/antlr/Excellent1.g4 +++ b/antlr/Excellent1.g4 @@ -45,13 +45,11 @@ parse : expression EOF; atom : fnname LPAREN parameters? RPAREN # functionCall | atom DOT atom # dotLookup - | atom LBRACK expression RBRACK # arrayLookup | NAME # contextReference | STRING # stringLiteral | DECIMAL # decimalLiteral | TRUE # true | FALSE # false - | NULL # null ; expression : atom # atomReference diff --git a/antlr/Excellent2.g4 b/antlr/Excellent2.g4 index 91eb14940..9f3e1d55d 100644 --- a/antlr/Excellent2.g4 +++ b/antlr/Excellent2.g4 @@ -28,8 +28,8 @@ GT : '>'; AMPERSAND : '&'; -DECIMAL : [0-9]+('.'[0-9]+)?; -STRING : '"' (~["] | '""')* '"'; +TEXT : '"' (~["] | '""')* '"'; +NUMBER : [0-9]+('.'[0-9]+)?; TRUE : [Tt][Rr][Uu][Ee]; FALSE : [Ff][Aa][Ll][Ss][Ee]; @@ -47,8 +47,8 @@ atom : fnname LPAREN parameters? RPAREN # functionCall | atom DOT atom # dotLookup | atom LBRACK expression RBRACK # arrayLookup | NAME # contextReference - | STRING # stringLiteral - | DECIMAL # decimalLiteral + | TEXT # textLiteral + | NUMBER # numberLiteral | TRUE # true | FALSE # false | NULL # null diff --git a/excellent/gen/Excellent2.interp b/excellent/gen/Excellent2.interp index 100b01fd2..930f40573 100644 --- a/excellent/gen/Excellent2.interp +++ b/excellent/gen/Excellent2.interp @@ -47,8 +47,8 @@ LT GTE GT AMPERSAND -DECIMAL -STRING +TEXT +NUMBER TRUE FALSE NULL @@ -65,4 +65,4 @@ parameters atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 28, 88, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 20, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 30, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 40, 10, 3, 12, 3, 14, 3, 43, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 53, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 73, 10, 4, 12, 4, 14, 4, 76, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 7, 6, 83, 10, 6, 12, 6, 14, 6, 86, 11, 6, 3, 6, 2, 4, 4, 6, 7, 2, 4, 6, 8, 10, 2, 6, 3, 2, 11, 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, 2, 14, 15, 2, 100, 2, 12, 3, 2, 2, 2, 4, 29, 3, 2, 2, 2, 6, 52, 3, 2, 2, 2, 8, 77, 3, 2, 2, 2, 10, 79, 3, 2, 2, 2, 12, 13, 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, 30, 3, 2, 2, 2, 23, 30, 7, 26, 2, 2, 24, 30, 7, 22, 2, 2, 25, 30, 7, 21, 2, 2, 26, 30, 7, 23, 2, 2, 27, 30, 7, 24, 2, 2, 28, 30, 7, 25, 2, 2, 29, 15, 3, 2, 2, 2, 29, 23, 3, 2, 2, 2, 29, 24, 3, 2, 2, 2, 29, 25, 3, 2, 2, 2, 29, 26, 3, 2, 2, 2, 29, 27, 3, 2, 2, 2, 29, 28, 3, 2, 2, 2, 30, 41, 3, 2, 2, 2, 31, 32, 12, 10, 2, 2, 32, 33, 7, 8, 2, 2, 33, 40, 5, 4, 3, 11, 34, 35, 12, 9, 2, 2, 35, 36, 7, 6, 2, 2, 36, 37, 5, 6, 4, 2, 37, 38, 7, 7, 2, 2, 38, 40, 3, 2, 2, 2, 39, 31, 3, 2, 2, 2, 39, 34, 3, 2, 2, 2, 40, 43, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 5, 3, 2, 2, 2, 43, 41, 3, 2, 2, 2, 44, 45, 8, 4, 1, 2, 45, 53, 5, 4, 3, 2, 46, 47, 7, 10, 2, 2, 47, 53, 5, 6, 4, 10, 48, 49, 7, 4, 2, 2, 49, 50, 5, 6, 4, 2, 50, 51, 7, 5, 2, 2, 51, 53, 3, 2, 2, 2, 52, 44, 3, 2, 2, 2, 52, 46, 3, 2, 2, 2, 52, 48, 3, 2, 2, 2, 53, 74, 3, 2, 2, 2, 54, 55, 12, 9, 2, 2, 55, 56, 7, 13, 2, 2, 56, 73, 5, 6, 4, 10, 57, 58, 12, 8, 2, 2, 58, 59, 9, 2, 2, 2, 59, 73, 5, 6, 4, 9, 60, 61, 12, 7, 2, 2, 61, 62, 9, 3, 2, 2, 62, 73, 5, 6, 4, 8, 63, 64, 12, 6, 2, 2, 64, 65, 9, 4, 2, 2, 65, 73, 5, 6, 4, 7, 66, 67, 12, 5, 2, 2, 67, 68, 9, 5, 2, 2, 68, 73, 5, 6, 4, 6, 69, 70, 12, 4, 2, 2, 70, 71, 7, 20, 2, 2, 71, 73, 5, 6, 4, 5, 72, 54, 3, 2, 2, 2, 72, 57, 3, 2, 2, 2, 72, 60, 3, 2, 2, 2, 72, 63, 3, 2, 2, 2, 72, 66, 3, 2, 2, 2, 72, 69, 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 7, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 78, 7, 26, 2, 2, 78, 9, 3, 2, 2, 2, 79, 84, 5, 6, 4, 2, 80, 81, 7, 3, 2, 2, 81, 83, 5, 6, 4, 2, 82, 80, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 11, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 10, 19, 29, 39, 41, 52, 72, 74, 84] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 28, 88, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 20, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 30, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 40, 10, 3, 12, 3, 14, 3, 43, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 53, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 73, 10, 4, 12, 4, 14, 4, 76, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 7, 6, 83, 10, 6, 12, 6, 14, 6, 86, 11, 6, 3, 6, 2, 4, 4, 6, 7, 2, 4, 6, 8, 10, 2, 6, 3, 2, 11, 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, 2, 14, 15, 2, 100, 2, 12, 3, 2, 2, 2, 4, 29, 3, 2, 2, 2, 6, 52, 3, 2, 2, 2, 8, 77, 3, 2, 2, 2, 10, 79, 3, 2, 2, 2, 12, 13, 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, 30, 3, 2, 2, 2, 23, 30, 7, 26, 2, 2, 24, 30, 7, 21, 2, 2, 25, 30, 7, 22, 2, 2, 26, 30, 7, 23, 2, 2, 27, 30, 7, 24, 2, 2, 28, 30, 7, 25, 2, 2, 29, 15, 3, 2, 2, 2, 29, 23, 3, 2, 2, 2, 29, 24, 3, 2, 2, 2, 29, 25, 3, 2, 2, 2, 29, 26, 3, 2, 2, 2, 29, 27, 3, 2, 2, 2, 29, 28, 3, 2, 2, 2, 30, 41, 3, 2, 2, 2, 31, 32, 12, 10, 2, 2, 32, 33, 7, 8, 2, 2, 33, 40, 5, 4, 3, 11, 34, 35, 12, 9, 2, 2, 35, 36, 7, 6, 2, 2, 36, 37, 5, 6, 4, 2, 37, 38, 7, 7, 2, 2, 38, 40, 3, 2, 2, 2, 39, 31, 3, 2, 2, 2, 39, 34, 3, 2, 2, 2, 40, 43, 3, 2, 2, 2, 41, 39, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 5, 3, 2, 2, 2, 43, 41, 3, 2, 2, 2, 44, 45, 8, 4, 1, 2, 45, 53, 5, 4, 3, 2, 46, 47, 7, 10, 2, 2, 47, 53, 5, 6, 4, 10, 48, 49, 7, 4, 2, 2, 49, 50, 5, 6, 4, 2, 50, 51, 7, 5, 2, 2, 51, 53, 3, 2, 2, 2, 52, 44, 3, 2, 2, 2, 52, 46, 3, 2, 2, 2, 52, 48, 3, 2, 2, 2, 53, 74, 3, 2, 2, 2, 54, 55, 12, 9, 2, 2, 55, 56, 7, 13, 2, 2, 56, 73, 5, 6, 4, 10, 57, 58, 12, 8, 2, 2, 58, 59, 9, 2, 2, 2, 59, 73, 5, 6, 4, 9, 60, 61, 12, 7, 2, 2, 61, 62, 9, 3, 2, 2, 62, 73, 5, 6, 4, 8, 63, 64, 12, 6, 2, 2, 64, 65, 9, 4, 2, 2, 65, 73, 5, 6, 4, 7, 66, 67, 12, 5, 2, 2, 67, 68, 9, 5, 2, 2, 68, 73, 5, 6, 4, 6, 69, 70, 12, 4, 2, 2, 70, 71, 7, 20, 2, 2, 71, 73, 5, 6, 4, 5, 72, 54, 3, 2, 2, 2, 72, 57, 3, 2, 2, 2, 72, 60, 3, 2, 2, 2, 72, 63, 3, 2, 2, 2, 72, 66, 3, 2, 2, 2, 72, 69, 3, 2, 2, 2, 73, 76, 3, 2, 2, 2, 74, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 7, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 77, 78, 7, 26, 2, 2, 78, 9, 3, 2, 2, 2, 79, 84, 5, 6, 4, 2, 80, 81, 7, 3, 2, 2, 81, 83, 5, 6, 4, 2, 82, 80, 3, 2, 2, 2, 83, 86, 3, 2, 2, 2, 84, 82, 3, 2, 2, 2, 84, 85, 3, 2, 2, 2, 85, 11, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 10, 19, 29, 39, 41, 52, 72, 74, 84] \ No newline at end of file diff --git a/excellent/gen/Excellent2.tokens b/excellent/gen/Excellent2.tokens index 52e89064c..c38a70141 100644 --- a/excellent/gen/Excellent2.tokens +++ b/excellent/gen/Excellent2.tokens @@ -16,8 +16,8 @@ LT=15 GTE=16 GT=17 AMPERSAND=18 -DECIMAL=19 -STRING=20 +TEXT=19 +NUMBER=20 TRUE=21 FALSE=22 NULL=23 diff --git a/excellent/gen/Excellent2Lexer.interp b/excellent/gen/Excellent2Lexer.interp index cd3d70b03..5f6eadb2c 100644 --- a/excellent/gen/Excellent2Lexer.interp +++ b/excellent/gen/Excellent2Lexer.interp @@ -47,8 +47,8 @@ LT GTE GT AMPERSAND -DECIMAL -STRING +TEXT +NUMBER TRUE FALSE NULL @@ -75,8 +75,8 @@ LT GTE GT AMPERSAND -DECIMAL -STRING +TEXT +NUMBER TRUE FALSE NULL @@ -99,4 +99,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 28, 189, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 110, 10, 20, 13, 20, 14, 20, 111, 3, 20, 3, 20, 6, 20, 116, 10, 20, 13, 20, 14, 20, 117, 5, 20, 120, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 126, 10, 21, 12, 21, 14, 21, 129, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 6, 25, 150, 10, 25, 13, 25, 14, 25, 151, 3, 25, 3, 25, 3, 25, 7, 25, 157, 10, 25, 12, 25, 14, 25, 160, 11, 25, 3, 26, 6, 26, 163, 10, 26, 13, 26, 14, 26, 164, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 176, 10, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 2, 2, 35, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 2, 57, 2, 59, 2, 61, 2, 63, 2, 65, 2, 67, 2, 3, 2, 20, 3, 2, 50, 59, 3, 2, 36, 36, 4, 2, 86, 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, 119, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, 99, 4, 2, 78, 78, 110, 110, 4, 2, 85, 85, 117, 117, 4, 2, 80, 80, 112, 112, 5, 2, 11, 12, 15, 15, 34, 34, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, 332, 383, 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, 418, 420, 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, 504, 506, 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, 897, 904, 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, 1020, 1023, 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, 4295, 4297, 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, 7985, 7994, 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, 8141, 8154, 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, 8468, 8471, 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, 11312, 11362, 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, 11501, 11503, 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, 42864, 42875, 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, 65315, 65340, 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, 391, 394, 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, 456, 462, 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, 885, 889, 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, 1155, 1165, 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, 7580, 7683, 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, 8007, 8018, 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, 8105, 8114, 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, 8153, 8162, 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, 8511, 8520, 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, 11395, 11502, 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, 42653, 42789, 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, 42899, 42903, 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, 64281, 65347, 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, 8126, 8142, 8190, 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, 886, 892, 1371, 1602, 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, 3656, 3784, 4350, 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, 8321, 8338, 8350, 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, 40983, 42239, 42510, 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, 43003, 43473, 43496, 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, 236, 2, 172, 188, 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, 1648, 1649, 1651, 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, 1971, 2028, 2050, 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, 2394, 2403, 2420, 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, 2484, 2491, 2495, 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, 2577, 2578, 2581, 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, 2651, 2654, 2656, 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, 2740, 2741, 2743, 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, 2837, 2858, 2860, 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, 2951, 2956, 2960, 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, 3026, 3086, 3088, 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, 3220, 3242, 3244, 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, 3335, 3342, 3344, 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, 3463, 3480, 3484, 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, 3650, 3655, 3715, 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, 3751, 3753, 3756, 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, 3842, 3913, 3915, 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, 4195, 4210, 4215, 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, 4698, 4703, 4706, 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, 4802, 4807, 4810, 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, 5026, 5110, 5123, 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, 5890, 5902, 5904, 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, 6018, 6069, 6110, 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, 6482, 6511, 6514, 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, 6919, 6965, 6983, 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, 7247, 7249, 7260, 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, 11570, 11625, 11650, 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, 11712, 11714, 11720, 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, 12355, 12440, 12449, 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, 12801, 13314, 19895, 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, 42242, 42509, 42514, 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, 43015, 43017, 43020, 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, 43261, 43303, 43314, 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, 43505, 43516, 43520, 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, 43635, 43640, 43644, 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, 43756, 43764, 43784, 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, 43970, 44004, 44034, 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, 64219, 64287, 64298, 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, 64850, 64913, 64916, 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, 65393, 65395, 65439, 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, 65500, 65502, 39, 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, 2417, 2536, 2545, 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, 3185, 3304, 3313, 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, 3883, 4162, 4171, 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, 6619, 6786, 6795, 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, 7259, 42530, 42539, 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, 43602, 43611, 44018, 44027, 65298, 65307, 2, 195, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 3, 69, 3, 2, 2, 2, 5, 71, 3, 2, 2, 2, 7, 73, 3, 2, 2, 2, 9, 75, 3, 2, 2, 2, 11, 77, 3, 2, 2, 2, 13, 79, 3, 2, 2, 2, 15, 81, 3, 2, 2, 2, 17, 83, 3, 2, 2, 2, 19, 85, 3, 2, 2, 2, 21, 87, 3, 2, 2, 2, 23, 89, 3, 2, 2, 2, 25, 91, 3, 2, 2, 2, 27, 93, 3, 2, 2, 2, 29, 96, 3, 2, 2, 2, 31, 99, 3, 2, 2, 2, 33, 101, 3, 2, 2, 2, 35, 104, 3, 2, 2, 2, 37, 106, 3, 2, 2, 2, 39, 109, 3, 2, 2, 2, 41, 121, 3, 2, 2, 2, 43, 132, 3, 2, 2, 2, 45, 137, 3, 2, 2, 2, 47, 143, 3, 2, 2, 2, 49, 149, 3, 2, 2, 2, 51, 162, 3, 2, 2, 2, 53, 168, 3, 2, 2, 2, 55, 175, 3, 2, 2, 2, 57, 177, 3, 2, 2, 2, 59, 179, 3, 2, 2, 2, 61, 181, 3, 2, 2, 2, 63, 183, 3, 2, 2, 2, 65, 185, 3, 2, 2, 2, 67, 187, 3, 2, 2, 2, 69, 70, 7, 46, 2, 2, 70, 4, 3, 2, 2, 2, 71, 72, 7, 42, 2, 2, 72, 6, 3, 2, 2, 2, 73, 74, 7, 43, 2, 2, 74, 8, 3, 2, 2, 2, 75, 76, 7, 93, 2, 2, 76, 10, 3, 2, 2, 2, 77, 78, 7, 95, 2, 2, 78, 12, 3, 2, 2, 2, 79, 80, 7, 48, 2, 2, 80, 14, 3, 2, 2, 2, 81, 82, 7, 45, 2, 2, 82, 16, 3, 2, 2, 2, 83, 84, 7, 47, 2, 2, 84, 18, 3, 2, 2, 2, 85, 86, 7, 44, 2, 2, 86, 20, 3, 2, 2, 2, 87, 88, 7, 49, 2, 2, 88, 22, 3, 2, 2, 2, 89, 90, 7, 96, 2, 2, 90, 24, 3, 2, 2, 2, 91, 92, 7, 63, 2, 2, 92, 26, 3, 2, 2, 2, 93, 94, 7, 35, 2, 2, 94, 95, 7, 63, 2, 2, 95, 28, 3, 2, 2, 2, 96, 97, 7, 62, 2, 2, 97, 98, 7, 63, 2, 2, 98, 30, 3, 2, 2, 2, 99, 100, 7, 62, 2, 2, 100, 32, 3, 2, 2, 2, 101, 102, 7, 64, 2, 2, 102, 103, 7, 63, 2, 2, 103, 34, 3, 2, 2, 2, 104, 105, 7, 64, 2, 2, 105, 36, 3, 2, 2, 2, 106, 107, 7, 40, 2, 2, 107, 38, 3, 2, 2, 2, 108, 110, 9, 2, 2, 2, 109, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 119, 3, 2, 2, 2, 113, 115, 7, 48, 2, 2, 114, 116, 9, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 117, 3, 2, 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 120, 3, 2, 2, 2, 119, 113, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 40, 3, 2, 2, 2, 121, 127, 7, 36, 2, 2, 122, 126, 10, 3, 2, 2, 123, 124, 7, 36, 2, 2, 124, 126, 7, 36, 2, 2, 125, 122, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 129, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 130, 3, 2, 2, 2, 129, 127, 3, 2, 2, 2, 130, 131, 7, 36, 2, 2, 131, 42, 3, 2, 2, 2, 132, 133, 9, 4, 2, 2, 133, 134, 9, 5, 2, 2, 134, 135, 9, 6, 2, 2, 135, 136, 9, 7, 2, 2, 136, 44, 3, 2, 2, 2, 137, 138, 9, 8, 2, 2, 138, 139, 9, 9, 2, 2, 139, 140, 9, 10, 2, 2, 140, 141, 9, 11, 2, 2, 141, 142, 9, 7, 2, 2, 142, 46, 3, 2, 2, 2, 143, 144, 9, 12, 2, 2, 144, 145, 9, 6, 2, 2, 145, 146, 9, 10, 2, 2, 146, 147, 9, 10, 2, 2, 147, 48, 3, 2, 2, 2, 148, 150, 5, 55, 28, 2, 149, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 158, 3, 2, 2, 2, 153, 157, 5, 55, 28, 2, 154, 157, 5, 67, 34, 2, 155, 157, 7, 97, 2, 2, 156, 153, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 155, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 50, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 161, 163, 9, 13, 2, 2, 162, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 8, 26, 2, 2, 167, 52, 3, 2, 2, 2, 168, 169, 11, 2, 2, 2, 169, 54, 3, 2, 2, 2, 170, 176, 5, 57, 29, 2, 171, 176, 5, 59, 30, 2, 172, 176, 5, 61, 31, 2, 173, 176, 5, 63, 32, 2, 174, 176, 5, 65, 33, 2, 175, 170, 3, 2, 2, 2, 175, 171, 3, 2, 2, 2, 175, 172, 3, 2, 2, 2, 175, 173, 3, 2, 2, 2, 175, 174, 3, 2, 2, 2, 176, 56, 3, 2, 2, 2, 177, 178, 9, 14, 2, 2, 178, 58, 3, 2, 2, 2, 179, 180, 9, 15, 2, 2, 180, 60, 3, 2, 2, 2, 181, 182, 9, 16, 2, 2, 182, 62, 3, 2, 2, 2, 183, 184, 9, 17, 2, 2, 184, 64, 3, 2, 2, 2, 185, 186, 9, 18, 2, 2, 186, 66, 3, 2, 2, 2, 187, 188, 9, 19, 2, 2, 188, 68, 3, 2, 2, 2, 13, 2, 111, 117, 119, 125, 127, 151, 156, 158, 164, 175, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 28, 189, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 113, 10, 20, 12, 20, 14, 20, 116, 11, 20, 3, 20, 3, 20, 3, 21, 6, 21, 121, 10, 21, 13, 21, 14, 21, 122, 3, 21, 3, 21, 6, 21, 127, 10, 21, 13, 21, 14, 21, 128, 5, 21, 131, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 6, 25, 150, 10, 25, 13, 25, 14, 25, 151, 3, 25, 3, 25, 3, 25, 7, 25, 157, 10, 25, 12, 25, 14, 25, 160, 11, 25, 3, 26, 6, 26, 163, 10, 26, 13, 26, 14, 26, 164, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 176, 10, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 2, 2, 35, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 2, 57, 2, 59, 2, 61, 2, 63, 2, 65, 2, 67, 2, 3, 2, 20, 3, 2, 36, 36, 3, 2, 50, 59, 4, 2, 86, 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, 119, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, 99, 4, 2, 78, 78, 110, 110, 4, 2, 85, 85, 117, 117, 4, 2, 80, 80, 112, 112, 5, 2, 11, 12, 15, 15, 34, 34, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, 332, 383, 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, 418, 420, 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, 504, 506, 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, 897, 904, 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, 1020, 1023, 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, 4295, 4297, 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, 7985, 7994, 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, 8141, 8154, 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, 8468, 8471, 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, 11312, 11362, 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, 11501, 11503, 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, 42864, 42875, 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, 65315, 65340, 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, 391, 394, 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, 456, 462, 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, 885, 889, 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, 1155, 1165, 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, 7580, 7683, 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, 8007, 8018, 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, 8105, 8114, 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, 8153, 8162, 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, 8511, 8520, 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, 11395, 11502, 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, 42653, 42789, 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, 42899, 42903, 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, 64281, 65347, 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, 8126, 8142, 8190, 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, 886, 892, 1371, 1602, 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, 3656, 3784, 4350, 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, 8321, 8338, 8350, 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, 40983, 42239, 42510, 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, 43003, 43473, 43496, 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, 236, 2, 172, 188, 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, 1648, 1649, 1651, 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, 1971, 2028, 2050, 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, 2394, 2403, 2420, 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, 2484, 2491, 2495, 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, 2577, 2578, 2581, 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, 2651, 2654, 2656, 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, 2740, 2741, 2743, 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, 2837, 2858, 2860, 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, 2951, 2956, 2960, 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, 3026, 3086, 3088, 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, 3220, 3242, 3244, 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, 3335, 3342, 3344, 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, 3463, 3480, 3484, 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, 3650, 3655, 3715, 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, 3751, 3753, 3756, 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, 3842, 3913, 3915, 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, 4195, 4210, 4215, 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, 4698, 4703, 4706, 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, 4802, 4807, 4810, 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, 5026, 5110, 5123, 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, 5890, 5902, 5904, 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, 6018, 6069, 6110, 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, 6482, 6511, 6514, 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, 6919, 6965, 6983, 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, 7247, 7249, 7260, 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, 11570, 11625, 11650, 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, 11712, 11714, 11720, 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, 12355, 12440, 12449, 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, 12801, 13314, 19895, 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, 42242, 42509, 42514, 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, 43015, 43017, 43020, 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, 43261, 43303, 43314, 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, 43505, 43516, 43520, 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, 43635, 43640, 43644, 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, 43756, 43764, 43784, 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, 43970, 44004, 44034, 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, 64219, 64287, 64298, 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, 64850, 64913, 64916, 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, 65393, 65395, 65439, 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, 65500, 65502, 39, 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, 2417, 2536, 2545, 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, 3185, 3304, 3313, 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, 3883, 4162, 4171, 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, 6619, 6786, 6795, 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, 7259, 42530, 42539, 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, 43602, 43611, 44018, 44027, 65298, 65307, 2, 195, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 3, 69, 3, 2, 2, 2, 5, 71, 3, 2, 2, 2, 7, 73, 3, 2, 2, 2, 9, 75, 3, 2, 2, 2, 11, 77, 3, 2, 2, 2, 13, 79, 3, 2, 2, 2, 15, 81, 3, 2, 2, 2, 17, 83, 3, 2, 2, 2, 19, 85, 3, 2, 2, 2, 21, 87, 3, 2, 2, 2, 23, 89, 3, 2, 2, 2, 25, 91, 3, 2, 2, 2, 27, 93, 3, 2, 2, 2, 29, 96, 3, 2, 2, 2, 31, 99, 3, 2, 2, 2, 33, 101, 3, 2, 2, 2, 35, 104, 3, 2, 2, 2, 37, 106, 3, 2, 2, 2, 39, 108, 3, 2, 2, 2, 41, 120, 3, 2, 2, 2, 43, 132, 3, 2, 2, 2, 45, 137, 3, 2, 2, 2, 47, 143, 3, 2, 2, 2, 49, 149, 3, 2, 2, 2, 51, 162, 3, 2, 2, 2, 53, 168, 3, 2, 2, 2, 55, 175, 3, 2, 2, 2, 57, 177, 3, 2, 2, 2, 59, 179, 3, 2, 2, 2, 61, 181, 3, 2, 2, 2, 63, 183, 3, 2, 2, 2, 65, 185, 3, 2, 2, 2, 67, 187, 3, 2, 2, 2, 69, 70, 7, 46, 2, 2, 70, 4, 3, 2, 2, 2, 71, 72, 7, 42, 2, 2, 72, 6, 3, 2, 2, 2, 73, 74, 7, 43, 2, 2, 74, 8, 3, 2, 2, 2, 75, 76, 7, 93, 2, 2, 76, 10, 3, 2, 2, 2, 77, 78, 7, 95, 2, 2, 78, 12, 3, 2, 2, 2, 79, 80, 7, 48, 2, 2, 80, 14, 3, 2, 2, 2, 81, 82, 7, 45, 2, 2, 82, 16, 3, 2, 2, 2, 83, 84, 7, 47, 2, 2, 84, 18, 3, 2, 2, 2, 85, 86, 7, 44, 2, 2, 86, 20, 3, 2, 2, 2, 87, 88, 7, 49, 2, 2, 88, 22, 3, 2, 2, 2, 89, 90, 7, 96, 2, 2, 90, 24, 3, 2, 2, 2, 91, 92, 7, 63, 2, 2, 92, 26, 3, 2, 2, 2, 93, 94, 7, 35, 2, 2, 94, 95, 7, 63, 2, 2, 95, 28, 3, 2, 2, 2, 96, 97, 7, 62, 2, 2, 97, 98, 7, 63, 2, 2, 98, 30, 3, 2, 2, 2, 99, 100, 7, 62, 2, 2, 100, 32, 3, 2, 2, 2, 101, 102, 7, 64, 2, 2, 102, 103, 7, 63, 2, 2, 103, 34, 3, 2, 2, 2, 104, 105, 7, 64, 2, 2, 105, 36, 3, 2, 2, 2, 106, 107, 7, 40, 2, 2, 107, 38, 3, 2, 2, 2, 108, 114, 7, 36, 2, 2, 109, 113, 10, 2, 2, 2, 110, 111, 7, 36, 2, 2, 111, 113, 7, 36, 2, 2, 112, 109, 3, 2, 2, 2, 112, 110, 3, 2, 2, 2, 113, 116, 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 117, 3, 2, 2, 2, 116, 114, 3, 2, 2, 2, 117, 118, 7, 36, 2, 2, 118, 40, 3, 2, 2, 2, 119, 121, 9, 3, 2, 2, 120, 119, 3, 2, 2, 2, 121, 122, 3, 2, 2, 2, 122, 120, 3, 2, 2, 2, 122, 123, 3, 2, 2, 2, 123, 130, 3, 2, 2, 2, 124, 126, 7, 48, 2, 2, 125, 127, 9, 3, 2, 2, 126, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 126, 3, 2, 2, 2, 128, 129, 3, 2, 2, 2, 129, 131, 3, 2, 2, 2, 130, 124, 3, 2, 2, 2, 130, 131, 3, 2, 2, 2, 131, 42, 3, 2, 2, 2, 132, 133, 9, 4, 2, 2, 133, 134, 9, 5, 2, 2, 134, 135, 9, 6, 2, 2, 135, 136, 9, 7, 2, 2, 136, 44, 3, 2, 2, 2, 137, 138, 9, 8, 2, 2, 138, 139, 9, 9, 2, 2, 139, 140, 9, 10, 2, 2, 140, 141, 9, 11, 2, 2, 141, 142, 9, 7, 2, 2, 142, 46, 3, 2, 2, 2, 143, 144, 9, 12, 2, 2, 144, 145, 9, 6, 2, 2, 145, 146, 9, 10, 2, 2, 146, 147, 9, 10, 2, 2, 147, 48, 3, 2, 2, 2, 148, 150, 5, 55, 28, 2, 149, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 158, 3, 2, 2, 2, 153, 157, 5, 55, 28, 2, 154, 157, 5, 67, 34, 2, 155, 157, 7, 97, 2, 2, 156, 153, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 155, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 50, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 161, 163, 9, 13, 2, 2, 162, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 8, 26, 2, 2, 167, 52, 3, 2, 2, 2, 168, 169, 11, 2, 2, 2, 169, 54, 3, 2, 2, 2, 170, 176, 5, 57, 29, 2, 171, 176, 5, 59, 30, 2, 172, 176, 5, 61, 31, 2, 173, 176, 5, 63, 32, 2, 174, 176, 5, 65, 33, 2, 175, 170, 3, 2, 2, 2, 175, 171, 3, 2, 2, 2, 175, 172, 3, 2, 2, 2, 175, 173, 3, 2, 2, 2, 175, 174, 3, 2, 2, 2, 176, 56, 3, 2, 2, 2, 177, 178, 9, 14, 2, 2, 178, 58, 3, 2, 2, 2, 179, 180, 9, 15, 2, 2, 180, 60, 3, 2, 2, 2, 181, 182, 9, 16, 2, 2, 182, 62, 3, 2, 2, 2, 183, 184, 9, 17, 2, 2, 184, 64, 3, 2, 2, 2, 185, 186, 9, 18, 2, 2, 186, 66, 3, 2, 2, 2, 187, 188, 9, 19, 2, 2, 188, 68, 3, 2, 2, 2, 13, 2, 112, 114, 122, 128, 130, 151, 156, 158, 164, 175, 3, 8, 2, 2] \ No newline at end of file diff --git a/excellent/gen/Excellent2Lexer.tokens b/excellent/gen/Excellent2Lexer.tokens index 52e89064c..c38a70141 100644 --- a/excellent/gen/Excellent2Lexer.tokens +++ b/excellent/gen/Excellent2Lexer.tokens @@ -16,8 +16,8 @@ LT=15 GTE=16 GT=17 AMPERSAND=18 -DECIMAL=19 -STRING=20 +TEXT=19 +NUMBER=20 TRUE=21 FALSE=22 NULL=23 diff --git a/excellent/gen/excellent2_base_listener.go b/excellent/gen/excellent2_base_listener.go index 2217f0f96..1710e86d2 100644 --- a/excellent/gen/excellent2_base_listener.go +++ b/excellent/gen/excellent2_base_listener.go @@ -26,12 +26,6 @@ func (s *BaseExcellent2Listener) EnterParse(ctx *ParseContext) {} // ExitParse is called when production parse is exited. func (s *BaseExcellent2Listener) ExitParse(ctx *ParseContext) {} -// EnterDecimalLiteral is called when production decimalLiteral is entered. -func (s *BaseExcellent2Listener) EnterDecimalLiteral(ctx *DecimalLiteralContext) {} - -// ExitDecimalLiteral is called when production decimalLiteral is exited. -func (s *BaseExcellent2Listener) ExitDecimalLiteral(ctx *DecimalLiteralContext) {} - // EnterDotLookup is called when production dotLookup is entered. func (s *BaseExcellent2Listener) EnterDotLookup(ctx *DotLookupContext) {} @@ -44,12 +38,6 @@ func (s *BaseExcellent2Listener) EnterNull(ctx *NullContext) {} // ExitNull is called when production null is exited. func (s *BaseExcellent2Listener) ExitNull(ctx *NullContext) {} -// EnterStringLiteral is called when production stringLiteral is entered. -func (s *BaseExcellent2Listener) EnterStringLiteral(ctx *StringLiteralContext) {} - -// ExitStringLiteral is called when production stringLiteral is exited. -func (s *BaseExcellent2Listener) ExitStringLiteral(ctx *StringLiteralContext) {} - // EnterFunctionCall is called when production functionCall is entered. func (s *BaseExcellent2Listener) EnterFunctionCall(ctx *FunctionCallContext) {} @@ -80,6 +68,18 @@ func (s *BaseExcellent2Listener) EnterContextReference(ctx *ContextReferenceCont // ExitContextReference is called when production contextReference is exited. func (s *BaseExcellent2Listener) ExitContextReference(ctx *ContextReferenceContext) {} +// EnterTextLiteral is called when production textLiteral is entered. +func (s *BaseExcellent2Listener) EnterTextLiteral(ctx *TextLiteralContext) {} + +// ExitTextLiteral is called when production textLiteral is exited. +func (s *BaseExcellent2Listener) ExitTextLiteral(ctx *TextLiteralContext) {} + +// EnterNumberLiteral is called when production numberLiteral is entered. +func (s *BaseExcellent2Listener) EnterNumberLiteral(ctx *NumberLiteralContext) {} + +// ExitNumberLiteral is called when production numberLiteral is exited. +func (s *BaseExcellent2Listener) ExitNumberLiteral(ctx *NumberLiteralContext) {} + // EnterParentheses is called when production parentheses is entered. func (s *BaseExcellent2Listener) EnterParentheses(ctx *ParenthesesContext) {} diff --git a/excellent/gen/excellent2_base_visitor.go b/excellent/gen/excellent2_base_visitor.go index f5c1d1e41..8315add58 100644 --- a/excellent/gen/excellent2_base_visitor.go +++ b/excellent/gen/excellent2_base_visitor.go @@ -11,10 +11,6 @@ func (v *BaseExcellent2Visitor) VisitParse(ctx *ParseContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseExcellent2Visitor) VisitDecimalLiteral(ctx *DecimalLiteralContext) interface{} { - return v.VisitChildren(ctx) -} - func (v *BaseExcellent2Visitor) VisitDotLookup(ctx *DotLookupContext) interface{} { return v.VisitChildren(ctx) } @@ -23,10 +19,6 @@ func (v *BaseExcellent2Visitor) VisitNull(ctx *NullContext) interface{} { return v.VisitChildren(ctx) } -func (v *BaseExcellent2Visitor) VisitStringLiteral(ctx *StringLiteralContext) interface{} { - return v.VisitChildren(ctx) -} - func (v *BaseExcellent2Visitor) VisitFunctionCall(ctx *FunctionCallContext) interface{} { return v.VisitChildren(ctx) } @@ -47,6 +39,14 @@ func (v *BaseExcellent2Visitor) VisitContextReference(ctx *ContextReferenceConte return v.VisitChildren(ctx) } +func (v *BaseExcellent2Visitor) VisitTextLiteral(ctx *TextLiteralContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseExcellent2Visitor) VisitNumberLiteral(ctx *NumberLiteralContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseExcellent2Visitor) VisitParentheses(ctx *ParenthesesContext) interface{} { return v.VisitChildren(ctx) } diff --git a/excellent/gen/excellent2_lexer.go b/excellent/gen/excellent2_lexer.go index 696c6adc7..48c323380 100644 --- a/excellent/gen/excellent2_lexer.go +++ b/excellent/gen/excellent2_lexer.go @@ -24,20 +24,20 @@ var serializedLexerAtn = []uint16{ 4, 34, 9, 34, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, - 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 110, - 10, 20, 13, 20, 14, 20, 111, 3, 20, 3, 20, 6, 20, 116, 10, 20, 13, 20, - 14, 20, 117, 5, 20, 120, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 126, - 10, 21, 12, 21, 14, 21, 129, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, - 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, - 24, 3, 24, 3, 24, 3, 25, 6, 25, 150, 10, 25, 13, 25, 14, 25, 151, 3, 25, - 3, 25, 3, 25, 7, 25, 157, 10, 25, 12, 25, 14, 25, 160, 11, 25, 3, 26, 6, - 26, 163, 10, 26, 13, 26, 14, 26, 164, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, - 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 176, 10, 28, 3, 29, 3, 29, 3, 30, 3, - 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 2, 2, 35, 3, - 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, + 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, + 3, 20, 7, 20, 113, 10, 20, 12, 20, 14, 20, 116, 11, 20, 3, 20, 3, 20, 3, + 21, 6, 21, 121, 10, 21, 13, 21, 14, 21, 122, 3, 21, 3, 21, 6, 21, 127, + 10, 21, 13, 21, 14, 21, 128, 5, 21, 131, 10, 21, 3, 22, 3, 22, 3, 22, 3, + 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, + 3, 24, 3, 24, 3, 25, 6, 25, 150, 10, 25, 13, 25, 14, 25, 151, 3, 25, 3, + 25, 3, 25, 7, 25, 157, 10, 25, 12, 25, 14, 25, 160, 11, 25, 3, 26, 6, 26, + 163, 10, 26, 13, 26, 14, 26, 164, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, + 28, 3, 28, 3, 28, 3, 28, 5, 28, 176, 10, 28, 3, 29, 3, 29, 3, 30, 3, 30, + 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 2, 2, 35, 3, 3, + 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 2, 57, 2, 59, 2, 61, - 2, 63, 2, 65, 2, 67, 2, 3, 2, 20, 3, 2, 50, 59, 3, 2, 36, 36, 4, 2, 86, + 2, 63, 2, 65, 2, 67, 2, 3, 2, 20, 3, 2, 36, 36, 3, 2, 50, 59, 4, 2, 86, 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, 119, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, 99, 4, 2, 78, 78, 110, 110, 4, 2, 85, 85, 117, 117, 4, 2, 80, 80, 112, 112, 5, 2, 11, 12, @@ -132,7 +132,7 @@ var serializedLexerAtn = []uint16{ 2, 15, 81, 3, 2, 2, 2, 17, 83, 3, 2, 2, 2, 19, 85, 3, 2, 2, 2, 21, 87, 3, 2, 2, 2, 23, 89, 3, 2, 2, 2, 25, 91, 3, 2, 2, 2, 27, 93, 3, 2, 2, 2, 29, 96, 3, 2, 2, 2, 31, 99, 3, 2, 2, 2, 33, 101, 3, 2, 2, 2, 35, 104, 3, - 2, 2, 2, 37, 106, 3, 2, 2, 2, 39, 109, 3, 2, 2, 2, 41, 121, 3, 2, 2, 2, + 2, 2, 2, 37, 106, 3, 2, 2, 2, 39, 108, 3, 2, 2, 2, 41, 120, 3, 2, 2, 2, 43, 132, 3, 2, 2, 2, 45, 137, 3, 2, 2, 2, 47, 143, 3, 2, 2, 2, 49, 149, 3, 2, 2, 2, 51, 162, 3, 2, 2, 2, 53, 168, 3, 2, 2, 2, 55, 175, 3, 2, 2, 2, 57, 177, 3, 2, 2, 2, 59, 179, 3, 2, 2, 2, 61, 181, 3, 2, 2, 2, 63, 183, @@ -148,15 +148,15 @@ var serializedLexerAtn = []uint16{ 30, 3, 2, 2, 2, 99, 100, 7, 62, 2, 2, 100, 32, 3, 2, 2, 2, 101, 102, 7, 64, 2, 2, 102, 103, 7, 63, 2, 2, 103, 34, 3, 2, 2, 2, 104, 105, 7, 64, 2, 2, 105, 36, 3, 2, 2, 2, 106, 107, 7, 40, 2, 2, 107, 38, 3, 2, 2, 2, - 108, 110, 9, 2, 2, 2, 109, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, - 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 119, 3, 2, 2, 2, 113, 115, - 7, 48, 2, 2, 114, 116, 9, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 117, 3, 2, - 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 120, 3, 2, 2, 2, - 119, 113, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 40, 3, 2, 2, 2, 121, 127, - 7, 36, 2, 2, 122, 126, 10, 3, 2, 2, 123, 124, 7, 36, 2, 2, 124, 126, 7, - 36, 2, 2, 125, 122, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 129, 3, 2, 2, - 2, 127, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 130, 3, 2, 2, 2, 129, - 127, 3, 2, 2, 2, 130, 131, 7, 36, 2, 2, 131, 42, 3, 2, 2, 2, 132, 133, + 108, 114, 7, 36, 2, 2, 109, 113, 10, 2, 2, 2, 110, 111, 7, 36, 2, 2, 111, + 113, 7, 36, 2, 2, 112, 109, 3, 2, 2, 2, 112, 110, 3, 2, 2, 2, 113, 116, + 3, 2, 2, 2, 114, 112, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 117, 3, 2, + 2, 2, 116, 114, 3, 2, 2, 2, 117, 118, 7, 36, 2, 2, 118, 40, 3, 2, 2, 2, + 119, 121, 9, 3, 2, 2, 120, 119, 3, 2, 2, 2, 121, 122, 3, 2, 2, 2, 122, + 120, 3, 2, 2, 2, 122, 123, 3, 2, 2, 2, 123, 130, 3, 2, 2, 2, 124, 126, + 7, 48, 2, 2, 125, 127, 9, 3, 2, 2, 126, 125, 3, 2, 2, 2, 127, 128, 3, 2, + 2, 2, 128, 126, 3, 2, 2, 2, 128, 129, 3, 2, 2, 2, 129, 131, 3, 2, 2, 2, + 130, 124, 3, 2, 2, 2, 130, 131, 3, 2, 2, 2, 131, 42, 3, 2, 2, 2, 132, 133, 9, 4, 2, 2, 133, 134, 9, 5, 2, 2, 134, 135, 9, 6, 2, 2, 135, 136, 9, 7, 2, 2, 136, 44, 3, 2, 2, 2, 137, 138, 9, 8, 2, 2, 138, 139, 9, 9, 2, 2, 139, 140, 9, 10, 2, 2, 140, 141, 9, 11, 2, 2, 141, 142, 9, 7, 2, 2, 142, @@ -177,7 +177,7 @@ var serializedLexerAtn = []uint16{ 58, 3, 2, 2, 2, 179, 180, 9, 15, 2, 2, 180, 60, 3, 2, 2, 2, 181, 182, 9, 16, 2, 2, 182, 62, 3, 2, 2, 2, 183, 184, 9, 17, 2, 2, 184, 64, 3, 2, 2, 2, 185, 186, 9, 18, 2, 2, 186, 66, 3, 2, 2, 2, 187, 188, 9, 19, 2, 2, 188, - 68, 3, 2, 2, 2, 13, 2, 111, 117, 119, 125, 127, 151, 156, 158, 164, 175, + 68, 3, 2, 2, 2, 13, 2, 112, 114, 122, 128, 130, 151, 156, 158, 164, 175, 3, 8, 2, 2, } @@ -200,13 +200,13 @@ var lexerLiteralNames = []string{ var lexerSymbolicNames = []string{ "", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", "AMPERSAND", - "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", + "TEXT", "NUMBER", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", } var lexerRuleNames = []string{ "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", "AMPERSAND", - "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", "UnicodeLetter", + "TEXT", "NUMBER", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", "UnicodeLetter", "UnicodeClass_LU", "UnicodeClass_LL", "UnicodeClass_LT", "UnicodeClass_LM", "UnicodeClass_LO", "UnicodeDigit", } @@ -264,8 +264,8 @@ const ( Excellent2LexerGTE = 16 Excellent2LexerGT = 17 Excellent2LexerAMPERSAND = 18 - Excellent2LexerDECIMAL = 19 - Excellent2LexerSTRING = 20 + Excellent2LexerTEXT = 19 + Excellent2LexerNUMBER = 20 Excellent2LexerTRUE = 21 Excellent2LexerFALSE = 22 Excellent2LexerNULL = 23 diff --git a/excellent/gen/excellent2_listener.go b/excellent/gen/excellent2_listener.go index c5ec85b58..0236523ac 100644 --- a/excellent/gen/excellent2_listener.go +++ b/excellent/gen/excellent2_listener.go @@ -10,18 +10,12 @@ type Excellent2Listener interface { // EnterParse is called when entering the parse production. EnterParse(c *ParseContext) - // EnterDecimalLiteral is called when entering the decimalLiteral production. - EnterDecimalLiteral(c *DecimalLiteralContext) - // EnterDotLookup is called when entering the dotLookup production. EnterDotLookup(c *DotLookupContext) // EnterNull is called when entering the null production. EnterNull(c *NullContext) - // EnterStringLiteral is called when entering the stringLiteral production. - EnterStringLiteral(c *StringLiteralContext) - // EnterFunctionCall is called when entering the functionCall production. EnterFunctionCall(c *FunctionCallContext) @@ -37,6 +31,12 @@ type Excellent2Listener interface { // EnterContextReference is called when entering the contextReference production. EnterContextReference(c *ContextReferenceContext) + // EnterTextLiteral is called when entering the textLiteral production. + EnterTextLiteral(c *TextLiteralContext) + + // EnterNumberLiteral is called when entering the numberLiteral production. + EnterNumberLiteral(c *NumberLiteralContext) + // EnterParentheses is called when entering the parentheses production. EnterParentheses(c *ParenthesesContext) @@ -73,18 +73,12 @@ type Excellent2Listener interface { // ExitParse is called when exiting the parse production. ExitParse(c *ParseContext) - // ExitDecimalLiteral is called when exiting the decimalLiteral production. - ExitDecimalLiteral(c *DecimalLiteralContext) - // ExitDotLookup is called when exiting the dotLookup production. ExitDotLookup(c *DotLookupContext) // ExitNull is called when exiting the null production. ExitNull(c *NullContext) - // ExitStringLiteral is called when exiting the stringLiteral production. - ExitStringLiteral(c *StringLiteralContext) - // ExitFunctionCall is called when exiting the functionCall production. ExitFunctionCall(c *FunctionCallContext) @@ -100,6 +94,12 @@ type Excellent2Listener interface { // ExitContextReference is called when exiting the contextReference production. ExitContextReference(c *ContextReferenceContext) + // ExitTextLiteral is called when exiting the textLiteral production. + ExitTextLiteral(c *TextLiteralContext) + + // ExitNumberLiteral is called when exiting the numberLiteral production. + ExitNumberLiteral(c *NumberLiteralContext) + // ExitParentheses is called when exiting the parentheses production. ExitParentheses(c *ParenthesesContext) diff --git a/excellent/gen/excellent2_parser.go b/excellent/gen/excellent2_parser.go index 57d6e7d08..2f33c1dae 100644 --- a/excellent/gen/excellent2_parser.go +++ b/excellent/gen/excellent2_parser.go @@ -30,7 +30,7 @@ var parserATN = []uint16{ 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, 30, 3, 2, 2, 2, 23, 30, - 7, 26, 2, 2, 24, 30, 7, 22, 2, 2, 25, 30, 7, 21, 2, 2, 26, 30, 7, 23, 2, + 7, 26, 2, 2, 24, 30, 7, 21, 2, 2, 25, 30, 7, 22, 2, 2, 26, 30, 7, 23, 2, 2, 27, 30, 7, 24, 2, 2, 28, 30, 7, 25, 2, 2, 29, 15, 3, 2, 2, 2, 29, 23, 3, 2, 2, 2, 29, 24, 3, 2, 2, 2, 29, 25, 3, 2, 2, 2, 29, 26, 3, 2, 2, 2, 29, 27, 3, 2, 2, 2, 29, 28, 3, 2, 2, 2, 30, 41, 3, 2, 2, 2, 31, 32, 12, @@ -65,7 +65,7 @@ var literalNames = []string{ var symbolicNames = []string{ "", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", "AMPERSAND", - "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", + "TEXT", "NUMBER", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", } var ruleNames = []string{ @@ -118,8 +118,8 @@ const ( Excellent2ParserGTE = 16 Excellent2ParserGT = 17 Excellent2ParserAMPERSAND = 18 - Excellent2ParserDECIMAL = 19 - Excellent2ParserSTRING = 20 + Excellent2ParserTEXT = 19 + Excellent2ParserNUMBER = 20 Excellent2ParserTRUE = 21 Excellent2ParserFALSE = 22 Excellent2ParserNULL = 23 @@ -302,50 +302,6 @@ func (s *AtomContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s return antlr.TreesStringTree(s, ruleNames, recog) } -type DecimalLiteralContext struct { - *AtomContext -} - -func NewDecimalLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DecimalLiteralContext { - var p = new(DecimalLiteralContext) - - p.AtomContext = NewEmptyAtomContext() - p.parser = parser - p.CopyFrom(ctx.(*AtomContext)) - - return p -} - -func (s *DecimalLiteralContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *DecimalLiteralContext) DECIMAL() antlr.TerminalNode { - return s.GetToken(Excellent2ParserDECIMAL, 0) -} - -func (s *DecimalLiteralContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(Excellent2Listener); ok { - listenerT.EnterDecimalLiteral(s) - } -} - -func (s *DecimalLiteralContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(Excellent2Listener); ok { - listenerT.ExitDecimalLiteral(s) - } -} - -func (s *DecimalLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case Excellent2Visitor: - return t.VisitDecimalLiteral(s) - - default: - return t.VisitChildren(s) - } -} - type DotLookupContext struct { *AtomContext } @@ -457,50 +413,6 @@ func (s *NullContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } } -type StringLiteralContext struct { - *AtomContext -} - -func NewStringLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringLiteralContext { - var p = new(StringLiteralContext) - - p.AtomContext = NewEmptyAtomContext() - p.parser = parser - p.CopyFrom(ctx.(*AtomContext)) - - return p -} - -func (s *StringLiteralContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *StringLiteralContext) STRING() antlr.TerminalNode { - return s.GetToken(Excellent2ParserSTRING, 0) -} - -func (s *StringLiteralContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(Excellent2Listener); ok { - listenerT.EnterStringLiteral(s) - } -} - -func (s *StringLiteralContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(Excellent2Listener); ok { - listenerT.ExitStringLiteral(s) - } -} - -func (s *StringLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case Excellent2Visitor: - return t.VisitStringLiteral(s) - - default: - return t.VisitChildren(s) - } -} - type FunctionCallContext struct { *AtomContext } @@ -769,6 +681,94 @@ func (s *ContextReferenceContext) Accept(visitor antlr.ParseTreeVisitor) interfa } } +type TextLiteralContext struct { + *AtomContext +} + +func NewTextLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TextLiteralContext { + var p = new(TextLiteralContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *TextLiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TextLiteralContext) TEXT() antlr.TerminalNode { + return s.GetToken(Excellent2ParserTEXT, 0) +} + +func (s *TextLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent2Listener); ok { + listenerT.EnterTextLiteral(s) + } +} + +func (s *TextLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent2Listener); ok { + listenerT.ExitTextLiteral(s) + } +} + +func (s *TextLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent2Visitor: + return t.VisitTextLiteral(s) + + default: + return t.VisitChildren(s) + } +} + +type NumberLiteralContext struct { + *AtomContext +} + +func NewNumberLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NumberLiteralContext { + var p = new(NumberLiteralContext) + + p.AtomContext = NewEmptyAtomContext() + p.parser = parser + p.CopyFrom(ctx.(*AtomContext)) + + return p +} + +func (s *NumberLiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NumberLiteralContext) NUMBER() antlr.TerminalNode { + return s.GetToken(Excellent2ParserNUMBER, 0) +} + +func (s *NumberLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent2Listener); ok { + listenerT.EnterNumberLiteral(s) + } +} + +func (s *NumberLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(Excellent2Listener); ok { + listenerT.ExitNumberLiteral(s) + } +} + +func (s *NumberLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case Excellent2Visitor: + return t.VisitNumberLiteral(s) + + default: + return t.VisitChildren(s) + } +} + func (p *Excellent2Parser) Atom() (localctx IAtomContext) { return p.atom(0) } @@ -822,7 +822,7 @@ func (p *Excellent2Parser) atom(_p int) (localctx IAtomContext) { p.GetErrorHandler().Sync(p) _la = p.GetTokenStream().LA(1) - if ((_la)&-(0x1f+1)) == 0 && ((1< Date: Thu, 26 Apr 2018 16:14:23 -0500 Subject: [PATCH 4/8] Remove NULL as a token in legacy expressions --- antlr/Excellent1.g4 | 1 - legacy/gen/Excellent1.interp | 4 +- legacy/gen/Excellent1.tokens | 7 +- legacy/gen/Excellent1Lexer.interp | 5 +- legacy/gen/Excellent1Lexer.tokens | 7 +- legacy/gen/excellent1_lexer.go | 325 +++++++++++++++--------------- legacy/gen/excellent1_parser.go | 47 +++-- 7 files changed, 191 insertions(+), 205 deletions(-) diff --git a/antlr/Excellent1.g4 b/antlr/Excellent1.g4 index 0585e286e..c2d242062 100644 --- a/antlr/Excellent1.g4 +++ b/antlr/Excellent1.g4 @@ -33,7 +33,6 @@ STRING : '"' (~["] | '""')* '"'; TRUE : [Tt][Rr][Uu][Ee]; FALSE : [Ff][Aa][Ll][Ss][Ee]; -NULL : [Nn][Uu][Ll][Ll]; NAME : UnicodeLetter+ (UnicodeLetter | UnicodeDigit | '_')*; // variable names, e.g. contact.name or function names, e.g. SUM diff --git a/legacy/gen/Excellent1.interp b/legacy/gen/Excellent1.interp index 4ecbd3514..6bc9e87b8 100644 --- a/legacy/gen/Excellent1.interp +++ b/legacy/gen/Excellent1.interp @@ -25,7 +25,6 @@ null null null null -null token symbolic names: null @@ -51,7 +50,6 @@ DECIMAL STRING TRUE FALSE -NULL NAME WS ERROR @@ -65,4 +63,4 @@ parameters atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 28, 82, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 20, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 29, 10, 3, 3, 3, 3, 3, 3, 3, 7, 3, 34, 10, 3, 12, 3, 14, 3, 37, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 47, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 67, 10, 4, 12, 4, 14, 4, 70, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 7, 6, 77, 10, 6, 12, 6, 14, 6, 80, 11, 6, 3, 6, 2, 4, 4, 6, 7, 2, 4, 6, 8, 10, 2, 7, 3, 2, 11, 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, 2, 14, 15, 4, 2, 23, 24, 26, 26, 2, 92, 2, 12, 3, 2, 2, 2, 4, 28, 3, 2, 2, 2, 6, 46, 3, 2, 2, 2, 8, 71, 3, 2, 2, 2, 10, 73, 3, 2, 2, 2, 12, 13, 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, 29, 3, 2, 2, 2, 23, 29, 7, 26, 2, 2, 24, 29, 7, 22, 2, 2, 25, 29, 7, 21, 2, 2, 26, 29, 7, 23, 2, 2, 27, 29, 7, 24, 2, 2, 28, 15, 3, 2, 2, 2, 28, 23, 3, 2, 2, 2, 28, 24, 3, 2, 2, 2, 28, 25, 3, 2, 2, 2, 28, 26, 3, 2, 2, 2, 28, 27, 3, 2, 2, 2, 29, 35, 3, 2, 2, 2, 30, 31, 12, 8, 2, 2, 31, 32, 7, 8, 2, 2, 32, 34, 5, 4, 3, 9, 33, 30, 3, 2, 2, 2, 34, 37, 3, 2, 2, 2, 35, 33, 3, 2, 2, 2, 35, 36, 3, 2, 2, 2, 36, 5, 3, 2, 2, 2, 37, 35, 3, 2, 2, 2, 38, 39, 8, 4, 1, 2, 39, 47, 5, 4, 3, 2, 40, 41, 7, 10, 2, 2, 41, 47, 5, 6, 4, 10, 42, 43, 7, 4, 2, 2, 43, 44, 5, 6, 4, 2, 44, 45, 7, 5, 2, 2, 45, 47, 3, 2, 2, 2, 46, 38, 3, 2, 2, 2, 46, 40, 3, 2, 2, 2, 46, 42, 3, 2, 2, 2, 47, 68, 3, 2, 2, 2, 48, 49, 12, 9, 2, 2, 49, 50, 7, 13, 2, 2, 50, 67, 5, 6, 4, 10, 51, 52, 12, 8, 2, 2, 52, 53, 9, 2, 2, 2, 53, 67, 5, 6, 4, 9, 54, 55, 12, 7, 2, 2, 55, 56, 9, 3, 2, 2, 56, 67, 5, 6, 4, 8, 57, 58, 12, 6, 2, 2, 58, 59, 9, 4, 2, 2, 59, 67, 5, 6, 4, 7, 60, 61, 12, 5, 2, 2, 61, 62, 9, 5, 2, 2, 62, 67, 5, 6, 4, 6, 63, 64, 12, 4, 2, 2, 64, 65, 7, 20, 2, 2, 65, 67, 5, 6, 4, 5, 66, 48, 3, 2, 2, 2, 66, 51, 3, 2, 2, 2, 66, 54, 3, 2, 2, 2, 66, 57, 3, 2, 2, 2, 66, 60, 3, 2, 2, 2, 66, 63, 3, 2, 2, 2, 67, 70, 3, 2, 2, 2, 68, 66, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 7, 3, 2, 2, 2, 70, 68, 3, 2, 2, 2, 71, 72, 9, 6, 2, 2, 72, 9, 3, 2, 2, 2, 73, 78, 5, 6, 4, 2, 74, 75, 7, 3, 2, 2, 75, 77, 5, 6, 4, 2, 76, 74, 3, 2, 2, 2, 77, 80, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 78, 79, 3, 2, 2, 2, 79, 11, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 9, 19, 28, 35, 46, 66, 68, 78] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 27, 82, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 20, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 29, 10, 3, 3, 3, 3, 3, 3, 3, 7, 3, 34, 10, 3, 12, 3, 14, 3, 37, 11, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 47, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 67, 10, 4, 12, 4, 14, 4, 70, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 7, 6, 77, 10, 6, 12, 6, 14, 6, 80, 11, 6, 3, 6, 2, 4, 4, 6, 7, 2, 4, 6, 8, 10, 2, 7, 3, 2, 11, 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, 2, 14, 15, 3, 2, 23, 25, 2, 92, 2, 12, 3, 2, 2, 2, 4, 28, 3, 2, 2, 2, 6, 46, 3, 2, 2, 2, 8, 71, 3, 2, 2, 2, 10, 73, 3, 2, 2, 2, 12, 13, 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, 2, 2, 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 22, 7, 5, 2, 2, 22, 29, 3, 2, 2, 2, 23, 29, 7, 25, 2, 2, 24, 29, 7, 22, 2, 2, 25, 29, 7, 21, 2, 2, 26, 29, 7, 23, 2, 2, 27, 29, 7, 24, 2, 2, 28, 15, 3, 2, 2, 2, 28, 23, 3, 2, 2, 2, 28, 24, 3, 2, 2, 2, 28, 25, 3, 2, 2, 2, 28, 26, 3, 2, 2, 2, 28, 27, 3, 2, 2, 2, 29, 35, 3, 2, 2, 2, 30, 31, 12, 8, 2, 2, 31, 32, 7, 8, 2, 2, 32, 34, 5, 4, 3, 9, 33, 30, 3, 2, 2, 2, 34, 37, 3, 2, 2, 2, 35, 33, 3, 2, 2, 2, 35, 36, 3, 2, 2, 2, 36, 5, 3, 2, 2, 2, 37, 35, 3, 2, 2, 2, 38, 39, 8, 4, 1, 2, 39, 47, 5, 4, 3, 2, 40, 41, 7, 10, 2, 2, 41, 47, 5, 6, 4, 10, 42, 43, 7, 4, 2, 2, 43, 44, 5, 6, 4, 2, 44, 45, 7, 5, 2, 2, 45, 47, 3, 2, 2, 2, 46, 38, 3, 2, 2, 2, 46, 40, 3, 2, 2, 2, 46, 42, 3, 2, 2, 2, 47, 68, 3, 2, 2, 2, 48, 49, 12, 9, 2, 2, 49, 50, 7, 13, 2, 2, 50, 67, 5, 6, 4, 10, 51, 52, 12, 8, 2, 2, 52, 53, 9, 2, 2, 2, 53, 67, 5, 6, 4, 9, 54, 55, 12, 7, 2, 2, 55, 56, 9, 3, 2, 2, 56, 67, 5, 6, 4, 8, 57, 58, 12, 6, 2, 2, 58, 59, 9, 4, 2, 2, 59, 67, 5, 6, 4, 7, 60, 61, 12, 5, 2, 2, 61, 62, 9, 5, 2, 2, 62, 67, 5, 6, 4, 6, 63, 64, 12, 4, 2, 2, 64, 65, 7, 20, 2, 2, 65, 67, 5, 6, 4, 5, 66, 48, 3, 2, 2, 2, 66, 51, 3, 2, 2, 2, 66, 54, 3, 2, 2, 2, 66, 57, 3, 2, 2, 2, 66, 60, 3, 2, 2, 2, 66, 63, 3, 2, 2, 2, 67, 70, 3, 2, 2, 2, 68, 66, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 7, 3, 2, 2, 2, 70, 68, 3, 2, 2, 2, 71, 72, 9, 6, 2, 2, 72, 9, 3, 2, 2, 2, 73, 78, 5, 6, 4, 2, 74, 75, 7, 3, 2, 2, 75, 77, 5, 6, 4, 2, 76, 74, 3, 2, 2, 2, 77, 80, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 78, 79, 3, 2, 2, 2, 79, 11, 3, 2, 2, 2, 80, 78, 3, 2, 2, 2, 9, 19, 28, 35, 46, 66, 68, 78] \ No newline at end of file diff --git a/legacy/gen/Excellent1.tokens b/legacy/gen/Excellent1.tokens index 709791104..112926e5d 100644 --- a/legacy/gen/Excellent1.tokens +++ b/legacy/gen/Excellent1.tokens @@ -20,10 +20,9 @@ DECIMAL=19 STRING=20 TRUE=21 FALSE=22 -NULL=23 -NAME=24 -WS=25 -ERROR=26 +NAME=23 +WS=24 +ERROR=25 ','=1 '('=2 ')'=3 diff --git a/legacy/gen/Excellent1Lexer.interp b/legacy/gen/Excellent1Lexer.interp index 9647513ba..4604a2044 100644 --- a/legacy/gen/Excellent1Lexer.interp +++ b/legacy/gen/Excellent1Lexer.interp @@ -25,7 +25,6 @@ null null null null -null token symbolic names: null @@ -51,7 +50,6 @@ DECIMAL STRING TRUE FALSE -NULL NAME WS ERROR @@ -79,7 +77,6 @@ DECIMAL STRING TRUE FALSE -NULL NAME WS ERROR @@ -99,4 +96,4 @@ mode names: DEFAULT_MODE atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 28, 189, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 110, 10, 20, 13, 20, 14, 20, 111, 3, 20, 3, 20, 6, 20, 116, 10, 20, 13, 20, 14, 20, 117, 5, 20, 120, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 126, 10, 21, 12, 21, 14, 21, 129, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 6, 25, 150, 10, 25, 13, 25, 14, 25, 151, 3, 25, 3, 25, 3, 25, 7, 25, 157, 10, 25, 12, 25, 14, 25, 160, 11, 25, 3, 26, 6, 26, 163, 10, 26, 13, 26, 14, 26, 164, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 176, 10, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 2, 2, 35, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 2, 57, 2, 59, 2, 61, 2, 63, 2, 65, 2, 67, 2, 3, 2, 20, 3, 2, 50, 59, 3, 2, 36, 36, 4, 2, 86, 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, 119, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, 99, 4, 2, 78, 78, 110, 110, 4, 2, 85, 85, 117, 117, 4, 2, 80, 80, 112, 112, 5, 2, 11, 12, 15, 15, 34, 34, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, 332, 383, 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, 418, 420, 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, 504, 506, 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, 897, 904, 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, 1020, 1023, 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, 4295, 4297, 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, 7985, 7994, 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, 8141, 8154, 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, 8468, 8471, 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, 11312, 11362, 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, 11501, 11503, 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, 42864, 42875, 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, 65315, 65340, 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, 391, 394, 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, 456, 462, 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, 885, 889, 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, 1155, 1165, 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, 7580, 7683, 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, 8007, 8018, 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, 8105, 8114, 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, 8153, 8162, 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, 8511, 8520, 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, 11395, 11502, 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, 42653, 42789, 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, 42899, 42903, 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, 64281, 65347, 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, 8126, 8142, 8190, 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, 886, 892, 1371, 1602, 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, 3656, 3784, 4350, 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, 8321, 8338, 8350, 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, 40983, 42239, 42510, 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, 43003, 43473, 43496, 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, 236, 2, 172, 188, 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, 1648, 1649, 1651, 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, 1971, 2028, 2050, 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, 2394, 2403, 2420, 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, 2484, 2491, 2495, 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, 2577, 2578, 2581, 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, 2651, 2654, 2656, 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, 2740, 2741, 2743, 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, 2837, 2858, 2860, 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, 2951, 2956, 2960, 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, 3026, 3086, 3088, 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, 3220, 3242, 3244, 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, 3335, 3342, 3344, 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, 3463, 3480, 3484, 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, 3650, 3655, 3715, 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, 3751, 3753, 3756, 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, 3842, 3913, 3915, 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, 4195, 4210, 4215, 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, 4698, 4703, 4706, 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, 4802, 4807, 4810, 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, 5026, 5110, 5123, 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, 5890, 5902, 5904, 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, 6018, 6069, 6110, 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, 6482, 6511, 6514, 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, 6919, 6965, 6983, 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, 7247, 7249, 7260, 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, 11570, 11625, 11650, 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, 11712, 11714, 11720, 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, 12355, 12440, 12449, 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, 12801, 13314, 19895, 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, 42242, 42509, 42514, 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, 43015, 43017, 43020, 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, 43261, 43303, 43314, 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, 43505, 43516, 43520, 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, 43635, 43640, 43644, 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, 43756, 43764, 43784, 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, 43970, 44004, 44034, 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, 64219, 64287, 64298, 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, 64850, 64913, 64916, 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, 65393, 65395, 65439, 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, 65500, 65502, 39, 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, 2417, 2536, 2545, 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, 3185, 3304, 3313, 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, 3883, 4162, 4171, 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, 6619, 6786, 6795, 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, 7259, 42530, 42539, 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, 43602, 43611, 44018, 44027, 65298, 65307, 2, 195, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 3, 69, 3, 2, 2, 2, 5, 71, 3, 2, 2, 2, 7, 73, 3, 2, 2, 2, 9, 75, 3, 2, 2, 2, 11, 77, 3, 2, 2, 2, 13, 79, 3, 2, 2, 2, 15, 81, 3, 2, 2, 2, 17, 83, 3, 2, 2, 2, 19, 85, 3, 2, 2, 2, 21, 87, 3, 2, 2, 2, 23, 89, 3, 2, 2, 2, 25, 91, 3, 2, 2, 2, 27, 93, 3, 2, 2, 2, 29, 96, 3, 2, 2, 2, 31, 99, 3, 2, 2, 2, 33, 101, 3, 2, 2, 2, 35, 104, 3, 2, 2, 2, 37, 106, 3, 2, 2, 2, 39, 109, 3, 2, 2, 2, 41, 121, 3, 2, 2, 2, 43, 132, 3, 2, 2, 2, 45, 137, 3, 2, 2, 2, 47, 143, 3, 2, 2, 2, 49, 149, 3, 2, 2, 2, 51, 162, 3, 2, 2, 2, 53, 168, 3, 2, 2, 2, 55, 175, 3, 2, 2, 2, 57, 177, 3, 2, 2, 2, 59, 179, 3, 2, 2, 2, 61, 181, 3, 2, 2, 2, 63, 183, 3, 2, 2, 2, 65, 185, 3, 2, 2, 2, 67, 187, 3, 2, 2, 2, 69, 70, 7, 46, 2, 2, 70, 4, 3, 2, 2, 2, 71, 72, 7, 42, 2, 2, 72, 6, 3, 2, 2, 2, 73, 74, 7, 43, 2, 2, 74, 8, 3, 2, 2, 2, 75, 76, 7, 93, 2, 2, 76, 10, 3, 2, 2, 2, 77, 78, 7, 95, 2, 2, 78, 12, 3, 2, 2, 2, 79, 80, 7, 48, 2, 2, 80, 14, 3, 2, 2, 2, 81, 82, 7, 45, 2, 2, 82, 16, 3, 2, 2, 2, 83, 84, 7, 47, 2, 2, 84, 18, 3, 2, 2, 2, 85, 86, 7, 44, 2, 2, 86, 20, 3, 2, 2, 2, 87, 88, 7, 49, 2, 2, 88, 22, 3, 2, 2, 2, 89, 90, 7, 96, 2, 2, 90, 24, 3, 2, 2, 2, 91, 92, 7, 63, 2, 2, 92, 26, 3, 2, 2, 2, 93, 94, 7, 62, 2, 2, 94, 95, 7, 64, 2, 2, 95, 28, 3, 2, 2, 2, 96, 97, 7, 62, 2, 2, 97, 98, 7, 63, 2, 2, 98, 30, 3, 2, 2, 2, 99, 100, 7, 62, 2, 2, 100, 32, 3, 2, 2, 2, 101, 102, 7, 64, 2, 2, 102, 103, 7, 63, 2, 2, 103, 34, 3, 2, 2, 2, 104, 105, 7, 64, 2, 2, 105, 36, 3, 2, 2, 2, 106, 107, 7, 40, 2, 2, 107, 38, 3, 2, 2, 2, 108, 110, 9, 2, 2, 2, 109, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 119, 3, 2, 2, 2, 113, 115, 7, 48, 2, 2, 114, 116, 9, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 117, 3, 2, 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 120, 3, 2, 2, 2, 119, 113, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 40, 3, 2, 2, 2, 121, 127, 7, 36, 2, 2, 122, 126, 10, 3, 2, 2, 123, 124, 7, 36, 2, 2, 124, 126, 7, 36, 2, 2, 125, 122, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 129, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 130, 3, 2, 2, 2, 129, 127, 3, 2, 2, 2, 130, 131, 7, 36, 2, 2, 131, 42, 3, 2, 2, 2, 132, 133, 9, 4, 2, 2, 133, 134, 9, 5, 2, 2, 134, 135, 9, 6, 2, 2, 135, 136, 9, 7, 2, 2, 136, 44, 3, 2, 2, 2, 137, 138, 9, 8, 2, 2, 138, 139, 9, 9, 2, 2, 139, 140, 9, 10, 2, 2, 140, 141, 9, 11, 2, 2, 141, 142, 9, 7, 2, 2, 142, 46, 3, 2, 2, 2, 143, 144, 9, 12, 2, 2, 144, 145, 9, 6, 2, 2, 145, 146, 9, 10, 2, 2, 146, 147, 9, 10, 2, 2, 147, 48, 3, 2, 2, 2, 148, 150, 5, 55, 28, 2, 149, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 158, 3, 2, 2, 2, 153, 157, 5, 55, 28, 2, 154, 157, 5, 67, 34, 2, 155, 157, 7, 97, 2, 2, 156, 153, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 155, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 50, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 161, 163, 9, 13, 2, 2, 162, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 8, 26, 2, 2, 167, 52, 3, 2, 2, 2, 168, 169, 11, 2, 2, 2, 169, 54, 3, 2, 2, 2, 170, 176, 5, 57, 29, 2, 171, 176, 5, 59, 30, 2, 172, 176, 5, 61, 31, 2, 173, 176, 5, 63, 32, 2, 174, 176, 5, 65, 33, 2, 175, 170, 3, 2, 2, 2, 175, 171, 3, 2, 2, 2, 175, 172, 3, 2, 2, 2, 175, 173, 3, 2, 2, 2, 175, 174, 3, 2, 2, 2, 176, 56, 3, 2, 2, 2, 177, 178, 9, 14, 2, 2, 178, 58, 3, 2, 2, 2, 179, 180, 9, 15, 2, 2, 180, 60, 3, 2, 2, 2, 181, 182, 9, 16, 2, 2, 182, 62, 3, 2, 2, 2, 183, 184, 9, 17, 2, 2, 184, 64, 3, 2, 2, 2, 185, 186, 9, 18, 2, 2, 186, 66, 3, 2, 2, 2, 187, 188, 9, 19, 2, 2, 188, 68, 3, 2, 2, 2, 13, 2, 111, 117, 119, 125, 127, 151, 156, 158, 164, 175, 3, 8, 2, 2] \ No newline at end of file +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 27, 182, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 108, 10, 20, 13, 20, 14, 20, 109, 3, 20, 3, 20, 6, 20, 114, 10, 20, 13, 20, 14, 20, 115, 5, 20, 118, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 124, 10, 21, 12, 21, 14, 21, 127, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 6, 24, 143, 10, 24, 13, 24, 14, 24, 144, 3, 24, 3, 24, 3, 24, 7, 24, 150, 10, 24, 12, 24, 14, 24, 153, 11, 24, 3, 25, 6, 25, 156, 10, 25, 13, 25, 14, 25, 157, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 169, 10, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 2, 2, 34, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 2, 55, 2, 57, 2, 59, 2, 61, 2, 63, 2, 65, 2, 3, 2, 19, 3, 2, 50, 59, 3, 2, 36, 36, 4, 2, 86, 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, 119, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, 99, 4, 2, 78, 78, 110, 110, 4, 2, 85, 85, 117, 117, 5, 2, 11, 12, 15, 15, 34, 34, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, 332, 383, 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, 418, 420, 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, 504, 506, 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, 897, 904, 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, 1020, 1023, 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, 4295, 4297, 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, 7985, 7994, 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, 8141, 8154, 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, 8468, 8471, 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, 11312, 11362, 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, 11501, 11503, 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, 42864, 42875, 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, 65315, 65340, 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, 391, 394, 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, 456, 462, 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, 885, 889, 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, 1155, 1165, 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, 7580, 7683, 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, 8007, 8018, 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, 8105, 8114, 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, 8153, 8162, 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, 8511, 8520, 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, 11395, 11502, 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, 42653, 42789, 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, 42899, 42903, 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, 64281, 65347, 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, 8126, 8142, 8190, 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, 886, 892, 1371, 1602, 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, 3656, 3784, 4350, 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, 8321, 8338, 8350, 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, 40983, 42239, 42510, 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, 43003, 43473, 43496, 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, 236, 2, 172, 188, 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, 1648, 1649, 1651, 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, 1971, 2028, 2050, 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, 2394, 2403, 2420, 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, 2484, 2491, 2495, 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, 2577, 2578, 2581, 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, 2651, 2654, 2656, 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, 2740, 2741, 2743, 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, 2837, 2858, 2860, 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, 2951, 2956, 2960, 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, 3026, 3086, 3088, 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, 3220, 3242, 3244, 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, 3335, 3342, 3344, 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, 3463, 3480, 3484, 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, 3650, 3655, 3715, 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, 3751, 3753, 3756, 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, 3842, 3913, 3915, 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, 4195, 4210, 4215, 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, 4698, 4703, 4706, 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, 4802, 4807, 4810, 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, 5026, 5110, 5123, 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, 5890, 5902, 5904, 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, 6018, 6069, 6110, 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, 6482, 6511, 6514, 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, 6919, 6965, 6983, 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, 7247, 7249, 7260, 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, 11570, 11625, 11650, 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, 11712, 11714, 11720, 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, 12355, 12440, 12449, 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, 12801, 13314, 19895, 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, 42242, 42509, 42514, 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, 43015, 43017, 43020, 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, 43261, 43303, 43314, 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, 43505, 43516, 43520, 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, 43635, 43640, 43644, 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, 43756, 43764, 43784, 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, 43970, 44004, 44034, 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, 64219, 64287, 64298, 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, 64850, 64913, 64916, 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, 65393, 65395, 65439, 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, 65500, 65502, 39, 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, 2417, 2536, 2545, 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, 3185, 3304, 3313, 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, 3883, 4162, 4171, 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, 6619, 6786, 6795, 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, 7259, 42530, 42539, 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, 43602, 43611, 44018, 44027, 65298, 65307, 2, 188, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 3, 67, 3, 2, 2, 2, 5, 69, 3, 2, 2, 2, 7, 71, 3, 2, 2, 2, 9, 73, 3, 2, 2, 2, 11, 75, 3, 2, 2, 2, 13, 77, 3, 2, 2, 2, 15, 79, 3, 2, 2, 2, 17, 81, 3, 2, 2, 2, 19, 83, 3, 2, 2, 2, 21, 85, 3, 2, 2, 2, 23, 87, 3, 2, 2, 2, 25, 89, 3, 2, 2, 2, 27, 91, 3, 2, 2, 2, 29, 94, 3, 2, 2, 2, 31, 97, 3, 2, 2, 2, 33, 99, 3, 2, 2, 2, 35, 102, 3, 2, 2, 2, 37, 104, 3, 2, 2, 2, 39, 107, 3, 2, 2, 2, 41, 119, 3, 2, 2, 2, 43, 130, 3, 2, 2, 2, 45, 135, 3, 2, 2, 2, 47, 142, 3, 2, 2, 2, 49, 155, 3, 2, 2, 2, 51, 161, 3, 2, 2, 2, 53, 168, 3, 2, 2, 2, 55, 170, 3, 2, 2, 2, 57, 172, 3, 2, 2, 2, 59, 174, 3, 2, 2, 2, 61, 176, 3, 2, 2, 2, 63, 178, 3, 2, 2, 2, 65, 180, 3, 2, 2, 2, 67, 68, 7, 46, 2, 2, 68, 4, 3, 2, 2, 2, 69, 70, 7, 42, 2, 2, 70, 6, 3, 2, 2, 2, 71, 72, 7, 43, 2, 2, 72, 8, 3, 2, 2, 2, 73, 74, 7, 93, 2, 2, 74, 10, 3, 2, 2, 2, 75, 76, 7, 95, 2, 2, 76, 12, 3, 2, 2, 2, 77, 78, 7, 48, 2, 2, 78, 14, 3, 2, 2, 2, 79, 80, 7, 45, 2, 2, 80, 16, 3, 2, 2, 2, 81, 82, 7, 47, 2, 2, 82, 18, 3, 2, 2, 2, 83, 84, 7, 44, 2, 2, 84, 20, 3, 2, 2, 2, 85, 86, 7, 49, 2, 2, 86, 22, 3, 2, 2, 2, 87, 88, 7, 96, 2, 2, 88, 24, 3, 2, 2, 2, 89, 90, 7, 63, 2, 2, 90, 26, 3, 2, 2, 2, 91, 92, 7, 62, 2, 2, 92, 93, 7, 64, 2, 2, 93, 28, 3, 2, 2, 2, 94, 95, 7, 62, 2, 2, 95, 96, 7, 63, 2, 2, 96, 30, 3, 2, 2, 2, 97, 98, 7, 62, 2, 2, 98, 32, 3, 2, 2, 2, 99, 100, 7, 64, 2, 2, 100, 101, 7, 63, 2, 2, 101, 34, 3, 2, 2, 2, 102, 103, 7, 64, 2, 2, 103, 36, 3, 2, 2, 2, 104, 105, 7, 40, 2, 2, 105, 38, 3, 2, 2, 2, 106, 108, 9, 2, 2, 2, 107, 106, 3, 2, 2, 2, 108, 109, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 117, 3, 2, 2, 2, 111, 113, 7, 48, 2, 2, 112, 114, 9, 2, 2, 2, 113, 112, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 115, 116, 3, 2, 2, 2, 116, 118, 3, 2, 2, 2, 117, 111, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 40, 3, 2, 2, 2, 119, 125, 7, 36, 2, 2, 120, 124, 10, 3, 2, 2, 121, 122, 7, 36, 2, 2, 122, 124, 7, 36, 2, 2, 123, 120, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 124, 127, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 128, 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 128, 129, 7, 36, 2, 2, 129, 42, 3, 2, 2, 2, 130, 131, 9, 4, 2, 2, 131, 132, 9, 5, 2, 2, 132, 133, 9, 6, 2, 2, 133, 134, 9, 7, 2, 2, 134, 44, 3, 2, 2, 2, 135, 136, 9, 8, 2, 2, 136, 137, 9, 9, 2, 2, 137, 138, 9, 10, 2, 2, 138, 139, 9, 11, 2, 2, 139, 140, 9, 7, 2, 2, 140, 46, 3, 2, 2, 2, 141, 143, 5, 53, 27, 2, 142, 141, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 142, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 151, 3, 2, 2, 2, 146, 150, 5, 53, 27, 2, 147, 150, 5, 65, 33, 2, 148, 150, 7, 97, 2, 2, 149, 146, 3, 2, 2, 2, 149, 147, 3, 2, 2, 2, 149, 148, 3, 2, 2, 2, 150, 153, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 48, 3, 2, 2, 2, 153, 151, 3, 2, 2, 2, 154, 156, 9, 12, 2, 2, 155, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 155, 3, 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 160, 8, 25, 2, 2, 160, 50, 3, 2, 2, 2, 161, 162, 11, 2, 2, 2, 162, 52, 3, 2, 2, 2, 163, 169, 5, 55, 28, 2, 164, 169, 5, 57, 29, 2, 165, 169, 5, 59, 30, 2, 166, 169, 5, 61, 31, 2, 167, 169, 5, 63, 32, 2, 168, 163, 3, 2, 2, 2, 168, 164, 3, 2, 2, 2, 168, 165, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 168, 167, 3, 2, 2, 2, 169, 54, 3, 2, 2, 2, 170, 171, 9, 13, 2, 2, 171, 56, 3, 2, 2, 2, 172, 173, 9, 14, 2, 2, 173, 58, 3, 2, 2, 2, 174, 175, 9, 15, 2, 2, 175, 60, 3, 2, 2, 2, 176, 177, 9, 16, 2, 2, 177, 62, 3, 2, 2, 2, 178, 179, 9, 17, 2, 2, 179, 64, 3, 2, 2, 2, 180, 181, 9, 18, 2, 2, 181, 66, 3, 2, 2, 2, 13, 2, 109, 115, 117, 123, 125, 144, 149, 151, 157, 168, 3, 8, 2, 2] \ No newline at end of file diff --git a/legacy/gen/Excellent1Lexer.tokens b/legacy/gen/Excellent1Lexer.tokens index 709791104..112926e5d 100644 --- a/legacy/gen/Excellent1Lexer.tokens +++ b/legacy/gen/Excellent1Lexer.tokens @@ -20,10 +20,9 @@ DECIMAL=19 STRING=20 TRUE=21 FALSE=22 -NULL=23 -NAME=24 -WS=25 -ERROR=26 +NAME=23 +WS=24 +ERROR=25 ','=1 '('=2 ')'=3 diff --git a/legacy/gen/excellent1_lexer.go b/legacy/gen/excellent1_lexer.go index c397155a7..4d9c4dd40 100644 --- a/legacy/gen/excellent1_lexer.go +++ b/legacy/gen/excellent1_lexer.go @@ -14,171 +14,167 @@ var _ = fmt.Printf var _ = unicode.IsLetter var serializedLexerAtn = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 28, 189, + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 27, 182, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, - 4, 34, 9, 34, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, - 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, - 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, - 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 110, - 10, 20, 13, 20, 14, 20, 111, 3, 20, 3, 20, 6, 20, 116, 10, 20, 13, 20, - 14, 20, 117, 5, 20, 120, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 126, - 10, 21, 12, 21, 14, 21, 129, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, - 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, - 24, 3, 24, 3, 24, 3, 25, 6, 25, 150, 10, 25, 13, 25, 14, 25, 151, 3, 25, - 3, 25, 3, 25, 7, 25, 157, 10, 25, 12, 25, 14, 25, 160, 11, 25, 3, 26, 6, - 26, 163, 10, 26, 13, 26, 14, 26, 164, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, - 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 176, 10, 28, 3, 29, 3, 29, 3, 30, 3, - 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 2, 2, 35, 3, - 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, - 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, - 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 2, 57, 2, 59, 2, 61, - 2, 63, 2, 65, 2, 67, 2, 3, 2, 20, 3, 2, 50, 59, 3, 2, 36, 36, 4, 2, 86, - 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, 119, 4, 2, 71, - 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, 99, 4, 2, 78, 78, - 110, 110, 4, 2, 85, 85, 117, 117, 4, 2, 80, 80, 112, 112, 5, 2, 11, 12, - 15, 15, 34, 34, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, - 332, 383, 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, - 418, 420, 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, - 504, 506, 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, - 897, 904, 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, - 1020, 1023, 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, - 4295, 4297, 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, - 7985, 7994, 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, - 8141, 8154, 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, - 8468, 8471, 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, - 11312, 11362, 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, - 11501, 11503, 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, - 42864, 42875, 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, - 65315, 65340, 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, - 391, 394, 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, - 456, 462, 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, - 885, 889, 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, - 1155, 1165, 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, - 7580, 7683, 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, - 8007, 8018, 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, - 8105, 8114, 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, - 8153, 8162, 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, - 8511, 8520, 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, - 11395, 11502, 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, - 42653, 42789, 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, - 42899, 42903, 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, - 64281, 65347, 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, - 8126, 8142, 8190, 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, - 886, 892, 1371, 1602, 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, - 3656, 3784, 4350, 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, - 8321, 8338, 8350, 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, - 40983, 42239, 42510, 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, - 43003, 43473, 43496, 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, - 236, 2, 172, 188, 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, - 1648, 1649, 1651, 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, - 1971, 2028, 2050, 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, - 2394, 2403, 2420, 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, - 2484, 2491, 2495, 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, - 2577, 2578, 2581, 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, - 2651, 2654, 2656, 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, - 2740, 2741, 2743, 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, - 2837, 2858, 2860, 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, - 2951, 2956, 2960, 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, - 3026, 3086, 3088, 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, - 3220, 3242, 3244, 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, - 3335, 3342, 3344, 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, - 3463, 3480, 3484, 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, - 3650, 3655, 3715, 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, - 3751, 3753, 3756, 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, - 3842, 3913, 3915, 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, - 4195, 4210, 4215, 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, - 4698, 4703, 4706, 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, - 4802, 4807, 4810, 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, - 5026, 5110, 5123, 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, - 5890, 5902, 5904, 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, - 6018, 6069, 6110, 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, - 6482, 6511, 6514, 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, - 6919, 6965, 6983, 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, - 7247, 7249, 7260, 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, - 11570, 11625, 11650, 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, - 11712, 11714, 11720, 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, - 12355, 12440, 12449, 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, - 12801, 13314, 19895, 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, - 42242, 42509, 42514, 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, - 43015, 43017, 43020, 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, - 43261, 43303, 43314, 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, - 43505, 43516, 43520, 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, - 43635, 43640, 43644, 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, - 43756, 43764, 43784, 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, - 43970, 44004, 44034, 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, - 64219, 64287, 64298, 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, - 64850, 64913, 64916, 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, - 65393, 65395, 65439, 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, - 65500, 65502, 39, 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, - 2417, 2536, 2545, 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, - 3185, 3304, 3313, 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, - 3883, 4162, 4171, 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, - 6619, 6786, 6795, 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, - 7259, 42530, 42539, 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, - 43602, 43611, 44018, 44027, 65298, 65307, 2, 195, 2, 3, 3, 2, 2, 2, 2, - 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, - 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, - 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, - 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, - 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, - 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, - 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 3, 69, 3, 2, 2, 2, 5, 71, 3, 2, 2, 2, 7, - 73, 3, 2, 2, 2, 9, 75, 3, 2, 2, 2, 11, 77, 3, 2, 2, 2, 13, 79, 3, 2, 2, - 2, 15, 81, 3, 2, 2, 2, 17, 83, 3, 2, 2, 2, 19, 85, 3, 2, 2, 2, 21, 87, - 3, 2, 2, 2, 23, 89, 3, 2, 2, 2, 25, 91, 3, 2, 2, 2, 27, 93, 3, 2, 2, 2, - 29, 96, 3, 2, 2, 2, 31, 99, 3, 2, 2, 2, 33, 101, 3, 2, 2, 2, 35, 104, 3, - 2, 2, 2, 37, 106, 3, 2, 2, 2, 39, 109, 3, 2, 2, 2, 41, 121, 3, 2, 2, 2, - 43, 132, 3, 2, 2, 2, 45, 137, 3, 2, 2, 2, 47, 143, 3, 2, 2, 2, 49, 149, - 3, 2, 2, 2, 51, 162, 3, 2, 2, 2, 53, 168, 3, 2, 2, 2, 55, 175, 3, 2, 2, - 2, 57, 177, 3, 2, 2, 2, 59, 179, 3, 2, 2, 2, 61, 181, 3, 2, 2, 2, 63, 183, - 3, 2, 2, 2, 65, 185, 3, 2, 2, 2, 67, 187, 3, 2, 2, 2, 69, 70, 7, 46, 2, - 2, 70, 4, 3, 2, 2, 2, 71, 72, 7, 42, 2, 2, 72, 6, 3, 2, 2, 2, 73, 74, 7, - 43, 2, 2, 74, 8, 3, 2, 2, 2, 75, 76, 7, 93, 2, 2, 76, 10, 3, 2, 2, 2, 77, - 78, 7, 95, 2, 2, 78, 12, 3, 2, 2, 2, 79, 80, 7, 48, 2, 2, 80, 14, 3, 2, - 2, 2, 81, 82, 7, 45, 2, 2, 82, 16, 3, 2, 2, 2, 83, 84, 7, 47, 2, 2, 84, - 18, 3, 2, 2, 2, 85, 86, 7, 44, 2, 2, 86, 20, 3, 2, 2, 2, 87, 88, 7, 49, - 2, 2, 88, 22, 3, 2, 2, 2, 89, 90, 7, 96, 2, 2, 90, 24, 3, 2, 2, 2, 91, - 92, 7, 63, 2, 2, 92, 26, 3, 2, 2, 2, 93, 94, 7, 62, 2, 2, 94, 95, 7, 64, - 2, 2, 95, 28, 3, 2, 2, 2, 96, 97, 7, 62, 2, 2, 97, 98, 7, 63, 2, 2, 98, - 30, 3, 2, 2, 2, 99, 100, 7, 62, 2, 2, 100, 32, 3, 2, 2, 2, 101, 102, 7, - 64, 2, 2, 102, 103, 7, 63, 2, 2, 103, 34, 3, 2, 2, 2, 104, 105, 7, 64, - 2, 2, 105, 36, 3, 2, 2, 2, 106, 107, 7, 40, 2, 2, 107, 38, 3, 2, 2, 2, - 108, 110, 9, 2, 2, 2, 109, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, - 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 119, 3, 2, 2, 2, 113, 115, - 7, 48, 2, 2, 114, 116, 9, 2, 2, 2, 115, 114, 3, 2, 2, 2, 116, 117, 3, 2, - 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 120, 3, 2, 2, 2, - 119, 113, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 40, 3, 2, 2, 2, 121, 127, - 7, 36, 2, 2, 122, 126, 10, 3, 2, 2, 123, 124, 7, 36, 2, 2, 124, 126, 7, - 36, 2, 2, 125, 122, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 129, 3, 2, 2, - 2, 127, 125, 3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 130, 3, 2, 2, 2, 129, - 127, 3, 2, 2, 2, 130, 131, 7, 36, 2, 2, 131, 42, 3, 2, 2, 2, 132, 133, - 9, 4, 2, 2, 133, 134, 9, 5, 2, 2, 134, 135, 9, 6, 2, 2, 135, 136, 9, 7, - 2, 2, 136, 44, 3, 2, 2, 2, 137, 138, 9, 8, 2, 2, 138, 139, 9, 9, 2, 2, - 139, 140, 9, 10, 2, 2, 140, 141, 9, 11, 2, 2, 141, 142, 9, 7, 2, 2, 142, - 46, 3, 2, 2, 2, 143, 144, 9, 12, 2, 2, 144, 145, 9, 6, 2, 2, 145, 146, - 9, 10, 2, 2, 146, 147, 9, 10, 2, 2, 147, 48, 3, 2, 2, 2, 148, 150, 5, 55, - 28, 2, 149, 148, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, - 151, 152, 3, 2, 2, 2, 152, 158, 3, 2, 2, 2, 153, 157, 5, 55, 28, 2, 154, - 157, 5, 67, 34, 2, 155, 157, 7, 97, 2, 2, 156, 153, 3, 2, 2, 2, 156, 154, - 3, 2, 2, 2, 156, 155, 3, 2, 2, 2, 157, 160, 3, 2, 2, 2, 158, 156, 3, 2, - 2, 2, 158, 159, 3, 2, 2, 2, 159, 50, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, - 161, 163, 9, 13, 2, 2, 162, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, - 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, - 8, 26, 2, 2, 167, 52, 3, 2, 2, 2, 168, 169, 11, 2, 2, 2, 169, 54, 3, 2, - 2, 2, 170, 176, 5, 57, 29, 2, 171, 176, 5, 59, 30, 2, 172, 176, 5, 61, - 31, 2, 173, 176, 5, 63, 32, 2, 174, 176, 5, 65, 33, 2, 175, 170, 3, 2, - 2, 2, 175, 171, 3, 2, 2, 2, 175, 172, 3, 2, 2, 2, 175, 173, 3, 2, 2, 2, - 175, 174, 3, 2, 2, 2, 176, 56, 3, 2, 2, 2, 177, 178, 9, 14, 2, 2, 178, - 58, 3, 2, 2, 2, 179, 180, 9, 15, 2, 2, 180, 60, 3, 2, 2, 2, 181, 182, 9, - 16, 2, 2, 182, 62, 3, 2, 2, 2, 183, 184, 9, 17, 2, 2, 184, 64, 3, 2, 2, - 2, 185, 186, 9, 18, 2, 2, 186, 66, 3, 2, 2, 2, 187, 188, 9, 19, 2, 2, 188, - 68, 3, 2, 2, 2, 13, 2, 111, 117, 119, 125, 127, 151, 156, 158, 164, 175, - 3, 8, 2, 2, + 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, + 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, + 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, + 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 6, 20, 108, 10, 20, 13, 20, + 14, 20, 109, 3, 20, 3, 20, 6, 20, 114, 10, 20, 13, 20, 14, 20, 115, 5, + 20, 118, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 124, 10, 21, 12, 21, + 14, 21, 127, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, + 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 6, 24, 143, 10, 24, 13, 24, + 14, 24, 144, 3, 24, 3, 24, 3, 24, 7, 24, 150, 10, 24, 12, 24, 14, 24, 153, + 11, 24, 3, 25, 6, 25, 156, 10, 25, 13, 25, 14, 25, 157, 3, 25, 3, 25, 3, + 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 169, 10, 27, 3, 28, + 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, + 33, 2, 2, 34, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, + 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, + 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 2, 55, + 2, 57, 2, 59, 2, 61, 2, 63, 2, 65, 2, 3, 2, 19, 3, 2, 50, 59, 3, 2, 36, + 36, 4, 2, 86, 86, 118, 118, 4, 2, 84, 84, 116, 116, 4, 2, 87, 87, 119, + 119, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 67, 67, 99, + 99, 4, 2, 78, 78, 110, 110, 4, 2, 85, 85, 117, 117, 5, 2, 11, 12, 15, 15, + 34, 34, 84, 2, 67, 92, 194, 216, 218, 224, 258, 312, 315, 329, 332, 383, + 387, 388, 390, 397, 400, 403, 405, 406, 408, 410, 414, 415, 417, 418, 420, + 427, 430, 437, 439, 446, 454, 463, 465, 477, 480, 496, 499, 502, 504, 506, + 508, 564, 572, 573, 575, 576, 579, 584, 586, 592, 882, 884, 888, 897, 904, + 908, 910, 931, 933, 941, 977, 982, 986, 1008, 1014, 1017, 1019, 1020, 1023, + 1073, 1122, 1154, 1164, 1231, 1234, 1328, 1331, 1368, 4258, 4295, 4297, + 4303, 7682, 7830, 7840, 7936, 7946, 7953, 7962, 7967, 7978, 7985, 7994, + 8001, 8010, 8015, 8027, 8033, 8042, 8049, 8122, 8125, 8138, 8141, 8154, + 8157, 8170, 8174, 8186, 8189, 8452, 8457, 8461, 8463, 8466, 8468, 8471, + 8479, 8486, 8495, 8498, 8501, 8512, 8513, 8519, 8581, 11266, 11312, 11362, + 11366, 11369, 11378, 11380, 11383, 11392, 11394, 11396, 11492, 11501, 11503, + 11508, 42562, 42564, 42606, 42626, 42652, 42788, 42800, 42804, 42864, 42875, + 42888, 42893, 42895, 42898, 42900, 42904, 42927, 42930, 42931, 65315, 65340, + 83, 2, 99, 124, 183, 248, 250, 257, 259, 377, 380, 386, 389, 391, 394, + 404, 407, 413, 416, 419, 421, 423, 426, 431, 434, 438, 440, 449, 456, 462, + 464, 501, 503, 507, 509, 571, 574, 580, 585, 661, 663, 689, 883, 885, 889, + 895, 914, 976, 978, 979, 983, 985, 987, 1013, 1015, 1121, 1123, 1155, 1165, + 1217, 1220, 1329, 1379, 1417, 7426, 7469, 7533, 7545, 7547, 7580, 7683, + 7839, 7841, 7945, 7954, 7959, 7970, 7977, 7986, 7993, 8002, 8007, 8018, + 8025, 8034, 8041, 8050, 8063, 8066, 8073, 8082, 8089, 8098, 8105, 8114, + 8118, 8120, 8121, 8128, 8134, 8136, 8137, 8146, 8149, 8152, 8153, 8162, + 8169, 8180, 8182, 8184, 8185, 8460, 8469, 8497, 8507, 8510, 8511, 8520, + 8523, 8528, 8582, 11314, 11360, 11363, 11374, 11379, 11389, 11395, 11502, + 11504, 11509, 11522, 11559, 11561, 11567, 42563, 42607, 42627, 42653, 42789, + 42803, 42805, 42874, 42876, 42878, 42881, 42889, 42894, 42896, 42899, 42903, + 42905, 42923, 43004, 43868, 43878, 43879, 64258, 64264, 64277, 64281, 65347, + 65372, 8, 2, 455, 461, 500, 8081, 8090, 8097, 8106, 8113, 8126, 8142, 8190, + 8190, 35, 2, 690, 707, 712, 723, 738, 742, 750, 752, 886, 892, 1371, 1602, + 1767, 1768, 2038, 2039, 2044, 2076, 2086, 2090, 2419, 3656, 3784, 4350, + 6105, 6213, 6825, 7295, 7470, 7532, 7546, 7617, 8307, 8321, 8338, 8350, + 11390, 11391, 11633, 11825, 12295, 12343, 12349, 12544, 40983, 42239, 42510, + 42625, 42654, 42655, 42777, 42785, 42866, 42890, 43002, 43003, 43473, 43496, + 43634, 43743, 43765, 43766, 43870, 43873, 65394, 65441, 236, 2, 172, 188, + 445, 453, 662, 1516, 1522, 1524, 1570, 1601, 1603, 1612, 1648, 1649, 1651, + 1749, 1751, 1790, 1793, 1810, 1812, 1841, 1871, 1959, 1971, 2028, 2050, + 2071, 2114, 2138, 2210, 2228, 2310, 2363, 2367, 2386, 2394, 2403, 2420, + 2434, 2439, 2446, 2449, 2450, 2453, 2474, 2476, 2482, 2484, 2491, 2495, + 2512, 2526, 2527, 2529, 2531, 2546, 2547, 2567, 2572, 2577, 2578, 2581, + 2602, 2604, 2610, 2612, 2613, 2615, 2616, 2618, 2619, 2651, 2654, 2656, + 2678, 2695, 2703, 2705, 2707, 2709, 2730, 2732, 2738, 2740, 2741, 2743, + 2747, 2751, 2770, 2786, 2787, 2823, 2830, 2833, 2834, 2837, 2858, 2860, + 2866, 2868, 2869, 2871, 2875, 2879, 2915, 2931, 2949, 2951, 2956, 2960, + 2962, 2964, 2967, 2971, 2972, 2974, 2988, 2992, 3003, 3026, 3086, 3088, + 3090, 3092, 3114, 3116, 3131, 3135, 3214, 3216, 3218, 3220, 3242, 3244, + 3253, 3255, 3259, 3263, 3296, 3298, 3299, 3315, 3316, 3335, 3342, 3344, + 3346, 3348, 3388, 3391, 3408, 3426, 3427, 3452, 3457, 3463, 3480, 3484, + 3507, 3509, 3517, 3519, 3528, 3587, 3634, 3636, 3637, 3650, 3655, 3715, + 3716, 3718, 3724, 3727, 3737, 3739, 3745, 3747, 3749, 3751, 3753, 3756, + 3757, 3759, 3762, 3764, 3765, 3775, 3782, 3806, 3809, 3842, 3913, 3915, + 3950, 3978, 3982, 4098, 4140, 4161, 4183, 4188, 4191, 4195, 4210, 4215, + 4227, 4240, 4348, 4351, 4682, 4684, 4687, 4690, 4696, 4698, 4703, 4706, + 4746, 4748, 4751, 4754, 4786, 4788, 4791, 4794, 4800, 4802, 4807, 4810, + 4824, 4826, 4882, 4884, 4887, 4890, 4956, 4994, 5009, 5026, 5110, 5123, + 5742, 5745, 5761, 5763, 5788, 5794, 5868, 5875, 5882, 5890, 5902, 5904, + 5907, 5922, 5939, 5954, 5971, 5986, 5998, 6000, 6002, 6018, 6069, 6110, + 6212, 6214, 6265, 6274, 6314, 6316, 6391, 6402, 6432, 6482, 6511, 6514, + 6518, 6530, 6573, 6595, 6601, 6658, 6680, 6690, 6742, 6919, 6965, 6983, + 6989, 7045, 7074, 7088, 7089, 7100, 7143, 7170, 7205, 7247, 7249, 7260, + 7289, 7403, 7406, 7408, 7411, 7415, 7416, 8503, 8506, 11570, 11625, 11650, + 11672, 11682, 11688, 11690, 11696, 11698, 11704, 11706, 11712, 11714, 11720, + 11722, 11728, 11730, 11736, 11738, 11744, 12296, 12350, 12355, 12440, 12449, + 12540, 12545, 12591, 12595, 12688, 12706, 12732, 12786, 12801, 13314, 19895, + 19970, 40910, 40962, 40982, 40984, 42126, 42194, 42233, 42242, 42509, 42514, + 42529, 42540, 42541, 42608, 42727, 43001, 43011, 43013, 43015, 43017, 43020, + 43022, 43044, 43074, 43125, 43140, 43189, 43252, 43257, 43261, 43303, 43314, + 43336, 43362, 43390, 43398, 43444, 43490, 43494, 43497, 43505, 43516, 43520, + 43522, 43562, 43586, 43588, 43590, 43597, 43618, 43633, 43635, 43640, 43644, + 43697, 43699, 43711, 43714, 43716, 43741, 43742, 43746, 43756, 43764, 43784, + 43787, 43792, 43795, 43800, 43810, 43816, 43818, 43824, 43970, 44004, 44034, + 55205, 55218, 55240, 55245, 55293, 63746, 64111, 64114, 64219, 64287, 64298, + 64300, 64312, 64314, 64318, 64320, 64435, 64469, 64831, 64850, 64913, 64916, + 64969, 65010, 65021, 65138, 65142, 65144, 65278, 65384, 65393, 65395, 65439, + 65442, 65472, 65476, 65481, 65484, 65489, 65492, 65497, 65500, 65502, 39, + 2, 50, 59, 1634, 1643, 1778, 1787, 1986, 1995, 2408, 2417, 2536, 2545, + 2664, 2673, 2792, 2801, 2920, 2929, 3048, 3057, 3176, 3185, 3304, 3313, + 3432, 3441, 3560, 3569, 3666, 3675, 3794, 3803, 3874, 3883, 4162, 4171, + 4242, 4251, 6114, 6123, 6162, 6171, 6472, 6481, 6610, 6619, 6786, 6795, + 6802, 6811, 6994, 7003, 7090, 7099, 7234, 7243, 7250, 7259, 42530, 42539, + 43218, 43227, 43266, 43275, 43474, 43483, 43506, 43515, 43602, 43611, 44018, + 44027, 65298, 65307, 2, 188, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, + 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, + 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, + 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, + 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, + 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, + 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 3, 67, + 3, 2, 2, 2, 5, 69, 3, 2, 2, 2, 7, 71, 3, 2, 2, 2, 9, 73, 3, 2, 2, 2, 11, + 75, 3, 2, 2, 2, 13, 77, 3, 2, 2, 2, 15, 79, 3, 2, 2, 2, 17, 81, 3, 2, 2, + 2, 19, 83, 3, 2, 2, 2, 21, 85, 3, 2, 2, 2, 23, 87, 3, 2, 2, 2, 25, 89, + 3, 2, 2, 2, 27, 91, 3, 2, 2, 2, 29, 94, 3, 2, 2, 2, 31, 97, 3, 2, 2, 2, + 33, 99, 3, 2, 2, 2, 35, 102, 3, 2, 2, 2, 37, 104, 3, 2, 2, 2, 39, 107, + 3, 2, 2, 2, 41, 119, 3, 2, 2, 2, 43, 130, 3, 2, 2, 2, 45, 135, 3, 2, 2, + 2, 47, 142, 3, 2, 2, 2, 49, 155, 3, 2, 2, 2, 51, 161, 3, 2, 2, 2, 53, 168, + 3, 2, 2, 2, 55, 170, 3, 2, 2, 2, 57, 172, 3, 2, 2, 2, 59, 174, 3, 2, 2, + 2, 61, 176, 3, 2, 2, 2, 63, 178, 3, 2, 2, 2, 65, 180, 3, 2, 2, 2, 67, 68, + 7, 46, 2, 2, 68, 4, 3, 2, 2, 2, 69, 70, 7, 42, 2, 2, 70, 6, 3, 2, 2, 2, + 71, 72, 7, 43, 2, 2, 72, 8, 3, 2, 2, 2, 73, 74, 7, 93, 2, 2, 74, 10, 3, + 2, 2, 2, 75, 76, 7, 95, 2, 2, 76, 12, 3, 2, 2, 2, 77, 78, 7, 48, 2, 2, + 78, 14, 3, 2, 2, 2, 79, 80, 7, 45, 2, 2, 80, 16, 3, 2, 2, 2, 81, 82, 7, + 47, 2, 2, 82, 18, 3, 2, 2, 2, 83, 84, 7, 44, 2, 2, 84, 20, 3, 2, 2, 2, + 85, 86, 7, 49, 2, 2, 86, 22, 3, 2, 2, 2, 87, 88, 7, 96, 2, 2, 88, 24, 3, + 2, 2, 2, 89, 90, 7, 63, 2, 2, 90, 26, 3, 2, 2, 2, 91, 92, 7, 62, 2, 2, + 92, 93, 7, 64, 2, 2, 93, 28, 3, 2, 2, 2, 94, 95, 7, 62, 2, 2, 95, 96, 7, + 63, 2, 2, 96, 30, 3, 2, 2, 2, 97, 98, 7, 62, 2, 2, 98, 32, 3, 2, 2, 2, + 99, 100, 7, 64, 2, 2, 100, 101, 7, 63, 2, 2, 101, 34, 3, 2, 2, 2, 102, + 103, 7, 64, 2, 2, 103, 36, 3, 2, 2, 2, 104, 105, 7, 40, 2, 2, 105, 38, + 3, 2, 2, 2, 106, 108, 9, 2, 2, 2, 107, 106, 3, 2, 2, 2, 108, 109, 3, 2, + 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 117, 3, 2, 2, 2, + 111, 113, 7, 48, 2, 2, 112, 114, 9, 2, 2, 2, 113, 112, 3, 2, 2, 2, 114, + 115, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 115, 116, 3, 2, 2, 2, 116, 118, + 3, 2, 2, 2, 117, 111, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 40, 3, 2, + 2, 2, 119, 125, 7, 36, 2, 2, 120, 124, 10, 3, 2, 2, 121, 122, 7, 36, 2, + 2, 122, 124, 7, 36, 2, 2, 123, 120, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 124, + 127, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 128, + 3, 2, 2, 2, 127, 125, 3, 2, 2, 2, 128, 129, 7, 36, 2, 2, 129, 42, 3, 2, + 2, 2, 130, 131, 9, 4, 2, 2, 131, 132, 9, 5, 2, 2, 132, 133, 9, 6, 2, 2, + 133, 134, 9, 7, 2, 2, 134, 44, 3, 2, 2, 2, 135, 136, 9, 8, 2, 2, 136, 137, + 9, 9, 2, 2, 137, 138, 9, 10, 2, 2, 138, 139, 9, 11, 2, 2, 139, 140, 9, + 7, 2, 2, 140, 46, 3, 2, 2, 2, 141, 143, 5, 53, 27, 2, 142, 141, 3, 2, 2, + 2, 143, 144, 3, 2, 2, 2, 144, 142, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, + 151, 3, 2, 2, 2, 146, 150, 5, 53, 27, 2, 147, 150, 5, 65, 33, 2, 148, 150, + 7, 97, 2, 2, 149, 146, 3, 2, 2, 2, 149, 147, 3, 2, 2, 2, 149, 148, 3, 2, + 2, 2, 150, 153, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, + 152, 48, 3, 2, 2, 2, 153, 151, 3, 2, 2, 2, 154, 156, 9, 12, 2, 2, 155, + 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 155, 3, 2, 2, 2, 157, 158, + 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 160, 8, 25, 2, 2, 160, 50, 3, 2, + 2, 2, 161, 162, 11, 2, 2, 2, 162, 52, 3, 2, 2, 2, 163, 169, 5, 55, 28, + 2, 164, 169, 5, 57, 29, 2, 165, 169, 5, 59, 30, 2, 166, 169, 5, 61, 31, + 2, 167, 169, 5, 63, 32, 2, 168, 163, 3, 2, 2, 2, 168, 164, 3, 2, 2, 2, + 168, 165, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 168, 167, 3, 2, 2, 2, 169, + 54, 3, 2, 2, 2, 170, 171, 9, 13, 2, 2, 171, 56, 3, 2, 2, 2, 172, 173, 9, + 14, 2, 2, 173, 58, 3, 2, 2, 2, 174, 175, 9, 15, 2, 2, 175, 60, 3, 2, 2, + 2, 176, 177, 9, 16, 2, 2, 177, 62, 3, 2, 2, 2, 178, 179, 9, 17, 2, 2, 179, + 64, 3, 2, 2, 2, 180, 181, 9, 18, 2, 2, 181, 66, 3, 2, 2, 2, 13, 2, 109, + 115, 117, 123, 125, 144, 149, 151, 157, 168, 3, 8, 2, 2, } var lexerDeserializer = antlr.NewATNDeserializer(nil) @@ -200,13 +196,13 @@ var lexerLiteralNames = []string{ var lexerSymbolicNames = []string{ "", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", "AMPERSAND", - "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", + "DECIMAL", "STRING", "TRUE", "FALSE", "NAME", "WS", "ERROR", } var lexerRuleNames = []string{ "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", "AMPERSAND", - "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", "UnicodeLetter", + "DECIMAL", "STRING", "TRUE", "FALSE", "NAME", "WS", "ERROR", "UnicodeLetter", "UnicodeClass_LU", "UnicodeClass_LL", "UnicodeClass_LT", "UnicodeClass_LM", "UnicodeClass_LO", "UnicodeDigit", } @@ -268,8 +264,7 @@ const ( Excellent1LexerSTRING = 20 Excellent1LexerTRUE = 21 Excellent1LexerFALSE = 22 - Excellent1LexerNULL = 23 - Excellent1LexerNAME = 24 - Excellent1LexerWS = 25 - Excellent1LexerERROR = 26 + Excellent1LexerNAME = 23 + Excellent1LexerWS = 24 + Excellent1LexerERROR = 25 ) diff --git a/legacy/gen/excellent1_parser.go b/legacy/gen/excellent1_parser.go index 7de866530..2c421e661 100644 --- a/legacy/gen/excellent1_parser.go +++ b/legacy/gen/excellent1_parser.go @@ -15,7 +15,7 @@ var _ = reflect.Copy var _ = strconv.Itoa var parserATN = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 28, 82, 4, + 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 27, 82, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 20, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 29, 10, 3, 3, 3, 3, 3, 3, 3, 7, 3, 34, 10, 3, 12, @@ -24,24 +24,24 @@ var parserATN = []uint16{ 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 67, 10, 4, 12, 4, 14, 4, 70, 11, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 7, 6, 77, 10, 6, 12, 6, 14, 6, 80, 11, 6, 3, 6, 2, 4, 4, 6, 7, 2, 4, 6, 8, 10, 2, 7, 3, 2, 11, - 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, 2, 14, 15, 4, 2, 23, 24, 26, 26, 2, 92, - 2, 12, 3, 2, 2, 2, 4, 28, 3, 2, 2, 2, 6, 46, 3, 2, 2, 2, 8, 71, 3, 2, 2, - 2, 10, 73, 3, 2, 2, 2, 12, 13, 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, - 2, 2, 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, - 20, 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, - 2, 2, 21, 22, 7, 5, 2, 2, 22, 29, 3, 2, 2, 2, 23, 29, 7, 26, 2, 2, 24, - 29, 7, 22, 2, 2, 25, 29, 7, 21, 2, 2, 26, 29, 7, 23, 2, 2, 27, 29, 7, 24, - 2, 2, 28, 15, 3, 2, 2, 2, 28, 23, 3, 2, 2, 2, 28, 24, 3, 2, 2, 2, 28, 25, - 3, 2, 2, 2, 28, 26, 3, 2, 2, 2, 28, 27, 3, 2, 2, 2, 29, 35, 3, 2, 2, 2, - 30, 31, 12, 8, 2, 2, 31, 32, 7, 8, 2, 2, 32, 34, 5, 4, 3, 9, 33, 30, 3, - 2, 2, 2, 34, 37, 3, 2, 2, 2, 35, 33, 3, 2, 2, 2, 35, 36, 3, 2, 2, 2, 36, - 5, 3, 2, 2, 2, 37, 35, 3, 2, 2, 2, 38, 39, 8, 4, 1, 2, 39, 47, 5, 4, 3, - 2, 40, 41, 7, 10, 2, 2, 41, 47, 5, 6, 4, 10, 42, 43, 7, 4, 2, 2, 43, 44, - 5, 6, 4, 2, 44, 45, 7, 5, 2, 2, 45, 47, 3, 2, 2, 2, 46, 38, 3, 2, 2, 2, - 46, 40, 3, 2, 2, 2, 46, 42, 3, 2, 2, 2, 47, 68, 3, 2, 2, 2, 48, 49, 12, - 9, 2, 2, 49, 50, 7, 13, 2, 2, 50, 67, 5, 6, 4, 10, 51, 52, 12, 8, 2, 2, - 52, 53, 9, 2, 2, 2, 53, 67, 5, 6, 4, 9, 54, 55, 12, 7, 2, 2, 55, 56, 9, - 3, 2, 2, 56, 67, 5, 6, 4, 8, 57, 58, 12, 6, 2, 2, 58, 59, 9, 4, 2, 2, 59, + 12, 3, 2, 9, 10, 3, 2, 16, 19, 3, 2, 14, 15, 3, 2, 23, 25, 2, 92, 2, 12, + 3, 2, 2, 2, 4, 28, 3, 2, 2, 2, 6, 46, 3, 2, 2, 2, 8, 71, 3, 2, 2, 2, 10, + 73, 3, 2, 2, 2, 12, 13, 5, 6, 4, 2, 13, 14, 7, 2, 2, 3, 14, 3, 3, 2, 2, + 2, 15, 16, 8, 3, 1, 2, 16, 17, 5, 8, 5, 2, 17, 19, 7, 4, 2, 2, 18, 20, + 5, 10, 6, 2, 19, 18, 3, 2, 2, 2, 19, 20, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, + 21, 22, 7, 5, 2, 2, 22, 29, 3, 2, 2, 2, 23, 29, 7, 25, 2, 2, 24, 29, 7, + 22, 2, 2, 25, 29, 7, 21, 2, 2, 26, 29, 7, 23, 2, 2, 27, 29, 7, 24, 2, 2, + 28, 15, 3, 2, 2, 2, 28, 23, 3, 2, 2, 2, 28, 24, 3, 2, 2, 2, 28, 25, 3, + 2, 2, 2, 28, 26, 3, 2, 2, 2, 28, 27, 3, 2, 2, 2, 29, 35, 3, 2, 2, 2, 30, + 31, 12, 8, 2, 2, 31, 32, 7, 8, 2, 2, 32, 34, 5, 4, 3, 9, 33, 30, 3, 2, + 2, 2, 34, 37, 3, 2, 2, 2, 35, 33, 3, 2, 2, 2, 35, 36, 3, 2, 2, 2, 36, 5, + 3, 2, 2, 2, 37, 35, 3, 2, 2, 2, 38, 39, 8, 4, 1, 2, 39, 47, 5, 4, 3, 2, + 40, 41, 7, 10, 2, 2, 41, 47, 5, 6, 4, 10, 42, 43, 7, 4, 2, 2, 43, 44, 5, + 6, 4, 2, 44, 45, 7, 5, 2, 2, 45, 47, 3, 2, 2, 2, 46, 38, 3, 2, 2, 2, 46, + 40, 3, 2, 2, 2, 46, 42, 3, 2, 2, 2, 47, 68, 3, 2, 2, 2, 48, 49, 12, 9, + 2, 2, 49, 50, 7, 13, 2, 2, 50, 67, 5, 6, 4, 10, 51, 52, 12, 8, 2, 2, 52, + 53, 9, 2, 2, 2, 53, 67, 5, 6, 4, 9, 54, 55, 12, 7, 2, 2, 55, 56, 9, 3, + 2, 2, 56, 67, 5, 6, 4, 8, 57, 58, 12, 6, 2, 2, 58, 59, 9, 4, 2, 2, 59, 67, 5, 6, 4, 7, 60, 61, 12, 5, 2, 2, 61, 62, 9, 5, 2, 2, 62, 67, 5, 6, 4, 6, 63, 64, 12, 4, 2, 2, 64, 65, 7, 20, 2, 2, 65, 67, 5, 6, 4, 5, 66, 48, 3, 2, 2, 2, 66, 51, 3, 2, 2, 2, 66, 54, 3, 2, 2, 2, 66, 57, 3, 2, 2, @@ -62,7 +62,7 @@ var literalNames = []string{ var symbolicNames = []string{ "", "COMMA", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "DOT", "PLUS", "MINUS", "TIMES", "DIVIDE", "EXPONENT", "EQ", "NEQ", "LTE", "LT", "GTE", "GT", "AMPERSAND", - "DECIMAL", "STRING", "TRUE", "FALSE", "NULL", "NAME", "WS", "ERROR", + "DECIMAL", "STRING", "TRUE", "FALSE", "NAME", "WS", "ERROR", } var ruleNames = []string{ @@ -119,10 +119,9 @@ const ( Excellent1ParserSTRING = 20 Excellent1ParserTRUE = 21 Excellent1ParserFALSE = 22 - Excellent1ParserNULL = 23 - Excellent1ParserNAME = 24 - Excellent1ParserWS = 25 - Excellent1ParserERROR = 26 + Excellent1ParserNAME = 23 + Excellent1ParserWS = 24 + Excellent1ParserERROR = 25 ) // Excellent1Parser rules. From a669da12e26c91834a6b1bb63ccff86644bd1b60 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Thu, 26 Apr 2018 16:42:04 -0500 Subject: [PATCH 5/8] Text that all legacy expression tests can migrate (WIP) --- docs/docs.md | 26 +- docs/index.html | 1671 +++++++++++++------------ excellent/functions/functions.go | 34 +- excellent/functions/functions_test.go | 10 +- legacy/expressions.go | 54 +- legacy/expressions_test.go | 14 +- 6 files changed, 921 insertions(+), 888 deletions(-) diff --git a/docs/docs.md b/docs/docs.md index b126543e5..fbff5f034 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -675,6 +675,18 @@ environment will be used. An error will be returned if the timezone is not recog @(format_datetime("NOT DATE", "YYYY-MM-DD")) → ERROR ``` + + +## format_location(location) + +Formats the given location as its name + + +```objectivec +@(format_location("Rwanda")) → Rwanda +@(format_location("Rwanda > Kigali")) → Kigali +``` + ## format_number(num, places, commas) @@ -991,20 +1003,20 @@ A single random integer in the given inclusive range. @(rand_between(1, 10)) → 10 ``` - + -## read_code(code) +## read_digits(code) -Converts `code` into something that can be read by IVR systems +Converts `digits` into something that can be read by IVR systems -ReadCode will split the numbers such as they are easier to understand. This includes +ReadDigits will split the numbers such as they are easier to understand. This includes splitting in 3s or 4s if appropriate. ```objectivec -@(read_code("1234")) → 1 2 3 4 -@(read_code("abc")) → a b c -@(read_code("abcdef")) → a b c , d e f +@(read_digits("1234")) → 1 2 3 4 +@(read_digits("abc")) → a b c +@(read_digits("abcdef")) → a b c , d e f ``` diff --git a/docs/index.html b/docs/index.html index 6ac85d095..501c34269 100644 --- a/docs/index.html +++ b/docs/index.html @@ -605,108 +605,113 @@

format_datetime(date, format [,time @(format_datetime("1979-07-18T15:00:00.000000Z", "YYYY")) → 1979 @(format_datetime("1979-07-18T15:00:00.000000Z", "M")) → 7 @(format_datetime("NOT DATE", "YYYY-MM-DD")) → ERROR +

+

format_location(location)

+

Formats the given location as its name

+

format_number(num, places, commas)

Returns num formatted with the passed in number of decimal places and optional commas dividing thousands separators

- +

format_urn(urn)

Turns urn into human friendly text

- +

from_epoch(num)

Returns a new date created from num which represents number of nanoseconds since January 1st, 1970 GMT

- +

if(test, true_value, false_value)

Evaluates the test argument, and if truthy returns true_value, if not returning false_value

If the first argument is an error that error is returned

- +

join(array, delimiter)

Joins the passed in array of strings with the passed in delimeter

- +

json(value)

Tries to return a JSON representation of value. An error is returned if there is no JSON representation of that object.

- +

left(text, count)

Returns the count most left characters of the passed in text

- +

length(value)

Returns the length of the passed in text or array.

length will return an error if it is passed an item which doesn’t have length.

- +

lower(text)

Lowercases the passed in text

- +

max(values…)

Takes a list of values and returns the greatest of them

- +

mean(values)

Takes a list of values and returns the arithmetic mean of them

- +

min(values)

Takes a list of values and returns the smallest of them

- +

mod(dividend, divisor)

Returns the remainder of the division of divident by divisor

- +

now()

Returns the current date and time in the environment timezone

- +

number(value)

Tries to convert value to a number. An error is returned if the value can’t be converted.

- +

or(tests…)

Returns whether if any of the passed in arguments are truthy

- +

parse_datetime(text, format [,timezone])

Turns text into a date according to the format and optional timezone specified

@@ -736,180 +741,180 @@

parse_datetime(text, format [,timezo

Timezone should be a location name as specified in the IANA Time Zone database, such as “America/Guayaquil” or “America/Los_Angeles”. If not specified the timezone of your environment will be used. An error will be returned if the timezone is not recognized.

Note that fractional seconds will be parsed even without an explicit format identifier. You should only specify fractional seconds when you want to assert the number of places in the input format.

parse_datetime will return an error if it is unable to convert the text to a datetime.

- +

parse_json(text)

Tries to parse text as JSON, returning a fragment you can index into

If the passed in value is not JSON, then an error is returned

- +

percent(num)

Converts num to text represented as a percentage

- +

rand()

Returns a single random number between [0.0-1.0).

- +

rand_between()

A single random integer in the given inclusive range.

- -

-

read_code(code)

-

Converts code into something that can be read by IVR systems

-

ReadCode will split the numbers such as they are easier to understand. This includes splitting in 3s or 4s if appropriate.

- + +

+

read_digits(code)

+

Converts digits into something that can be read by IVR systems

+

ReadDigits will split the numbers such as they are easier to understand. This includes splitting in 3s or 4s if appropriate.

+

remove_first_word(text)

Removes the 1st word of text

- +

repeat(text, count)

Return text repeated count number of times

- +

replace(text, needle, replacement)

Replaces all occurrences of needle with replacement in text

- +

right(text, count)

Returns the count most right characters of the passed in text

- +

round(num [,places])

Rounds num to the nearest value. You can optionally pass in the number of decimal places to round to as places.

If places < 0, it will round the integer part to the nearest 10^(-places).

- +

round_down(num [,places])

Rounds num down to the nearest integer value. You can optionally pass in the number of decimal places to round to as places.

- +

round_up(num [,places])

Rounds num up to the nearest integer value. You can optionally pass in the number of decimal places to round to as places.

- +

split(text, delimiter)

Splits text based on the passed in delimeter

Empty values are removed from the returned list

- +

text(value)

Tries to convert value to text. An error is returned if the value can’t be converted.

- +

text_compare(text1, text2)

Returns the comparison between the strings text1 and text2. The return value will be -1 if str1 is smaller than str2, 0 if they are equal and 1 if str1 is greater than str2

- +

title(text)

Titlecases the passed in text, capitalizing each word

- +

to_epoch(date)

Converts date to the number of nanoseconds since January 1st, 1970 GMT

- +

today()

Returns the current date in the current timezone, time is set to midnight in the environment timezone

- +

tz(date)

Returns the timezone for `date``

If not timezone information is present in the date, then the environment’s timezone will be returned

- +

tz_offset(date)

Returns the offset for the timezone as text +/- HHMM for date

If no timezone information is present in the date, then the environment’s timezone offset will be returned

- +

upper(text)

Uppercases all characters in the passed text

- +

url_encode(text)

URL encodes text for use in a URL parameter

- +

weekday(date)

Returns the day of the week for date, 0 is sunday, 1 is monday..

- +

word(text, index)

Returns the word at the passed in index for the passed in text

- +

word_count(text)

Returns the number of words in text

- +

word_slice(text, start, end)

Extracts a substring from text spanning from start up to but not-including end. (first word is 0). A negative end value means that all words after the start should be returned.

- +

Router Tests

Router tests are a special class of functions which are used within the switch router. They are called in the same way as normal functions, but all return a test result object which by default evalutes to true or false, but can also be used to find the matching portion of the test by using the match component of the result. The flow editor builds these expressions using UI widgets, but they can be used anywhere a normal template function is used.

@@ -918,222 +923,222 @@

Router Tests

has_all_words(text, words)

Tests whether all the words are contained in text

The words can be in any order and may appear more than once.

- +

has_any_word(text, words)

Tests whether any of the words are contained in the text

Only one of the words needs to match and it may appear more than once.

- +

has_beginning(text, beginning)

Tests whether text starts with beginning

Both text values are trimmed of surrounding whitespace, but otherwise matching is strict without any tokenization.

- +

has_date(text)

Tests whether text contains a date formatted according to our environment

- +

has_date_eq(text, date)

Tests whether text a date equal to date

- +

has_date_gt(text, min)

Tests whether text a date after the date min

- +

has_date_lt(text, max)

Tests whether text contains a date before the date max

- +

has_district(text, state)

Tests whether a district name is contained in the text. If state is also provided then the returned district must be within that state.

- +

has_email(text)

Tests whether an email is contained in text

- +

has_group(contact, group_uuid)

Returns whether the contact is part of group with the passed in UUID

- +

has_number(text)

Tests whether text contains a number

- +

has_number_between(text, min, max)

Tests whether text contains a number between min and max inclusive

- +

has_number_eq(text, value)

Tests whether text contains a number equal to the value

- +

has_number_gt(text, min)

Tests whether text contains a number greater than min

- +

has_number_gte(text, min)

Tests whether text contains a number greater than or equal to min

- +

has_number_lt(text, max)

Tests whether text contains a number less than max

- +

has_number_lte(text, max)

Tests whether text contains a number less than or equal to max

- +

has_only_phrase(text, phrase)

Tests whether the text contains only phrase

The phrase must be the only text in the text to match

- +

has_pattern(text, pattern)

Tests whether text matches the regex pattern

Both text values are trimmed of surrounding whitespace and matching is case-insensitive.

- +

has_phone(text, country_code)

Tests whether a phone number (in the passed in country_code) is contained in the text

- +

has_phrase(text, phrase)

Tests whether phrase is contained in text

The words in the test phrase must appear in the same order with no other words in between.

- +

has_state(text)

Tests whether a state name is contained in the text

- +

has_text(text)

Tests whether there the text has any characters in it

- +

has_value(value)

Returns whether value is non-nil and not an error

Note that contact.fields and run.results are considered dynamic, so it is not an error to try to retrieve a value from fields or results which don’t exist, rather these return an empty value.

- +

has_wait_timed_out(run)

Returns whether the last wait timed out.

- +

has_ward(text, district, state)

Tests whether a ward name is contained in the text

- +

has_webhook_status(webhook, status)

Tests whether the passed in webhook call has the passed in status.

- +

is_error(value)

Returns whether value is an error

Note that contact.fields and run.results are considered dynamic, so it is not an error to try to retrieve a value from fields or results which don’t exist, rather these return an empty value.

- +

is_text_eq(text1, text2)

Returns whether two text values are equal (case sensitive). In the case that they are, it will return the text as the match.

- +

Action Definitions

Actions on a node generate events which can then be ingested by the engine container. In some cases the actions cause an immediate action, such as calling a webhook, in others the engine container is responsible for taking the action based on the event that is output, such as sending messages or updating contact fields. In either case the internal state of the engine is always updated to represent the new state so that flow execution is consistent. For example, while the engine itself does not have access to a contact store, it updates its internal representation of a contact’s state based on action performed on a flow so that later references in the flow are correct.

@@ -1145,32 +1150,32 @@

add_contact_groups

Action

- +

add_contact_urn

@@ -1179,23 +1184,23 @@

add_contact_urn

Action

- +

add_input_labels

@@ -1204,33 +1209,33 @@

add_input_labels

Action

- +

call_webhook

@@ -1240,30 +1245,30 @@

call_webhook

Action

- +

remove_contact_groups

@@ -1272,32 +1277,32 @@

remove_contact_groups

Action

- +

send_broadcast

@@ -1307,34 +1312,34 @@

send_broadcast

Action

- +

send_email

@@ -1344,30 +1349,30 @@

send_email

Action

- +

send_msg

@@ -1377,31 +1382,31 @@

send_msg

Action

- +

set_contact_channel

@@ -1411,28 +1416,28 @@

set_contact_channel

Action

- +

set_contact_field

@@ -1441,30 +1446,30 @@

set_contact_field

Action

- +

set_contact_property

@@ -1473,24 +1478,24 @@

set_contact_property

Action

- +

set_run_result

@@ -1500,27 +1505,27 @@

set_run_result

Action

- +

start_flow

@@ -1530,29 +1535,29 @@

start_flow

Action

- +

start_session

@@ -1561,102 +1566,102 @@

start_session

Action

- +

Event

-
{
-    "type": "session_triggered",
-    "created_on": "2018-04-11T13:24:30.123456-05:00",
-    "step_uuid": "43bdd132-957b-464b-bdca-2ca05d3bc6b3",
-    "flow": {
-        "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
-        "name": "Registration"
-    },
-    "groups": [
-        {
-            "uuid": "1e1ce1e1-9288-4504-869e-022d1003c72a",
-            "name": "Customers"
-        }
-    ],
-    "run": {
-        "uuid": "5cbbdb8e-6807-4d7c-90a5-61a502fc0a9a",
-        "flow": {
-            "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
-            "name": "Registration"
-        },
-        "contact": {
-            "uuid": "5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f",
-            "name": "Ryan Lewis",
-            "language": "eng",
-            "timezone": "",
-            "urns": [
-                "tel:+12065551212?channel=57f1078f-88aa-46f4-a59a-948a5739c03d",
-                "twitterid:54784326227#nyaruka",
-                "mailto:foo@bar.com"
-            ],
-            "groups": [
-                {
-                    "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
-                    "name": "Testers"
-                },
-                {
-                    "uuid": "4f1f98fc-27a7-4a69-bbdb-24744ba739a9",
-                    "name": "Males"
-                }
-            ],
-            "fields": {
-                "activation_token": {
-                    "text": "AACC55"
-                },
-                "age": {
-                    "text": "23",
-                    "number": 23
-                },
-                "gender": {
-                    "text": "Male"
-                },
-                "join_date": {
-                    "text": "2017-12-02",
-                    "datetime": "2017-12-02T00:00:00-02:00"
-                }
-            }
-        },
-        "status": "active",
-        "results": {
-            "favorite_color": {
-                "name": "Favorite Color",
-                "value": "red",
-                "category": "Red",
-                "node_uuid": "f5bb9b7a-7b5e-45c3-8f0e-61b4e95edf03",
-                "input": "",
-                "created_on": "2018-04-11T18:24:30.123456Z"
-            },
-            "phone_number": {
-                "name": "Phone Number",
-                "value": "+12344563452",
-                "node_uuid": "f5bb9b7a-7b5e-45c3-8f0e-61b4e95edf03",
-                "input": "",
-                "created_on": "2018-04-11T18:24:30.123456Z"
-            }
-        }
-    }
-}
+
{
+    "type": "session_triggered",
+    "created_on": "2018-04-11T13:24:30.123456-05:00",
+    "step_uuid": "43bdd132-957b-464b-bdca-2ca05d3bc6b3",
+    "flow": {
+        "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
+        "name": "Registration"
+    },
+    "groups": [
+        {
+            "uuid": "1e1ce1e1-9288-4504-869e-022d1003c72a",
+            "name": "Customers"
+        }
+    ],
+    "run": {
+        "uuid": "5cbbdb8e-6807-4d7c-90a5-61a502fc0a9a",
+        "flow": {
+            "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
+            "name": "Registration"
+        },
+        "contact": {
+            "uuid": "5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f",
+            "name": "Ryan Lewis",
+            "language": "eng",
+            "timezone": "",
+            "urns": [
+                "tel:+12065551212?channel=57f1078f-88aa-46f4-a59a-948a5739c03d",
+                "twitterid:54784326227#nyaruka",
+                "mailto:foo@bar.com"
+            ],
+            "groups": [
+                {
+                    "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
+                    "name": "Testers"
+                },
+                {
+                    "uuid": "4f1f98fc-27a7-4a69-bbdb-24744ba739a9",
+                    "name": "Males"
+                }
+            ],
+            "fields": {
+                "activation_token": {
+                    "text": "AACC55"
+                },
+                "age": {
+                    "text": "23",
+                    "number": 23
+                },
+                "gender": {
+                    "text": "Male"
+                },
+                "join_date": {
+                    "text": "2017-12-02",
+                    "datetime": "2017-12-02T00:00:00-02:00"
+                }
+            }
+        },
+        "status": "active",
+        "results": {
+            "favorite_color": {
+                "name": "Favorite Color",
+                "value": "red",
+                "category": "Red",
+                "node_uuid": "f5bb9b7a-7b5e-45c3-8f0e-61b4e95edf03",
+                "input": "",
+                "created_on": "2018-04-11T18:24:30.123456Z"
+            },
+            "phone_number": {
+                "name": "Phone Number",
+                "value": "+12344563452",
+                "node_uuid": "f5bb9b7a-7b5e-45c3-8f0e-61b4e95edf03",
+                "input": "",
+                "created_on": "2018-04-11T18:24:30.123456Z"
+            }
+        }
+    }
+}

Event Definitions

@@ -1669,36 +1674,36 @@

broadcast_created

Event

- +

contact_changed

@@ -1707,17 +1712,17 @@

contact_changed

Event

- +

contact_channel_changed

@@ -1726,14 +1731,14 @@

contact_channel_changed

Event

- +

contact_field_changed

@@ -1742,15 +1747,15 @@

contact_field_changed

Event

- +

contact_groups_added

@@ -1759,26 +1764,8 @@

contact_groups_added

Event

- - -

-

contact_groups_removed

-

Events are created when a contact has been removed from one or more groups.

- +

+

contact_groups_removed

+

Events are created when a contact has been removed from one or more groups.

+

contact_property_changed

Events are created when a property of a contact has been changed

@@ -1795,12 +1800,12 @@

contact_property_changed

Event

- +

contact_urn_added

@@ -1809,11 +1814,11 @@

contact_urn_added

Event

- +

email_created

@@ -1822,15 +1827,15 @@

email_created

Event

- +

environment_changed

@@ -1839,19 +1844,19 @@

environment_changed

Event

- +

error

@@ -1860,12 +1865,12 @@

error

Event

- +

flow_triggered

@@ -1874,15 +1879,15 @@

flow_triggered

Event

- +

input_labels_added

@@ -1891,17 +1896,17 @@

input_labels_added

Event

- +

msg_created

@@ -1910,32 +1915,8 @@

msg_created

Event

- - -

-

msg_received

-

Events are used for starting flows or resuming flows which are waiting for a message. They represent an incoming message for a contact.

- +

+

msg_received

+

Events are used for starting flows or resuming flows which are waiting for a message. They represent an incoming message for a contact.

+

msg_wait

Events are created when a flow pauses waiting for a response from a contact. If a timeout is set, then the caller should resume the flow after the number of seconds in the timeout to resume it.

@@ -1958,10 +1963,10 @@

msg_wait

Event

- +

nothing_wait

@@ -1970,10 +1975,10 @@

nothing_wait

Event

- +

run_expired

@@ -1982,11 +1987,11 @@

run_expired

Event

- +

run_result_changed

@@ -1995,15 +2000,15 @@

run_result_changed

Event

- +

session_triggered

@@ -2012,45 +2017,45 @@

session_triggered

Event

- +

webhook_called

@@ -2059,15 +2064,15 @@

webhook_called

Event

- + diff --git a/excellent/functions/functions.go b/excellent/functions/functions.go index 5edf8797f..94425004d 100644 --- a/excellent/functions/functions.go +++ b/excellent/functions/functions.go @@ -92,14 +92,15 @@ var XFUNCTIONS = map[string]XFunction{ // formatting functions "format_datetime": FormatDateTime, + "format_location": OneTextFunction(FormatLocation), "format_number": FormatNumber, "format_urn": FormatURN, // utility functions - "length": OneArgFunction(Length), - "default": TwoArgFunction(Default), - "legacy_add": TwoArgFunction(LegacyAdd), - "read_code": OneTextFunction(ReadCode), + "length": OneArgFunction(Length), + "default": TwoArgFunction(Default), + "legacy_add": TwoArgFunction(LegacyAdd), + "read_digits": OneTextFunction(ReadDigits), } //------------------------------------------------------------------------------------------ @@ -1316,6 +1317,17 @@ func FormatNumber(env utils.Environment, args ...types.XValue) types.XValue { return types.NewXText(humanize.FormatFloat(formatStr.String(), f64)) } +// FormatLocation formats the given location as its name +// +// @(format_location("Rwanda")) -> Rwanda +// @(format_location("Rwanda > Kigali")) -> Kigali +// +// @function format_location(location) +func FormatLocation(env utils.Environment, path types.XText) types.XValue { + parts := strings.Split(path.Native(), ">") + return types.NewXText(strings.TrimSpace(parts[len(parts)-1])) +} + // FormatURN turns `urn` into human friendly text // // @(format_urn("tel:+250781234567")) -> 0781 234 567 @@ -1449,17 +1461,17 @@ func LegacyAdd(env utils.Environment, arg1 types.XValue, arg2 types.XValue) type return types.NewXNumber(dec1.Native().Add(dec2.Native())) } -// ReadCode converts `code` into something that can be read by IVR systems +// ReadDigits converts `digits` into something that can be read by IVR systems // -// ReadCode will split the numbers such as they are easier to understand. This includes +// ReadDigits will split the numbers such as they are easier to understand. This includes // splitting in 3s or 4s if appropriate. // -// @(read_code("1234")) -> 1 2 3 4 -// @(read_code("abc")) -> a b c -// @(read_code("abcdef")) -> a b c , d e f +// @(read_digits("1234")) -> 1 2 3 4 +// @(read_digits("abc")) -> a b c +// @(read_digits("abcdef")) -> a b c , d e f // -// @function read_code(code) -func ReadCode(env utils.Environment, val types.XText) types.XValue { +// @function read_digits(code) +func ReadDigits(env utils.Environment, val types.XText) types.XValue { var output bytes.Buffer // remove any leading + diff --git a/excellent/functions/functions_test.go b/excellent/functions/functions_test.go index 4dea77298..9f464f83b 100644 --- a/excellent/functions/functions_test.go +++ b/excellent/functions/functions_test.go @@ -298,11 +298,11 @@ var funcTests = []struct { {"rand_between", []types.XValue{xn("1"), xn("10")}, xn("5")}, {"rand_between", []types.XValue{xn("1"), xn("10")}, xn("10")}, - {"read_code", []types.XValue{xs("123456")}, xs("1 2 3 , 4 5 6")}, - {"read_code", []types.XValue{xs("abcd")}, xs("a b c d")}, - {"read_code", []types.XValue{xs("12345678")}, xs("1 2 3 4 , 5 6 7 8")}, - {"read_code", []types.XValue{xs("12")}, xs("1 , 2")}, - {"read_code", []types.XValue{}, ERROR}, + {"read_digits", []types.XValue{xs("123456")}, xs("1 2 3 , 4 5 6")}, + {"read_digits", []types.XValue{xs("abcd")}, xs("a b c d")}, + {"read_digits", []types.XValue{xs("12345678")}, xs("1 2 3 4 , 5 6 7 8")}, + {"read_digits", []types.XValue{xs("12")}, xs("1 , 2")}, + {"read_digits", []types.XValue{}, ERROR}, {"remove_first_word", []types.XValue{xs("hello World")}, xs("World")}, {"remove_first_word", []types.XValue{xs("hello")}, xs("")}, diff --git a/legacy/expressions.go b/legacy/expressions.go index b4e928109..cf7101504 100644 --- a/legacy/expressions.go +++ b/legacy/expressions.go @@ -180,40 +180,44 @@ type functionTemplate struct { } var functionTemplates = map[string]functionTemplate{ - "first_word": {name: "word", params: "(%s, 0)"}, - "datevalue": {name: "datetime"}, - "edate": {name: "datetime_add", params: "(%s, %s, \"M\")"}, - "word": {name: "word", params: "(%s, %s - 1)"}, - "word_slice": {name: "word_slice", params: "(%s, %s - 1)", three: "(%s, %s - 1, %s - 1)"}, - "field": {name: "field", params: "(%s, %s - 1, %s)"}, - "datedif": {name: "datetime_diff"}, - "date": {name: "datetime", params: "(\"%s-%s-%s\")"}, - "days": {name: "datetime_diff", params: "(%s, %s, \"D\")"}, - "now": {name: "now", params: "()"}, - "average": {name: "mean"}, - "fixed": {name: "format_number", params: "(%s)", two: "(%s, %s)", three: "(%s, %s, %v)"}, - - "roundup": {name: "round_up"}, + "average": {name: "mean"}, + "date": {name: "datetime", params: "(\"%s-%s-%s\")"}, + "datedif": {name: "datetime_diff"}, + "datevalue": {name: "datetime"}, + "day": {name: "format_datetime", params: `(%s, "D")`}, + "days": {name: "datetime_diff", params: "(%s, %s, \"D\")"}, + "edate": {name: "datetime_add", params: "(%s, %s, \"M\")"}, + "field": {name: "field", params: "(%s, %s - 1, %s)"}, + "first_word": {name: "word", params: "(%s, 0)"}, + "fixed": {name: "format_number", params: "(%s)", two: "(%s, %s)", three: "(%s, %s, %v)"}, + "format_date": {name: "format_datetime"}, + "hour": {name: "format_datetime", params: `(%s, "h")`}, "int": {name: "round_down"}, - "rounddown": {name: "round_down"}, + "len": {name: "length"}, + "minute": {name: "format_datetime", params: `(%s, "m")`}, + "month": {name: "format_datetime", params: `(%s, "M")`}, + "now": {name: "now"}, + "proper": {name: "title"}, "randbetween": {name: "rand_between"}, "rept": {name: "repeat"}, - - "year": {name: "format_datetime", params: `(%s, "YYYY")`}, - "month": {name: "format_datetime", params: `(%s, "M")`}, - "day": {name: "format_datetime", params: `(%s, "D")`}, - "hour": {name: "format_datetime", params: `(%s, "h")`}, - "minute": {name: "format_datetime", params: `(%s, "m")`}, - "second": {name: "format_datetime", params: `(%s, "s")`}, - - "proper": {name: "title"}, + "rounddown": {name: "round_down"}, + "roundup": {name: "round_up"}, + "second": {name: "format_datetime", params: `(%s, "s")`}, + "substitute": {name: "replace"}, + "timevalue": {name: "parse_datetime"}, + "trunc": {name: "round_down"}, + "unichar": {name: "char"}, + "unicode": {name: "code"}, + "word_slice": {name: "word_slice", params: "(%s, %s - 1)", three: "(%s, %s - 1, %s - 1)"}, + "word": {name: "word", params: "(%s, %s - 1)"}, + "year": {name: "format_datetime", params: `(%s, "YYYY")`}, // we drop this function, instead joining with the cat operator "concatenate": {join: " & "}, - "len": {name: "length"}, // translate to maths "power": {params: "%s ^ %s"}, + "exp": {params: "2.718281828459045 ^ %s"}, "sum": {params: "%s + %s"}, // this one is a special case format, we sum these parts into seconds for datetime_add diff --git a/legacy/expressions_test.go b/legacy/expressions_test.go index 93445a17e..ae06ea32f 100644 --- a/legacy/expressions_test.go +++ b/legacy/expressions_test.go @@ -2,15 +2,15 @@ package legacy_test import ( "encoding/json" - "fmt" + //"fmt" "io/ioutil" "testing" "time" - "github.com/nyaruka/goflow/excellent/types" + //"github.com/nyaruka/goflow/excellent/types" "github.com/nyaruka/goflow/legacy" "github.com/nyaruka/goflow/test" - "github.com/nyaruka/goflow/utils" + //"github.com/nyaruka/goflow/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -254,7 +254,7 @@ type legacyTest struct { } // TestLegacyTests runs the tests from https://github.com/rapidpro/expressions, migrating each template first -func XTestLegacyTests(t *testing.T) { +func TestLegacyTests(t *testing.T) { legacyTestData, err := ioutil.ReadFile("testdata/legacy_tests.json") require.NoError(t, err) @@ -263,7 +263,7 @@ func XTestLegacyTests(t *testing.T) { require.NoError(t, err) for _, tc := range tests { - migratedTemplate, err := legacy.MigrateTemplate(tc.Template, legacy.ExtraAsFunction) + _, err := legacy.MigrateTemplate(tc.Template, legacy.ExtraAsFunction) defer func() { if r := recover(); r != nil { @@ -273,7 +273,7 @@ func XTestLegacyTests(t *testing.T) { assert.NoError(t, err, "error whilst migrating template '%s'", tc.Template) - if err != nil { + /*if err != nil { variables := types.JSONToXValue(tc.Context.Variables) tz, err := time.LoadLocation(tc.Context.Timezone) require.NoError(t, err) @@ -281,6 +281,6 @@ func XTestLegacyTests(t *testing.T) { env := test.NewTestEnvironment(utils.DateFormatDayMonthYear, tz, tc.Context.Now) fmt.Printf("TODO evaluate %s with vars %s and env %s", migratedTemplate, variables, env) - } + }*/ } } From ab870cb794f4d9adc1077cf675d40abe244c7f96 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Fri, 27 Apr 2018 10:35:23 -0500 Subject: [PATCH 6/8] Punt on checking template evaluation in TestLegacyTests for now --- excellent/scanner.go | 1 + legacy/expressions.go | 8 ++-- legacy/expressions_test.go | 73 ++++++++++++++++++++++++------- legacy/testdata/legacy_tests.json | 63 -------------------------- 4 files changed, 64 insertions(+), 81 deletions(-) diff --git a/excellent/scanner.go b/excellent/scanner.go index 15226a85f..12c4247de 100644 --- a/excellent/scanner.go +++ b/excellent/scanner.go @@ -131,6 +131,7 @@ func (s *xscanner) scanIdentifier() (xToken, string) { if topLevel == "" { topLevel = identifier } + topLevel = strings.ToLower(topLevel) // if we end with a period, unread that as well if len(identifier) > 1 && identifier[len(identifier)-1] == '.' { diff --git a/legacy/expressions.go b/legacy/expressions.go index cf7101504..512c993be 100644 --- a/legacy/expressions.go +++ b/legacy/expressions.go @@ -17,8 +17,8 @@ import ( "github.com/antlr/antlr4/runtime/Go/antlr" ) -// allowed top-level identifiers in legacy expressions, i.e. @contact.bar is valid but @foo.bar isn't -var legacyContextTopLevels = []string{"channel", "child", "contact", "date", "extra", "flow", "parent", "step"} +// ContextTopLevels are the allowed top-level identifiers in legacy expressions, i.e. @contact.bar is valid but @foo.bar isn't +var ContextTopLevels = []string{"channel", "child", "contact", "date", "extra", "flow", "parent", "step"} // ExtraVarsMapping defines how @extra.* variables should be migrated type ExtraVarsMapping int @@ -66,6 +66,7 @@ func (v *varMapper) rebase(prefix string) *varMapper { // Resolve resolves the given key to a mapped expression func (v *varMapper) Resolve(key string) types.XValue { + key = strings.ToLower(key) // is this a complete substitution? if substitute, ok := v.substitutions[key]; ok { @@ -372,7 +373,7 @@ func MigrateTemplate(template string, extraAs ExtraVarsMapping) (string, error) func migrateLegacyTemplateAsString(resolver types.XValue, template string) (string, error) { var buf bytes.Buffer var errors excellent.TemplateErrors - scanner := excellent.NewXScanner(strings.NewReader(template), legacyContextTopLevels) + scanner := excellent.NewXScanner(strings.NewReader(template), ContextTopLevels) for tokenType, token := scanner.Scan(); tokenType != excellent.EOF; tokenType, token = scanner.Scan() { switch tokenType { @@ -400,6 +401,7 @@ func migrateLegacyTemplateAsString(resolver types.XValue, template string) (stri buf.WriteString("@(") if err != nil { errors = append(errors, err) + buf.WriteString(token) } else { strValue, err := toString(value) if err != nil { diff --git a/legacy/expressions_test.go b/legacy/expressions_test.go index ae06ea32f..14634a95a 100644 --- a/legacy/expressions_test.go +++ b/legacy/expressions_test.go @@ -2,15 +2,17 @@ package legacy_test import ( "encoding/json" - //"fmt" + "fmt" "io/ioutil" + "reflect" + "strings" "testing" "time" - //"github.com/nyaruka/goflow/excellent/types" + "github.com/nyaruka/goflow/excellent/types" "github.com/nyaruka/goflow/legacy" "github.com/nyaruka/goflow/test" - //"github.com/nyaruka/goflow/utils" + "github.com/nyaruka/goflow/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -30,8 +32,10 @@ func TestMigrateTemplate(t *testing.T) { // contact variables {old: `@contact`, new: `@contact`}, + {old: `@CONTACT`, new: `@contact`}, {old: `@contact.uuid`, new: `@contact.uuid`}, {old: `@contact.name`, new: `@contact.name`}, + {old: `@contact.NAME`, new: `@contact.name`}, {old: `@contact.first_name`, new: `@contact.first_name`}, {old: `@contact.gender`, new: `@contact.fields.gender`}, @@ -238,8 +242,40 @@ func TestMigrateTemplate(t *testing.T) { } } +type legacyVariables map[string]interface{} + +func (v legacyVariables) Resolve(key string) types.XValue { + key = strings.ToLower(key) + for k, val := range v { + if strings.ToLower(k) == key { + return toXType(val) + } + } + return nil +} + +func (v legacyVariables) Reduce() types.XPrimitive { + return toXType(v["*"]).(types.XPrimitive) +} + +func (v legacyVariables) ToXJSON() types.XText { return types.NewXText("LEGACY") } + +func toXType(val interface{}) types.XValue { + if utils.IsNil(val) { + return nil + } + + switch typed := val.(type) { + case string: + return types.NewXText(typed) + case map[string]interface{}: + return legacyVariables(typed) + } + panic(fmt.Sprintf("unsupported type: %s", reflect.TypeOf(val))) +} + type legacyTestContext struct { - Variables json.RawMessage `json:"variables"` + Variables legacyVariables `json:"variables"` Timezone string `json:"timezone"` DateStyle string `json:"date_style"` Now *time.Time `json:"now"` @@ -265,22 +301,29 @@ func TestLegacyTests(t *testing.T) { for _, tc := range tests { _, err := legacy.MigrateTemplate(tc.Template, legacy.ExtraAsFunction) + assert.NoError(t, err) + defer func() { if r := recover(); r != nil { t.Errorf("panic migrating template '%s': %#v", tc.Template, r) } }() - assert.NoError(t, err, "error whilst migrating template '%s'", tc.Template) - - /*if err != nil { - variables := types.JSONToXValue(tc.Context.Variables) - tz, err := time.LoadLocation(tc.Context.Timezone) - require.NoError(t, err) - - env := test.NewTestEnvironment(utils.DateFormatDayMonthYear, tz, tc.Context.Now) - - fmt.Printf("TODO evaluate %s with vars %s and env %s", migratedTemplate, variables, env) - }*/ + // TODO evaluate the migrated template? Would need to remap the provided variables, i.e. flow.x -> run.results.x + // + //if err == nil { + // tz, err := time.LoadLocation(tc.Context.Timezone) + // require.NoError(t, err) + // + // env := test.NewTestEnvironment(utils.DateFormatDayMonthYear, tz, tc.Context.Now) + // + // output, err := excellent.EvaluateTemplateAsString(env, tc.Context.Variables, migratedTemplate, tc.URLEncode, legacy.ContextTopLevels) + // + // if len(tc.Errors) > 0 { + // assert.Error(t, err, "expected error for template '%s' (migrated from '%s')", migratedTemplate, tc.Template) + // } else { + // assert.Equal(t, tc.Output, output, "output mismatch for template '%s' (migrated from '%s')", migratedTemplate, tc.Template) + // } + //} } } diff --git a/legacy/testdata/legacy_tests.json b/legacy/testdata/legacy_tests.json index 856e3c369..255b6ed99 100644 --- a/legacy/testdata/legacy_tests.json +++ b/legacy/testdata/legacy_tests.json @@ -1164,17 +1164,6 @@ "output": "@(5 + (1 + )", "errors": [] }, - { - "template": "@(\")", - "context": { - "variables": {}, - "timezone": "UTC", - "date_style": "day_first" - }, - "url_encode": false, - "output": "@(\")", - "errors": [] - }, { "template": "@SUM(1, 2)", "context": { @@ -1216,19 +1205,6 @@ "Undefined variable: contact.name.something" ] }, - { - "template": "@(FOO())", - "context": { - "variables": {}, - "timezone": "UTC", - "date_style": "day_first" - }, - "url_encode": false, - "output": "@(FOO())", - "errors": [ - "Undefined function: FOO" - ] - }, { "template": "@(LEN())", "context": { @@ -1255,45 +1231,6 @@ "Too many arguments provided for function LEN" ] }, - { - "template": "@('x')", - "context": { - "variables": {}, - "timezone": "UTC", - "date_style": "day_first" - }, - "url_encode": false, - "output": "@('x')", - "errors": [ - "Expression error at: '" - ] - }, - { - "template": "@(0 / )", - "context": { - "variables": {}, - "timezone": "UTC", - "date_style": "day_first" - }, - "url_encode": false, - "output": "@(0 / )", - "errors": [ - "Expression error at: )" - ] - }, - { - "template": "@(1.1.0)", - "context": { - "variables": {}, - "timezone": "UTC", - "date_style": "day_first" - }, - "url_encode": false, - "output": "@(1.1.0)", - "errors": [ - "Expression is invalid" - ] - }, { "template": "@(2/ 0)", "context": { From d0fdd748d2b720604257f837f7344c1b1fafb28c Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Fri, 27 Apr 2018 10:36:30 -0500 Subject: [PATCH 7/8] Add tests for format_location --- excellent/functions/functions_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/excellent/functions/functions_test.go b/excellent/functions/functions_test.go index 9f464f83b..3499bc4e4 100644 --- a/excellent/functions/functions_test.go +++ b/excellent/functions/functions_test.go @@ -160,6 +160,11 @@ var funcTests = []struct { {"format_datetime", []types.XValue{xs("1977-06-23T15:34:00.000000Z"), xs("YYYY"), xs("Cuenca")}, ERROR}, {"format_datetime", []types.XValue{}, ERROR}, + {"format_location", []types.XValue{xs("Rwanda")}, xs("Rwanda")}, + {"format_location", []types.XValue{xs("Rwanda > Kigali")}, xs("Kigali")}, + {"format_location", []types.XValue{ERROR}, ERROR}, + {"format_location", []types.XValue{}, ERROR}, + {"format_number", []types.XValue{xn("31337")}, xs("31,337.00")}, {"format_number", []types.XValue{xn("31337"), xi(0), types.XBooleanFalse}, xs("31337")}, {"format_number", []types.XValue{xn("31337"), xs("xxx")}, ERROR}, From 383ad1d119ada6108fdc5e8a34d0401f1f985736 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Fri, 27 Apr 2018 11:39:18 -0500 Subject: [PATCH 8/8] Rename read_digits -> read_chars --- docs/docs.md | 14 +++++++------- docs/index.html | 14 +++++++------- excellent/functions/functions.go | 22 +++++++++++----------- excellent/functions/functions_test.go | 10 +++++----- legacy/expressions.go | 1 + 5 files changed, 31 insertions(+), 30 deletions(-) diff --git a/docs/docs.md b/docs/docs.md index fbff5f034..9e0508517 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -1003,20 +1003,20 @@ A single random integer in the given inclusive range. @(rand_between(1, 10)) → 10 ``` - + -## read_digits(code) +## read_chars(text) -Converts `digits` into something that can be read by IVR systems +Converts `text` into something that can be read by IVR systems -ReadDigits will split the numbers such as they are easier to understand. This includes +ReadChars will split the numbers such as they are easier to understand. This includes splitting in 3s or 4s if appropriate. ```objectivec -@(read_digits("1234")) → 1 2 3 4 -@(read_digits("abc")) → a b c -@(read_digits("abcdef")) → a b c , d e f +@(read_chars("1234")) → 1 2 3 4 +@(read_chars("abc")) → a b c +@(read_chars("abcdef")) → a b c , d e f ``` diff --git a/docs/index.html b/docs/index.html index 501c34269..b89c095dd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -767,13 +767,13 @@

rand_between()

A single random integer in the given inclusive range.

-

-

read_digits(code)

-

Converts digits into something that can be read by IVR systems

-

ReadDigits will split the numbers such as they are easier to understand. This includes splitting in 3s or 4s if appropriate.

- +

+

read_chars(text)

+

Converts text into something that can be read by IVR systems

+

ReadChars will split the numbers such as they are easier to understand. This includes splitting in 3s or 4s if appropriate.

+

remove_first_word(text)

Removes the 1st word of text

diff --git a/excellent/functions/functions.go b/excellent/functions/functions.go index 94425004d..2b9c88bf6 100644 --- a/excellent/functions/functions.go +++ b/excellent/functions/functions.go @@ -97,10 +97,10 @@ var XFUNCTIONS = map[string]XFunction{ "format_urn": FormatURN, // utility functions - "length": OneArgFunction(Length), - "default": TwoArgFunction(Default), - "legacy_add": TwoArgFunction(LegacyAdd), - "read_digits": OneTextFunction(ReadDigits), + "length": OneArgFunction(Length), + "default": TwoArgFunction(Default), + "legacy_add": TwoArgFunction(LegacyAdd), + "read_chars": OneTextFunction(ReadChars), } //------------------------------------------------------------------------------------------ @@ -1461,17 +1461,17 @@ func LegacyAdd(env utils.Environment, arg1 types.XValue, arg2 types.XValue) type return types.NewXNumber(dec1.Native().Add(dec2.Native())) } -// ReadDigits converts `digits` into something that can be read by IVR systems +// ReadChars converts `text` into something that can be read by IVR systems // -// ReadDigits will split the numbers such as they are easier to understand. This includes +// ReadChars will split the numbers such as they are easier to understand. This includes // splitting in 3s or 4s if appropriate. // -// @(read_digits("1234")) -> 1 2 3 4 -// @(read_digits("abc")) -> a b c -// @(read_digits("abcdef")) -> a b c , d e f +// @(read_chars("1234")) -> 1 2 3 4 +// @(read_chars("abc")) -> a b c +// @(read_chars("abcdef")) -> a b c , d e f // -// @function read_digits(code) -func ReadDigits(env utils.Environment, val types.XText) types.XValue { +// @function read_chars(text) +func ReadChars(env utils.Environment, val types.XText) types.XValue { var output bytes.Buffer // remove any leading + diff --git a/excellent/functions/functions_test.go b/excellent/functions/functions_test.go index 3499bc4e4..2295d67fd 100644 --- a/excellent/functions/functions_test.go +++ b/excellent/functions/functions_test.go @@ -303,11 +303,11 @@ var funcTests = []struct { {"rand_between", []types.XValue{xn("1"), xn("10")}, xn("5")}, {"rand_between", []types.XValue{xn("1"), xn("10")}, xn("10")}, - {"read_digits", []types.XValue{xs("123456")}, xs("1 2 3 , 4 5 6")}, - {"read_digits", []types.XValue{xs("abcd")}, xs("a b c d")}, - {"read_digits", []types.XValue{xs("12345678")}, xs("1 2 3 4 , 5 6 7 8")}, - {"read_digits", []types.XValue{xs("12")}, xs("1 , 2")}, - {"read_digits", []types.XValue{}, ERROR}, + {"read_chars", []types.XValue{xs("123456")}, xs("1 2 3 , 4 5 6")}, + {"read_chars", []types.XValue{xs("abcd")}, xs("a b c d")}, + {"read_chars", []types.XValue{xs("12345678")}, xs("1 2 3 4 , 5 6 7 8")}, + {"read_chars", []types.XValue{xs("12")}, xs("1 , 2")}, + {"read_chars", []types.XValue{}, ERROR}, {"remove_first_word", []types.XValue{xs("hello World")}, xs("World")}, {"remove_first_word", []types.XValue{xs("hello")}, xs("")}, diff --git a/legacy/expressions.go b/legacy/expressions.go index 512c993be..3537b8254 100644 --- a/legacy/expressions.go +++ b/legacy/expressions.go @@ -200,6 +200,7 @@ var functionTemplates = map[string]functionTemplate{ "now": {name: "now"}, "proper": {name: "title"}, "randbetween": {name: "rand_between"}, + "read_digits": {name: "read_chars"}, "rept": {name: "repeat"}, "rounddown": {name: "round_down"}, "roundup": {name: "round_up"},