diff --git a/.vscode/launch.json b/.vscode/launch.json index 6f7f7722..e8494866 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -31,108 +31,144 @@ "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["do_nothing"] + "args": ["run", "0_do_nothing"] }, { "name": "Interpreter: echo", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["echo"] + "args": ["run", "1_echo"] }, { "name": "Interpreter: hello_world/verbose", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["hello_world/verbose"] + "args": ["run", "2_hello_world/0_verbose"] }, { "name": "Interpreter: hello_world/with_const_sender", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["hello_world/with_const_sender"] + "args": ["run", "2_hello_world/1_with_const_sender"] }, { "name": "Interpreter: hello_world/with_then_connection", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["hello_world/with_then_connection"] + "args": ["run", "2_hello_world/2_with_then_connection"] }, { - "name": "Interpreter: add_numbers/naive", + "name": "Interpreter: hello_world/with_then_connection", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["add_numbers/naive"] + "args": ["run", "2_hello_world/3_with_literal_senders"] }, { "name": "Interpreter: interfaces", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", + "cwd": "${workspaceFolder}/examples", + "args": ["run", "3_interfaces"] + }, + { + "name": "Interpreter: add_numbers/naive", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmd/neva", + "cwd": "${workspaceFolder}/examples", + "args": ["run", "4_add_numbers/verbose"] + }, + { + "name": "Interpreter: add_numbers/naive", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["interfaces"] + "args": ["run", "4_add_numbers/with_bridge"] }, { - "name": "Interpreter: struct_fields/verbose", + "name": "Interpreter: 5_add_real_numbers/naive", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["struct_fields/verbose"] + "args": ["run", "5_add_real_numbers/naive"] }, { - "name": "Interpreter: struct_fields/with_selectors", + "name": "Interpreter: 5_add_real_numbers/with_err_handling", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["struct_fields/with_selectors"] + "args": ["run", "5_add_real_numbers/with_err_handling"] }, { - "name": "Interpreter: map_keys", + "name": "Interpreter: 5_add_real_numbers/with_sub_components", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["map_keys"] + "args": ["run", "5_add_real_numbers/with_sub_components"] }, { "name": "Interpreter: struct_builder/verbose", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["struct_builder/verbose"] + "args": ["run", "6_struct_builder/verbose"] }, { "name": "Interpreter: struct_builder/with_sugar", "type": "go", "request": "launch", "mode": "auto", - "program": "${workspaceFolder}/cmd/interpreter", + "program": "${workspaceFolder}/cmd/neva", + "cwd": "${workspaceFolder}/examples", + "args": ["run", "6_struct_builder/with_sugar"] + }, + { + "name": "Interpreter: struct_selectors/verbose", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmd/neva", + "cwd": "${workspaceFolder}/examples", + "args": ["run", "7_struct_selectors/verbose"] + }, + { + "name": "Interpreter: struct_selectors/with_sugar", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/cmd/neva", "cwd": "${workspaceFolder}/examples", - "args": ["struct_builder/with_sugar"] + "args": ["run", "7_struct_selectors/with_sugar"] }, // === Other === { diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 225baab5..69a53d50 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -1,4 +1,4 @@ -# ARCHITECTURE +# Architecture ## Compiler diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e5333d36..19db5886 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,10 @@ -# Requirements +# Contributing -Read the [documentation](./docs/). Many design decisions are described there. +Make sure you've read the https://nevalang.org/docs from cover to cover. -This is **must read** for everyone who want to contribute to the language. +Then see [ARCHITECTURE.md](./ARCHITECTURE.md) and [Makefile](./Makefile). -## System +## Requirements - Go: https://go.dev/doc/install - Make: https://www.gnu.org/software/make/#download @@ -12,125 +12,217 @@ This is **must read** for everyone who want to contribute to the language. - Antlr: `pip install antlr4-tools` - Tygo: `go install github.com/gzuidhof/tygo@latest` -## VSCode +### VSCode These are not really required but recommended in order you're using VSCode - [nevalang](https://marketplace.visualstudio.com/items?itemName=nevalang.vscode-nevalang) - [antlr4](https://marketplace.visualstudio.com/items?itemName=mike-lischke.vscode-antlr4) - [tmlanguage](https://marketplace.visualstudio.com/items?itemName=pedro-w.tmlanguage) -- [tooltitude](https://marketplace.visualstudio.com/items?itemName=tooltitudeteam.tooltitude) - [markdown-mermaid](https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid) -- [ts-errors](https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors) -# Development +## Development -After you've read the [documentation](./docs/) see [architecture high level overview](./ARCHITECTURE.md), see what [Makefile](./Makefile) can do. +## ANTLR Grammar -Remember that many go packages contain doc comments. Do not fear to read the source code, leave the comments for unintuitive parts. +Don't forget to open `neva.g4` file before debugging with VSCode -Try to follow [clean code](https://github.com/Pungyeon/clean-go-article), [clean architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) and [SOLID](https://en.wikipedia.org/wiki/SOLID). +## VSCode Extension -Discuss your ideas via github discussions or issues before implementing it. Write tests, avoid using `nolint`. Leave the comments (but only when you have to), update documentation. +VSCode extension depends on types defined in the `sourcecode` and `typesystem` packages so it's dangerous to rename those. If you going to do so, make sure you did't brake TS types generation. -## Github Issues +Check out [tygo.yaml](./tygo.yaml). and `CONTRIBUTING.md` in "vscode-neva" repo. -Issues must only be created for known bugs and understandable architecture issues. Not ideas, suggestions or feature requests. Discussions must be used for that instead. +## Naming conventions -## VSCode Extension +## Tests -Check out [tygo.yaml](./tygo.yaml). It depends on types defined in the `src` and `typesystem` packages and thus it's dangerous to rename those types. If you gonna do so make sure you don't brake TS types generation. Check [web/CONTRIBUTING.md](./web/CONTRIBUTING.md). +Use `_` instead of space in for test-case names because go turns spaces into underscores and makes it hard to find specific case. -## ANTLR Grammar +## Learning Resources -Don't forget to open `neva.g4` file before debugging with VSCode! +### FBP/DataFlow -# Naming conventions +- [Flow-Based Programming: A New Approach to Application Development](https://jpaulmorrison.com/fbp/1stedchaps.html) +- [Dataflow and Reactive Programming Systems: A Practical Guide](https://www.amazon.com/Dataflow-Reactive-Programming-Systems-Practical/dp/1497422442) -## Tests +### Golang -Use `_` instead of space in for test-case names because go turns spaces into underscores and makes it hard to find specific case. +Advanced Go knowledge is required. Especially understanding of concurrency. -# Learning Resources +- [Concurrency is not parallelism](https://go.dev/blog/waza-talk) +- [Share Memory By Communicating](https://go.dev/blog/codelab-share) +- [Go Concurrency Patterns: Timing out, moving on](https://go.dev/blog/concurrency-timeouts) +- [Go Concurrency Patterns: Context](https://go.dev/blog/context) +- [Go Concurrency Patterns: Pipelines and cancellation](https://go.dev/blog/pipelines) -## FBP/DataFlow +## Community -- [Elements of Dataflow and Reactive Programming Systems](https://youtu.be/iFlT93wakVo?feature=shared) -- [The origins of Flow Based Programming with J Paul Morrison](https://youtu.be/up2yhNTsaDs?feature=shared) -- [Dataflow and Reactive Programming Systems: A Practical Guide](https://www.amazon.com/Dataflow-Reactive-Programming-Systems-Practical/dp/1497422442) -- [Flow-Based Programming: A New Approach to Application Development](https://jpaulmorrison.com/fbp/1stedchaps.html) -- [Samuel Smith - "Flow Based Programming"](https://youtu.be/j3cP8uwf5YM?feature=shared) +Check out https://nevalang.org/community to find out where you can get help and be in touch -## Golang +## Design Principles -### Must Read +Nevalang is built on a set of principles. They were rather naturally derived from the development process rather artificially created beforehand. -- [How To Write Go Code](https://go.dev/doc/code) -- [Effective Go](https://go.dev/doc/effective_go) -- [Go Proverbs](https://go-proverbs.github.io/) -- [50 Shades Of Go](http://golang50shad.es/) -- [Darker Corners Of Go](https://rytisbiel.com/2021/03/06/darker-corners-of-go/) +> WARNING: Language is under heavy development and these principles are not guarantees we can give you at the moment, but rather guiding stars for us to keep moving in the right direction -### Highly Recommended +### Program must fail at startup or never -- [Concurrency is not parallelism](https://go.dev/blog/waza-talk) -- [Share Memory By Communicating](https://go.dev/blog/codelab-share) -- [Errors Are Values](https://go.dev/blog/errors-are-values) -- [Defer, Panic, and Recover](https://go.dev/blog/defer-panic-and-recover) +The idea is that most of the errors must be caught by compiler at compile time. And the rest of them, that are hard to catch (without sacrificing compiler's simplicity) are checked in runtime at startup. + +If no errors were caught at compile time and startup - then the program is correct and must run successfully. Any (non-logical) error that occurred after startup must be threated like compiler bug. + +### Runtime must be fast, flexible and unsafe + +Runtime won't do any checks after startup. The program that runtime consumes must be correct. Program's correctness must be ensured by compiler. If there's a bug in compiler and runtime consumed invalid program - bad things can happen: deadlocks, memory leaks, freezes and crashes. + +### Compiler directives must not be required + +Language must allow to implement everything without using of compiler directives. + +**Compiler directives are not always unsafe** (analyzer won't always validate their usage - that will make implementation more complicated) and thus must be used by language/stdlib developers or at _for users that know what they are doing_. + +It's good for user to understand what compiler directives are and how syntax sugar use them under the hood though. + +### There is interpreter (backend can be slow) + +Compiler must be fast to the point where it generates IR. After that we have generating of target code (e.g. generating Go and then generating machine code with Go compiler) - that part ("backend") doesn't have to be fast. It's more important to keep it simple. + +The reason for that is that we have an interpreter that is internally uses compiler (it's impossible to generate IR from invalid program due to lack of type information), but not the whole thing. Just to the point where it generates IR. That's the part of the compiler that is used for development/debugging purposes. That's where we need to be fast. + +### There is visual programming + +Once we build the good enough tool for visual programming we will switch from text based approach. Text will become supporting tool. To achieve this we must always keep in mind that what we do with the language must be easy to visualize in graph environment. + +## Internal Implementation Q&A + +### Why structures are not represented as Go structures? + +It would take generating Go types dynamically which is either makes use of reflection or codegeneration (which makes interpreter mode impossible). Maps have their overhead but they are easy to work with. + +### Why nested structures are not represented as flat maps? + +Indeed it's possible to represent `{ foo {bar int } }` like `{ "foo/bar": 42 }`. The problem arise when when we access the whole field. Let's take this example: + +``` +types { + User { + pet { + name str + } + } +} + +... + +$u.pet -> foo.bar +``` + +What will `foo.bar` actually receive? This design makes impossible to actually send structures around and allows to operate on non-structured data only. + +### Why Go? + +It's a perfect match. Go has builtin green threads, scheduler and garbage collector. Even more than that - it has goroutines and channels that are 1-1 mappings to FBP's ports and connections. Last but not least is that it's a pretty fast compiled language. Having Go as a compile target allows to reuse its state of the art standart library and increase performance for free by just updating the underlaying compiler. + +### Why compiler operates on multi-module graph (build) and not just turns everything into one big module? + +Imagine you have `foo.bar` in your code. How does compiler figures out what that actually is? In order to do that it needs to _resolve_ that _reference_. And this is how _reference resolution_ works: + +First, find out what `foo` is. Look at the `import` section in the current file. Let's say we see something like: + +```neva +import { + github.com/nevalang/x/foo +} +``` + +This is how we now that `foo` is actually `github.com/nevalang/x/foo` imported package. Cool, but when version of the `github.com/nevalang/x` we should use? Well, to figure that out we need to look out current _module_'s _manifest_ file. There we can find something like: + +```yaml +deps: + - github.com/nevalang/x 0.0.1 +``` + +Cool, now we now what _exactly_ `foo` is. It's a `foo` package inside of `0.0.1` version of the `github.com/nevalang/x` module. So what's the point of operating on a nested multi-module graph instead of having one giant module? + +Now let's consider another example. Instead of depending on `github.com/nevalang/x` your code depends on `submodule` and that sub-module itself depends on `github.com/nevalang/x` + +You still have that `foo.bar` in your code and your module still depends on `github.com/nevalang/x` module. But now you also depends on another `submod` sub-module that also depends on `github.com/nevalang/x`. But your module depends on `github.com/nevalang/x` of the `0.0.1` version and `submod` depends on `1.0.0`. + +Now we have a problem. When compiler sees `foo.bar` in some file it does import lookup and sees `github.com/nevalang/x` and... does not know what to do. To solve this issue we need to lookup current module manifest and check what version `github.com/nevalang/x` _this current module_ uses. To do that we need to preserve the multi-module structure of the program. + +One might ask can't we simply import things like: + +```neva +import { + github.com/nevalang/x@0.0.1 +} +``` + +That actually could solve the issue. The problem is that now we have to update the source code _each time we update our dependency_. That's a bad solution. We simply made probramming harder to avoid working on a compiler. We can do better. + +### Why `#bind` does not accept literals? + +Indeed it would be handy to be able to do stuff like this: + +```neva +nodes { + #bind(str "hello world!") + const Const +} +``` + +This would make desugarer much simpler (no need to create all this virtual constants), and not just for const senders but for struct selectors too. + +However, to implement this we need to be able to parse literals inside `irgen`. Right now we already introduce dependency for parsing entity references, but for arbitrary expressions we need the whole parser. + +Of course, it's possible to hide actual parser implementation behind some kind of interface defined by irgen but that would make code more complicated. Besides, the very idea of having parser inside code-generator sounds bad. Parsing references is the acceptable compromise on the other hand. + +### Why Analyzer knows about stdlib? Isn't it bad design? + +At first there was a try to implement analyzer in a way that it only knows about the core of the language. + +But turns out that some components in stdlib (especially `builtin` package, especially the ones that uses `#extern` and `#bind` directives) are actually part of the core of the language. + +E.g. when user uses struct selectors like `foo.bar/baz -> ...` and then desugarer replaces this with `foo.bar -> structSelectorNode("baz") -> ...` (this is pseudocode) we must ensure that type of the `bar` is 1) a `struct` 2) has field `baz` and 3) `baz` is compatible with whatever `...` is. _This is static semantic analysis_ and that's is work for analyzer. + +Actually every time we use compiler directive we depend on implicit contract that cannot be expressed in the terms of the language itself (except we introduce abstractions for that, which will make language more complicated). That's why we have to analyze such things by injecting knowledge about stdlib. + +Designing the language in a way where analyzer has zero knowledge about stdlib is possible in theory but would make the language more complicated and would take much more time. + +### Why desugarer comes after analyzer in compiler's pipeline? -### Nice To Know +Two reasons: -- [Strings, bytes, runes and characters in Go](https://go.dev/blog/strings) -- Concurrency - - [Go Concurrency Patterns: Timing out, moving on](https://go.dev/blog/concurrency-timeouts) - - [Go Concurrency Patterns: Context](https://go.dev/blog/context) - - [Go Concurrency Patterns: Pipelines and cancellation](https://go.dev/blog/pipelines) +1. Analyzer should operate on original "sugared" program so it can found errors in user's source code. Otherwise found errors can relate to desugar implementation (compiler internals) which is not the compilation error but debug info for compiler developers. Finally it's much easier to make end-user errors readable and user-friendly this way. +2. Desugarer that comes before analysis must duplicate some validation because it's unsafe to desugar some constructs before ensuring they are valid. E.g. desugar struct selectors without knowing fir sure that outport's type is a valid structure. Also many desugaring transformations are only possible on analyzed program with all type expressions resolved. -## JavaScript +Actually it's impossible to have desugarer before analysis. It's possible to have two desugarers - one before and one after. But that would make compiler much more complicated without visible benefits. -- [MDN](https://developer.mozilla.org/en-US/) -- [TypeScript docs](https://www.typescriptlang.org/) -- [React docs](https://react.dev/) -- [You don't know JS books](https://github.com/getify/You-Dont-Know-JS) +### Why union types are allowed for constants at syntax level? -## VSCode Extensions API Docs +You indeed can declare `const foo int | string = 42` and that won't make much sense. The problem it's not enough to restrict that at root level, you also have to recursively check every complex type like `struct`, `list` or `map`. And that is impossible to make at syntax level and require work in analyzer. This is could be done in the future when we cover more important cases. -- [Custom Editors](https://code.visualstudio.com/api/extension-guides/custom-editors) -- [Webviews](https://code.visualstudio.com/api/extension-guides/webview) -- [Language Servers (LSP)](https://code.visualstudio.com/api/language-extensions/language-server-extension-guide) -- [Syntax Highlighter](https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide) -- [LSP Overview](https://microsoft.github.io/language-server-protocol/) -- [Go library for LSP implementation](https://github.com/tliron/glsp) -- [LSP official docs](https://microsoft.github.io/language-server-protocol/) +### Why we have special syntax for union? -## Subjective Recommendations +We don't have sugar for `maybe` and `list` so why would we have this for unions? The reason is union is special for the type system. It's handled differently at the level of compatibility checking and resolving. -### Videos +However it's not `struct` where we _technically_ have to have some "literal" syntax. It's possible in theory to have just `union` like e.g. in Python but would require _type-system_ known about `union` name and handle this reference expressions very differently. In fact this will only make design more complicated because we _pretend_ like it's regular type instantiation consisting of reference and arguments but in fact it's not. -- ["Stop Writing Dead Programs" by Jack Rusher](https://youtu.be/8Ab3ArE8W3s?feature=shared) -- ["The Mess We're In" by Joe Armstrong](https://youtu.be/lKXe3HUG2l4?feature=shared) -- ["Propositions as Types" by Philip Wadler](https://youtu.be/IOiZatlZtGU?feature=shared) -- ["Outperforming Imperative with Pure Functional Languages" by Richard Feldman](https://youtu.be/vzfy4EKwG_Y?feature=shared) -- ["What Is a Strange Loop and What is it Like To Be One?" by Douglas Hofstadter (2013)](https://youtu.be/UT5CxsyKwxg?feature=shared) -- ["The Economics of Programming Languages" by Evan Czaplicki (Strange Loop 2023)](https://youtu.be/XZ3w_jec1v8?feature=shared) -- [Why Isn't Functional Programming the Norm? – Richard Feldman](https://youtu.be/QyJZzq0v7Z4?feature=shared) -- https://www.youtube.com/watch?v=SxdOUGdseq4 "Simple Made Easy" - Rich Hickey (2011) +Lastly it's just common to have `|` syntax for unions. -### Books And Articles +### Why type system supports arrays? -- [Grokking Algorithms: An Illustrated Guide for Programmers and Other Curious People](https://www.amazon.com/Grokking-Algorithms-illustrated-programmers-curious/dp/1617292230) -- [Bob Martin's Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html) -- [The Go Programming Language](https://www.amazon.com/Programming-Language-Addison-Wesley-Professional-Computing/dp/0134190440) -- [Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems](https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable/dp/1449373321) -- [Code: The Hidden Language of Computer Hardware and Software](https://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319) +Because type-system is public package that can be used by others to implement languages (or something else constraint-based). -### Other +Since there's no arrays at the syntax and internal representation levels then there's no performance overhead. Also having arrays in type system is not the most complicated thing so removing them won't save us much. -- [Go By Example](https://gobyexample.com/) +### Why isn't Nevalang self-hosted? -# Community +- Runtime will never be written in Nevalang itself because of the overhead of FBP runtime on to of Go's runtime. Go provides exactly that level of control we needed to implement FBP runtime for Nevalang. +- Compiler will be someday rewritten in Nevalang itself but we need several years of active usage of the language before that -Here you can find help +There's 2 reasons why we don't rewrite compiler in Nevalang right now: -- [Flow-Based Programming Discord](https://discord.gg/JHWRuZQJ) -- [r/ProgrammingLanguages](https://www.reddit.com/r/ProgrammingLanguages/) +1. Language is incredibly unstable. Stdlib and even the core is massively changing these days. Compiler will be even more unstable and hard to maintain if we do that, until Nevalang is more or less stable. +2. Languages that are mostly used for writing compilers are eventually better suited for that purpose. While it's good to be able to write compiler in Nevalang without much effort, it's not the goal to create a language for compilers. Writing compilers is a good thing but it's not very popular task for programmers. Actually it's incredibly rare to write compilers at work. We want Nevalang to be good language for many programmers. diff --git a/README.md b/README.md index 56fde96d..5d21229e 100644 --- a/README.md +++ b/README.md @@ -2,40 +2,41 @@ **

Flow Based Programming Language

** -## Neva +# Neva A general-purpose, flow-based programming language with static typing and implicit parallelism, designed with visual programming in mind, that compiles to machine code and Go. Website: https://nevalang.org ```neva -const { - greeting string 'Hello, World!' -} - -components { - Main(enter any) (exit any) { - nodes { printer Printer } - net { - in:enter -> ($greeting -> printer:msg) - printer:msg -> out:exit - } +component Main(start any) (stop any) { + nodes { printer Printer } + net { + in:start -> ('Hello, World!' -> printer:msg) + printer:msg -> out:stop } } ``` -## Contributing - -See [CONTRIBUTING.md](./CONTRIBUTING.md) +## 🚀 Features + +- 🌊 Flow-Based Programming +- 🔀 Effortless Concurrency +- 🛡ī¸ Static Type System +- đŸŽ¯ Multi-Target Compilation +- ✨ Simple and Clean C-like Syntax +- 🏃‍♂ī¸ Interpreter Mode +- 💉 First-Class Dependency Injection +- đŸ•ĩī¸â€â™‚ī¸ Builtin Observability +- â™ģī¸ Garbage Collection +- 🌈 Visual Programming (WIP) +- đŸĻĢ Go Interop (WIP) +- đŸĻē No Runtime Exceptions (WIP) -## Architecture - -See [ARCHITECTURE.md](./ARCHITECTURE.md) - -## FAQ +## Contributing -See [FAQ.md](./docs/faq.md) +See [CONTRIBUTING.md](./CONTRIBUTING.md) and [ARCHITECTURE.md](./ARCHITECTURE.md) --- -> WARNING: This project is under heavy development and not production ready yet. \ No newline at end of file +> ⚠ī¸ WARNING: This project is under **heavy** development and not production ready yet. diff --git a/cmd/interpreter/main.go b/cmd/interpreter/main.go deleted file mode 100644 index bbfaa167..00000000 --- a/cmd/interpreter/main.go +++ /dev/null @@ -1,74 +0,0 @@ -package main - -import ( - "context" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/nevalang/neva/internal/compiler" - "github.com/nevalang/neva/internal/compiler/analyzer" - "github.com/nevalang/neva/internal/compiler/desugarer" - "github.com/nevalang/neva/internal/compiler/irgen" - "github.com/nevalang/neva/internal/compiler/parser" - "github.com/nevalang/neva/internal/pkgmanager" - "github.com/nevalang/neva/internal/runtime" - "github.com/nevalang/neva/internal/runtime/funcs" - "github.com/nevalang/neva/pkg/typesystem" -) - -func main() { - // runtime - connector := runtime.NewDefaultConnector() - funcRunner := runtime.MustNewFuncRunner(funcs.CreatorRegistry()) - r := runtime.New(connector, funcRunner) - - // type-system - terminator := typesystem.Terminator{} - checker := typesystem.MustNewSubtypeChecker(terminator) - resolver := typesystem.MustNewResolver(typesystem.Validator{}, checker, terminator) - - // compiler - desugarer := desugarer.Desugarer{} - analyzer := analyzer.MustNew("0.0.1", resolver) - irgen := irgen.New() - prsr := parser.New(false) - comp := compiler.New( - prsr, - desugarer, - analyzer, - irgen, - nil, // we don't need backend for interpretation - ) - - // interpreter - intr := New( - comp, - NewAdapter(), - r, - pkgmanager.New( - "/Users/emil/projects/neva/std", - "/Users/emil/projects/neva/thirdparty", - prsr, - ), - ) - - wd, err := os.Getwd() - if err != nil { - fmt.Println(err) - return - } - - os.Args[1] = strings.TrimSuffix(os.Args[1], "/main.neva") - - if filepath.Ext(os.Args[1]) != "" { - fmt.Println("Use path to directory with executable package, relative to module root") - return - } - - if err := intr.Interpret(context.Background(), wd, os.Args[1]); err != nil { - fmt.Println(err) - return - } -} diff --git a/docs/about.md b/docs/about.md deleted file mode 100644 index aced7630..00000000 --- a/docs/about.md +++ /dev/null @@ -1,47 +0,0 @@ -# About The Language - -Nevalang is a programming language with unique set of characteristics. Let's break down each one of them - -## Main Characteristics - -### Flow-Based (Dataflow) - -In most _conventional_ languages programmer [controls execution flow](https://en.wikipedia.org/wiki/Control_flow). In [dataflow programming](https://en.wikipedia.org/wiki/Dataflow_programming) on the other hand programmer _controls data flow_. Basically it means that you don't have access to "low-level" instructions like "goto", "break" or even "return". Instead you can only connect inputs and outputs. And this changes everything we know about programming. - -Dataflow programming is very different from the conventional. Some things are easier with conventional programming and some with dataflow. One thing for sure - dataflow programming is much more suitable for at least 2 things: parallel computations and visual programming. - -The main thing about Nevalang is that it's [flow-based](https://en.wikipedia.org/wiki/Flow-based_programming). Flow-based programming is a subset of dataflow programming. It's not a classical FBP though. - -### Visual - -Nevalang is language with strong visual programming support by design. Combination of static typing and dataflow nature of the language it's easy to create visual representations of the program. Nevalang isn't just visual language though. It's a _hybrid_ language. While being easy to visualize it has simple C-like syntax for text-based programming. There are sertain cases like version control, merge request or hacking in REPL, where text is king. - -Right now visual editor is a supporting tool while text is the main way to program. It is assumed though that in the future when visual tools will be good enough things will change. Visual programming will be the norm and text programming will be supported alterrnative for edge-cases. Nevalang has everything to accomplish that. - -### General Purpose - -Most visual programming languages are not general purpose. They are designed for specific purposes. E.g. "Scratch" is for educating, "Unreal blueprints" are for games, "Labview" for science, etc. There are a few _general purpose visual programming languages_ but none of them are popular as well as none of them are flow-based. - -Nevalang on the other hand is general purpose visual flow-based language. It could be used for anything. It doesn't mean that it's perfectly suitable for anything though. For instance it probably should't be used for low-level stuff like drivers (because of the runtime overhead). But eventually user should be _able_ to do so. - -### Statically Structurally Typed - -Nevalang is statically typed which means that there is a compiler with static analyzer that ensures that the program satisfies the invariant. All types are known at compile time. Programmer can catch many bugs at compile-time. - -Structural sub-typing means that e.g. if component wants object of form `{ age int }` as an input, then it's complitely file to send object of form `{ age int, name string }` to it. In this case `name` will simply be ignored. This allows to write much less "adater" code. - -### Compiled - -As been said there is a compiler. This means that source code is not interpreted by some kind of engine but instead there is a special entity that reads source code, analyzes and optimizes it and produces some lower-level code. Internally compiler has several intermidiate forms of the program but as the output (target) it can produce either byte-code (for VM), Go (for Go compiler) or executable binary machine code. - -### Garbage-Collected - -Used neither allocate and free memory manually not faces borrow-checker or other compile-time mechanism. Instead there is a garbage collector. This makes Nevalang [memory safe](https://en.wikipedia.org/wiki/Memory_safety) language. - -## Extra Characteristics - -We covered most important characteristics of the language but there is a couple more, a little bit less important but still unusual. - -### Interpreted-mode - -Nevalang supports interpreter-mode that is suitable for development and debugging purposes. There is a special binary that can read and execute source code. There is still static types and compiler, but under the hood. No need to compile and then execute seperately. diff --git a/docs/best_practises.md b/docs/best_practises.md deleted file mode 100644 index bf4fb297..00000000 --- a/docs/best_practises.md +++ /dev/null @@ -1,175 +0,0 @@ -# Style Guide - -Neva language has official style guide and it's described in this document. - -## Code Organization - -### Keep Files Small - -Try to keep files less than **300** lines. - -Exceptions _sometimes_ allowed but files that are longer that 300 lines usually could be splitted. Files that are larger than 500 lines are definitely a sign of a problem. - -Perfectly it's about 100-200 lines per file. - -## Formatting - -### Use Tabs Instead of Spaces - -1. Anyone can configure their editor to render tabs exactly like they want whether it's 2, 4 or 8 spaces. Yet the source code itself is the same for everyone. With spaces you have to decide how many spaces you use. Someone likes 2, someone likes 4 and so on. -2. Tabs use less data for encoding the source code. E.g. for tabs that looks like a 4 spaces there's x4 characters economy. - -### Keep Lines Short - -Avoid lines that are longer than **80** characters. - -1. Even though we have big screens these days, the space that we can focus on with our eyes is limited to about 80 characters. With this line length we can read code without moving the head and with less amount of eyes movement. -2. Professional programmers tend to use split-screens a lot. 120 characters is ok if you only have one editor and probably one sidebar but what about 2 editors? What about 2 editors and sidebar? 2 editors and two sidebars? You got the point. -3. Many people use big fonts because they care about their eyes. Long lines means horizontal scroll for them and scroll itself takes time. -4. Professional programmers sometimes uses different kinds of "code lenses" in their IDEs so e.g. the line that is technically 120 characters becomes actually 150 or 200. Think of argument names lenses for instance. - -### Add Newlines - -#### Between Sections - -```neva -import { - ... -} - -types { - ... -} - -interfaces { - ... -} - -const { - ... -} - -components { - ... -} -``` - -#### Between Entities - -```neva -types { - Foo int - - Bar str -} -``` - -## Design - -### Use generics when necessary - -You need generics (type parameters) when you need to preserve data type on the output side. - -E.g. `Destructor` component doesn't have outports so it doesn't matter what you passed in. That's why `Destructor` accepts `any` instead of `T`. - -On the other hand `Blocker` needs to know the type of `data` on the input so the type of the `data` on the output is preserved. That's why it's `Destructor`. - -### Separate downstream flow with outports - -When you have _structured_ data data use `struct`, when you want to _separate flow_ - create outports. - -Example: `NumParser` sends `res` or `err` but never both at the same time. It's case for outports. - -On the other hand when you have e.g. two pieces of data `foo` and `bar`, but their firing condition is always the same - use `struct { foo T1, bar T2 }`. This way user of your component could simply use `struct selector` if needed. - -### Avoid Multiple Parents When Possible - -When designing component's networks prefer _Pipe_ or _Tree_ structure over graphs where single child have multiple parents. This makes network hard to understand visually. Sometimes it's impossible to avoid that though. - -### Keep Number of Ports Small - -Try to keep the **number of inports no bigger than 3** and **outports no bigger than 5**. - -Sometimes we _pass data on_ - we use our outports to not only send the results but also to pass our inputs down the stream so downstream nodes can also use them without being connected to upstream nodes which makes network hard to read both visually and textually. - -## Naming Conventions - -CamelCase is used everywhere except for package names. - -Names are rather short, but their length depends on their scope. - -For camelCase (both lower and upper) traditional style (not Go style) is used. For example it's `xmlHttpRequest` and not `xmlHTTPRequest`. - -### Packages - -Package names are short (1-3 words) `lower_snake_case` strings. Examples: `http` or `business_logic`. They inherit context from their path so it's `net/http` and not `net_http`. - -### Entities - -`CommonCamelCase` is used for _types_, _interfaces_ and _components_ and `lowerCamelCase` for constants. - -Entity names can be relatively long (up to 3 words) and descriptive. It's important because port names must be short and names of the entities they represent will serve as a documentation. - -Abbreviation ok if there is a generally accepted one. Or the name turns out to be extremely long (more than 3 words). - -For example, `AsynchronousFileReader` is bad because there is generally accepted abbreviation for "Asynchronous", it's "async". - -On the other hand `AsyncFRdr` is bad too because words "File" and "Reader" are short enough already and there is no need to shorten them. Besides there's no accepted abbreviation "F" and "Rdr" for them. - -Perfect name would be `AsyncFileReader`. - -#### Types - -Types are generally CamelCase nouns. Examples: `User`, `UserId`, `OrderDetail`, `HttpResponse`, `DayOfWeek`, `ResponseCode`, `FileType`. - -Enum elements are named exactly the same way: `{ Monday, Tuesday, ... }`. - -Struct fields are named this way except they start with the lower case: - -```neva -User struct { - age int - name string -} -``` - -#### Components - -Component names typically ends with "er" which describe a performed action. Examples would be `Printer` and `Logger`. - -#### Interfaces - -Interfaces are named exactly like components except their names are prefixed with `I`. Examples: `IReader`, `IStreamer`. - -#### Constants - -Constants are lowerCamelCase `defaultTimeout`, `apiEndpoint`, `stockMarketTime`. - -### Ports - -Use short (up to 5 chars) names for ports. - -Single-letter names are ok when it's obvious what they mean based on context. E.g. `f` is okay when it's type is `File`. You'll find many examples of `s` for `string`, `b` for `bool` or `l` for `list`, etc in stdlib. - -It's a good practice though to give meaningful names when possible e.g. `res` instead of `s` when it's not just string but rather result of some operation. - -Also try to follow patterns from stdlib like `res, err`, `ok, miss`, `some, none`, etc. - -And remember that 5 characters is not a lot so you have to shorten most of the time if there's more than 1 word. So `userID` is too long and should be `uid`. - -It's important to have short port names because of the visual programming. When you work with graphs of nodes you'll see a lot of connections. It will become unreadable very quickly if there's a lot of ports per node and/or array ports involved. - -### Nodes - -Nodes are generally named exactly like their components but in `lowerCamelCase`. E.g. for `FileReader` we would have `fileReader`. - -If node is abstract (it's instantiated with interface instead of component) then `I` prefix is omitted. So it's `reader IReader` and not `iReader`. - -Except if we have several instances of the same component. Then we must stress out why there's several of them and what is the difference. For instance for a component that needs two Adder instances it could be: - -```neva -nodes { - adder1 Adder - adder2 Adder -} -``` diff --git a/docs/compiler_directives.md b/docs/compiler_directives.md deleted file mode 100644 index 3791e83c..00000000 --- a/docs/compiler_directives.md +++ /dev/null @@ -1,7 +0,0 @@ -# Compiler Directives - -Compiler directives are special instructions for compiler. They are not intended to be used on a daily basis by regular user but good nevalang programmer must understand how they work because they are base for how many language features operate. - -- `#runtime_func` - directive for _component_ that tells the compiler that given component does not have implementation in source code and instead a runtime function call must be created. -- `#runtime_func_msg` - Directive for _node_ that tells the compiler to insert given message to corresponding runtime function call. Can only be used with nodes that are instantiated with components with `runtime_func` directive. -- `#struct_inports` - tells the compiler that inports for this component are not defined in nevalang source code but instead must be derived from it's type-argument which is the structure. Inports will correspond to structure fields. diff --git a/docs/contributing/design_principles.md b/docs/contributing/design_principles.md deleted file mode 100644 index 6b5e5a36..00000000 --- a/docs/contributing/design_principles.md +++ /dev/null @@ -1,33 +0,0 @@ -# Design Principles - -Nevalang is built on a set of principles. They were rather naturally derived from the development process rather artificially created beforehand. - -> WARNING: Language is under heavy development and these principles are not guarantees we can give you at the moment, but rather guiding stars for us to keep moving in the right direction - -## Program must fail at startup or never - -The idea is that most of the errors must be caught by compiler at compile time. And the rest of them, that are hard to catch (without sacrificing compiler's simplicity) are checked in runtime at startup. - -If no errors were caught at compile time and startup - then the program is correct and must run successfully. Any (non-logical) error that occurred after startup must be threated like compiler bug. - -## Runtime must be fast, flexible and unsafe - -Runtime won't do any checks after startup. The program that runtime consumes must be correct. Program's correctness must be ensured by compiler. If there's a bug in compiler and runtime consumed invalid program - bad things can happen: deadlocks, memory leaks, freezes and crashes. - -## Compiler directives must not be required - -Language must allow to implement everything without using of compiler directives. - -**Compiler directives are not always unsafe** (analyzer won't always validate their usage - that will make implementation more complicated) and thus must be used by language/stdlib developers or at _for users that know what they are doing_. - -It's good for user to understand what compiler directives are and how syntax sugar use them under the hood though. - -## There is interpreter (backend can be slow) - -Compiler must be fast to the point where it generates IR. After that we have generating of target code (e.g. generating Go and then generating machine code with Go compiler) - that part ("backend") doesn't have to be fast. It's more important to keep it simple. - -The reason for that is that we have an interpreter that is internally uses compiler (it's impossible to generate IR from invalid program due to lack of type information), but not the whole thing. Just to the point where it generates IR. That's the part of the compiler that is used for development/debugging purposes. That's where we need to be fast. - -## There is visual programming - -Once we build the good enough tool for visual programming we will switch from text based approach. Text will become supporting tool. To achieve this we must always keep in mind that what we do with the language must be easy to visualize in graph environment. diff --git a/docs/contributing/qa/README.md b/docs/contributing/qa/README.md deleted file mode 100644 index d9eb9f63..00000000 --- a/docs/contributing/qa/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Questions and Answers - -Please note that this is not [FAQ](../faq.md). - -This is knowledge base that should help find out why sertain decisions were maid. This is more for questions like "_why_ X works this way?" assuming you already understand what "X" is. - -- [Design](./design.md) - why language works the way it is -- [Internal](./internal.md) - why the language internally implemented this way diff --git a/docs/contributing/qa/design.md b/docs/contributing/qa/design.md deleted file mode 100644 index 1a2ca40d..00000000 --- a/docs/contributing/qa/design.md +++ /dev/null @@ -1,279 +0,0 @@ -# Design - -## Why need array-ports? - -Every time we need to somehow combine/accumulate/reduce several sources of data into one e.g. - -- create list of 3 elements based on outputs of 3 outports -- create structure with field-values from several outports -- substract values from left to right - -Ok but can't we substract values and do other stuff like that by simply passing lists around? Well, we have to create that list right somehow? It's fine if you already have it (let's say from JSON file you got from server) but what if you need to build it? - -## Why component can't read from it's own array-inports by index? - -Imagine you do stuff like: - -```neva -in.foo[0] -> ... -in.foo[1] -> ... -``` - -Now what will happen if parent node will only use `0` slot of your `foo` array-inport? Should it block forever? Or maybe should the program crash? Sounds not too good. - -The other way we could handle this is by making analyzer ensure that parent of your component uses your `foo` array-inport with exactly `0` and `1` slots. The problem is that makes array-ports useless. Why even have them then? The whole point of array-ports is that you don't know how many slots are going to be used. And that makes your component flexible. It allows you to create components that can do stuff like "sum all numbers from all inports no matter how many of them are present". - -Besides, you can already say "use my component with exactly two values" already and you don't need any array-ports for that at all! All you need in that case is simply create two inports. - -Having that said we must admit that it's impossible to allow component read form it's own array-inports by index and still having type-safety. - -Also think about _variadic arguments_ in Go. It's not safe to refer to `...args` by index (even though it's possible because Go compiler won't protect you). - -## Why component can read from sub-node's array-outports by index? - -Isn't it unsafe to read from array-outports by index? We've restricted that for component itself by banning the ability to read form self outports by index. Why allow read from sub-node outports by index then? - -Well, it turns out there are critical cases where we need that. One of them is "routing" - where you have some data on the input and you need to figure out, based on some predicate, where to send it further. Like if you have a web-server and you received a request, you need to route it to specific handler based on the path that this request contains. - -It's possible to do that with sequence of if-else though but that would be really tedious and error-prone. That also would make your network more nested and less straightforward. - -### Can't we implement syntax sugar for that? - -It's possible to introduce some sort of syntax sugar where user interacts with array ports and under the hood it's just a bunch of if-elses. But that actually makes no sense. If we have array-outports as a part of the language interface, we have them anyway. We also have use-cases for array-inports which means there are other reasons why have array ports. And finally it would be better for performance to have one low-level control-flow component implemented in implementation langauge and not Nevalang instead of compiling one high-level component to another big high-level component. One might ask - but we did that for Lock, what's the difference? The thing is with lock we are not replacing one component usage with the another, like we would in case of replacing some kind of "router" with bunch if if-elses. We simply insert implicit code, that is assumed by the higher level constructs like only exist at the level of the source code and not the real machinery. - -## Why outports usage is optional and inport usage is required? - -Indeed when component `A` uses `B` as it's sub-component (when it instantiates a _node_ with it) in it's _network_ it's _enforced_ to use _all_ the inports of `B` and it's _at least one_ outport. It doesn't have to use all the outports though. - -This is because inports are requirements - they are needed to receive the data that component _needs_ to produce result. Outports on the other hands are options. They are results that parent network might need to a sertain degree. For instance if `B` have outports `foo` and `bar`, it's completely possible that `A` only needs `foo` and have nothing to do with `bar`. - -This leads us to the need of the `Void` (builtin) component. This is the only component that doesn't have outports. It is used for discarding the unwanted data. If there would be no syntactic sugar for that, then we would have to explicitly create `void` nodes and use it in places like this: - -```neva -nodes { - b B - void Void -} -net { - // ... - b.bar -> void.v // discard all messages from `bar` outport -} -``` - -It's not the problem that it's tedious (even though it is, imagine having 10 unwanted outports in your network which is completely possible). The real problem is that by discarding some outports user is in danger of programming the dataflow in the wrong way. - -Imagine that `B` has outports `v` (for valid results) and `err` (for error messages). It fires either `v` or `err` and never both at the same time. And we want out program to terminate if there's nothing to do left. Consider this code: - -```neva -Main(enter) (exit) { - nodes { - b B - void Void - print Print - } - net { - in.enter -> b.sig - b.err -> void.v // ignore the `err` outport, only handle happy path - b.v -> print.v - print.v -> out.exit - } -} -``` - -We print the success result and then terminate. If there is no success result and only error we well... do nothing. And that's bad. What we should do instead is this: - -```neva -// ... -net { - in.enter -> b.sig - - // print both result and error - b.err -> print.v - b.v -> print.v - - // and then exit - print.v -> out.exit -} -``` - -As you can see it's easy to get in trouble by ignoring some outports (especially the error ones). If user wouldn't have the ability to do so he would have to do _something_ with `err` message. Anyway there would still be two problems... - -1. Even then user still _can_ send the data in the wrong way. E.g. send the `err` message back to `b.sig` or `print` it but then send the `print.v` back to the `print` forming an endless loop. This kind of _logical_ mistakes are hard to catch. Making the language _that_ safe would also make it much more complicated (think of Haskell or Rust (where we still have such kinds of problems!)). -2. Sometimes we have _nothing to do_ with unwanted data. We don't wanna print it or even send downstream (because that would simply delay the question what to do with unwanted data). This is the reason why `Void` doesn't have outports. Otherwise a paradox arises. - -This leads us to a conclusions: - -- There must be a way to omit unwanted data, whether it's explicit (`Void`) or implicit sugar -- It's impossible to make langauge 100% safe without sacrificing the simplicity of use - -As we saw explicit Void doesn't solve these problems so why not introduce sugar? Let's allow user to simply omit unwanted data and let the compiler implicitly insert `Void` under the hood. The logical mistakes? Well... They are "unsolvable" anyway. - -## Why there's no int32, float32, etc? - -Because that's a simple language. Lack of ability to configure bit-size of the number but still being able to choose between integers and floats is the compromise that seems to be reasonable. Probably Python is a good example of that too. - -## Why have integers and floats and not just numbers? - -1. Overflow issues: if you only have `number`, probably represented as a `float64` in memory, your maximum safe number is bigest float64. Integer can store "bigger" values because it doesn't have to store (floating) precision. This is especially important when you work with big numbers. - -2. Performance Overhead: Floating-point operations are generally slower than integer operations. In a system where all numbers are floating-point, operations that could have been more efficient with integers suffer a performance penalty. - -3. Predictability in Comparisons: Floating-point arithmetic can lead to non-intuitive results due to precision errors, making comparisons and certain calculations (like summing a large list of numbers) less predictable. - -4. Lack of Type Safety: The absence of distinct types can lead to bugs that are hard to detect, as the language won't provide errors or warnings when performing potentially erroneous operations between different kinds of numeric values. - -## Why no literal senders in component networks? - -In conventional languages like e.g. Python we can simply spell - -```python -print(42) -``` - -To do same thing in Nevalang you must create `const`: - -```neva -const { - msg int 42 -} -components { - Main(enter) (exit) { - nodes { - print Print - } - net { - msg -> print.v - } - } -} -``` - -Wouldn't it be great to allow user to simply say? - -```neva -42 -> print.v -``` - -Turns out there's a problem with that approach. Under the hood (just like with `const` sender) we need to create `Const` node. But in the first case we use name of the constant `msg` as the node name so it desugares down to - -```neva -nodes { - #runtime_func_msg(msg) - msg Const -} -``` - -In case of `42` there's no identifier that we can use and thus we have to generate it. That's not a problem until we debug our program but as soon as we will we have to face some autogenerated node name that we have no idea where came from. - -This will probably happen quite often because when you don't have to create constant you probably won't. On the other hand with current approach you have to do that all the time. As a good thing - you won't have to deal with ambiguity - need a static value? Create const! - -## What is the motivation behind putting exactly these entities under builtin package? - -1. Frequently used -2. Used internally by compiler (desugarer) - -## Why constants are implemented this way? (Lock-semantic instead of trigger semantic) - -Const nodes are implemented like infinite loops that constantly sends messags across their receivers. This covers all the usecases but also requires locks because we usually want control when we send constant messages. - -Alternative to that design would be "trigger" semantics where we have some kind of `sig` inport for const nodes. Instead of starting at the program startup such trigger component would wait for external signal and then do the usual const stuff (infinite loop with sending messages). - -**The problem #1 with this approach - we still needs locks**. It's not enough to trigger infinite loop. E.g. in "hello world" example nothing would stop `msg` const node to send more than 1 `hello world` message to `print`. - -**Possible solution for that would be to change semantics and remove infinite loop logic**. Make const node send signal only after we trigger it via sig port. The problem with this approach is that there is many usecases where we want infinite loop behavior. Think of initial inports - e.g. `requestSender` component with `data` and `url` inports where `data` is dynamic and `url` is static. It's not enough to send static url value just once (`requestSender` must remember it, we don't go that way because that leads to bad design where components know where they get data from - this is huge violation of transport vs logic separation). - -This problem by itself is fixable with using external sources like signals. When we have some static inport we usually have some kind of dynamic data that must be used in combination with it. Even though it would lead to making networks more complicated (locks do this too though), it's possible solution. But we have another problem: - -**Problem #2** - `$` syntax sugar. - -Another problem with previous solution (const nodes have sig inport and they send one message per one signal) is how use `$` syntax sugar. - -Currently it's possible to _refer constants_ in network like this:`$msg -> ...` - -This won't be the thing because we have to have not just entity reference but regular ports like `$msg.sig` and `$msg.v`. This is not a disaster but rather strange API. - -Where this `$msg` node come from? Is it clear to me as a user that there are implicit nodes $ prefix for every constant that I can refer? Why these `sig` and `v` inports? Because this is how `std/builtin.Const` works? Why do I have to know this? Why do I have to know how syntax sugar is implemented under the hood in compiler? - -Finally another possible solution to that could be `Trigger` components in combination with `Const` components. The difference would be that const behaves like infinite loops that requires locks and triggers behaves like single sending triggers (no lock required). - -Problems with this solution are: - -1. Now we have 2 ways to do the same thing. Do I need to use const? Or trigger? When to use what? -2. Trigger either must be used in combination with `#runtime_func_msg` directive (this violates principle that user must be able to program without directvies) or there must be sugar for triggers. - -It's possible in theory to create sugar for triggers but the language could be too complicated with so many syntax features. This conclusion by itself is questionable but in combination with the first problem - having 2 ways to use static values. Looks like it's better not to have triggers. - -All this leads to a conclusion that the only good semantic for constants is the current ones - infinite loops that requires locks. The need to have locks is not a fancy thing by itself, but "then connections" sugar made this pretty simple. - -## Why have sub-streams? - -In programming we range over collections all the time. We do that either via _loops_ or higher order functions (recursion). There's a problem with both of these in FBP: - -We don't have _code as data_ (we can't pass components around like we pass functions in conventional languages) - -To implement loop we need: - -1. Mutable state. (We don't have one! We can simulate one using network loops tho). After we simulate mutable -2. Condition to check whether current cursor is still less than the length of the list -3. Length of the list - -It would be very verbose to do such things all the time so we can imagine some kind of generic `for` component that takes `list` and sends single values `T`. - -The biggest problem is - how do we know that list ended? How do we know that the previous element was the last one and the current element is the first element of the new list that just arrived? Without knowing this we loos information about the list boundary. And that is huge problem. In conventional programming we always know that. Without this simplest iteration patterns like `map` are impossible to implement. - -Possible solution to this (without introducing sub-streams) would be adding some kind of _signal_ that "the list just ended". One might think that `For` component could simply have two outports `v` and `sig`. No, it can't. In this case `sig` cannot be separate port because it needs to be in the exact same _steam_ as the elements themselves. Otherwise it's unclear how to be sure that we synchronized both streams (flows) together. Streams are concurrent and the order of messages across different streams is often unpredictable. - -That leads us to conclusion - such `For` component must have one outport (or at least it must not have separate `sig` outport). It instead must send not just `T` values (single elements of the colletion), but instead it must send some kind of structures. The shape must be something like this - -```neva -types { - Element { - v T - isLast bool - } -} -``` - -Congratulations! You just discovered sub-streams. - -## Why sub-streams are not like in classical FBP? - -John Paul Morrison, creator of Flow-Based Programming created _Sub streams_ as a part of the FBP. The problem that he was solving wasn't just iteration over collections. It was work with structured data. Sub-streams are the way we transfer structured objects in his paradigm. - -In Nevalang we have `struct`, `map` and `list` for that. We don't need to create "flat nested" sub-stream like this `( (1 2 3) (4 5 6) ) ( (7 8 9) )` to move two lists, we can simply move them like regular messages across the stream `-> l1 l2 ->`. The downstream component that receives `l1` and `l2` can then unpack them into sub-streams and process their individual elements. - -At the end it must pack them pack tho. This is _maybe_ where classical FBP outperforms Nevalang. We have to spend time on destructuring and structuring back. However, the **data in the outside world is structured**. We usually work with some kind of relational data, JSON, Protobuf, etc. - -## Isn't it the problem that component that works with type `T` cannot operate on `SubStreamItem` - -This is just how type-system works. We don't want to have a lot of special cases here and there. It's not a big deal also. - -If you have a component `C1` that takes `T` and you want to operate on `SubStreamItem` all you need is to create a wrapper. That wrapper will receive `SubStreamItem` and use `C1` inside of it with `.v` struct selection. - -If you need to continue sub-stream you simply send `SubStreamItem` from you wrapper component downstream. Or `SubStreamItem` (probably preserving `isLast` value). - -It's either you continue sub-stream or you do not. Depending on what your're doing (maybe you're counting sub-stream items so you just sends `int` eachtime sub-stream ends). - - -## Why `out:exit` of the `Main` is't `int`? - -This is the question about why `out:exit` isn't interpreted as exit code. - -The things is - you don't always have `int` as your exit condition. That's why it's `any`. - -Ok, but why then we don't check if that `any` is actually `int` under the hood and then interpret it as an exit code? - -Well, we can do that. But that would lead to situations where you accidentally have `int` like your exit condition but don't actually want it to be your exit code. Such cases are non obvious and will require you to somehow check that you send exit code you want. - -This problem gets bigger when you have `any` or _union_ `... | int` outport that is directed to `out:exit` - you'll have to check whether value isn't an `int`. Otherwise you're at risk of terminating with wrong code. - -**Exit codes are important**. Shell scripts and CI/CD depends on that. Most of the time you want your exit code to be `zero`. Non-zero exit code is not happypath, it's more rare. Having corner case like a base design decision is not what we want. - -## Why structural subtyping? - -1. It allowes write less code, especially mappings between records, vectors and maps of records -2. Nominal subtyping doesn't protect from mistake like passing wrong value to type-cast - -## Why have `any`? - -First of all it's more like Go's `any`, not like TS's `any`. It's similar to TS's `unknown`. It means you can't do anything with `any` except _receive_, _send_ or _store_ it. There are some [critical cases](https://github.com/nevalang/neva/issues/224) where you either make your type-system super complicated or simply introduce any. Keep in mind that unlike Go where generics were introduced almost after 10 years of language release, Neva has type parameters from the beggining. Which means in 90% of cases you can avoid using of `any` and panicking. \ No newline at end of file diff --git a/docs/contributing/qa/internal.md b/docs/contributing/qa/internal.md deleted file mode 100644 index 4b1692fb..00000000 --- a/docs/contributing/qa/internal.md +++ /dev/null @@ -1,104 +0,0 @@ -# Internal Implementation - -## Why structures are not represented as Go structures? - -It would take generating Go types dynamically which is either makes use of reflection or codegeneration (which makes interpreter mode impossible). Maps have their overhead but they are easy to work with. - -## Why nested structures are not represented as flat maps? - -Indeed it's possible to represent `{ foo {bar int } }` like `{ "foo/bar": 42 }`. The problem arise when when we access the whole field. Let's take this example: - -``` -types { - User { - pet { - name str - } - } -} - -... - -$u.pet -> foo.bar -``` - -What will `foo.bar` actually receive? This design makes impossible to actually send structures around and allows to operate on non-structured data only. - -## Why Go? - -It's a perfect match. Go has builtin green threads, scheduler and garbage collector. Even more than that - it has goroutines and channels that are 1-1 mappings to FBP's ports and connections. Last but not least is that it's a pretty fast compiled language. Having Go as a compile target allows to reuse its state of the art standart library and increase performance for free by just updating the underlaying compiler. - -## Why compiler operates on multi-module graph (build) and not just turns everything into one big module? - -Imagine you have `foo.bar` in your code. How does compiler figures out what that actually is? In order to do that it needs to _resolve_ that _reference_. And this is how _reference resolution_ works: - -First, find out what `foo` is. Look at the `import` section in the current file. Let's say we see something like: - -```neva -import { - github.com/nevalang/x/foo -} -``` - -This is how we now that `foo` is actually `github.com/nevalang/x/foo` imported package. Cool, but when version of the `github.com/nevalang/x` we should use? Well, to figure that out we need to look out current _module_'s _manifest_ file. There we can find something like: - -```yaml -deps: - - github.com/nevalang/x 0.0.1 -``` - -Cool, now we now what _exactly_ `foo` is. It's a `foo` package inside of `0.0.1` version of the `github.com/nevalang/x` module. So what's the point of operating on a nested multi-module graph instead of having one giant module? - -Now let's consider another example. Instead of depending on `github.com/nevalang/x` your code depends on `submodule` and that sub-module itself depends on `github.com/nevalang/x` - -You still have that `foo.bar` in your code and your module still depends on `github.com/nevalang/x` module. But now you also depends on another `submod` sub-module that also depends on `github.com/nevalang/x`. But your module depends on `github.com/nevalang/x` of the `0.0.1` version and `submod` depends on `1.0.0`. - -Now we have a problem. When compiler sees `foo.bar` in some file it does import lookup and sees `github.com/nevalang/x` and... does not know what to do. To solve this issue we need to lookup current module manifest and check what version `github.com/nevalang/x` _this current module_ uses. To do that we need to preserve the multi-module structure of the program. - -One might ask can't we simply import things like: - -```neva -import { - github.com/nevalang/x@0.0.1 -} -``` - -That actually could solve the issue. The problem is that now we have to update the source code _each time we update our dependency_. That's a bad solution. We simply made probramming harder to avoid working on a compiler. We can do better. - -## Why #runtime_func_msg does not accept literals? - -Indeed it would be handy to be able to do stuff like this: - -```neva -nodes { - #runtime_func_msg(str "hello world!") - const Const -} -``` - -This would make desugarer much simpler (no need to create all this virtual constants), and not just for const senders but for struct selectors too. - -However, to implement this we need to be able to parse literals inside `irgen`. Right now we already introduce dependency for parsing entity references, but for arbitrary expressions we need the whole parser. - -Of course, it's possible to hide actual parser implementation behind some kind of interface defined by irgen but that would make code more complicated. Besides, the very idea of having parser inside code-generator sounds bad. Parsing references is the acceptable compromise on the other hand. - -## Why Analyzer knows about stdlib? Isn't it bad design? - -At first there was a try to implement analyzer in a way that it only knows about the core of the language. - -But turns out that some components in stdlib (especially `builtin` package, especially the ones that uses `#runtime_func` and `#runtime_func_msg` directives) are actually part of the core of the language. - -E.g. when user uses struct selectors like `foo.bar/baz -> ...` and then desugarer replaces this with `foo.bar -> structSelectorNode("baz") -> ...` (this is pseudocode) we must ensure that type of the `bar` is 1) a `struct` 2) has field `baz` and 3) `baz` is compatible with whatever `...` is. _This is static semantic analysis_ and that's is work for analyzer. - -Actually every time we use compiler directive we depend on implicit contract that cannot be expressed in the terms of the language itself (except we introduce abstractions for that, which will make language more complicated). That's why we have to analyze such things by injecting knowledge about stdlib. - -Designing the language in a way where analyzer has zero knowledge about stdlib is possible in theory but would make the language more complicated and would take much more time. - -## Why desugarer comes after analyzer in compiler's pipeline? - -Two reasons: - -1. Analyzer should operate on original "sugared" program so it can found errors in user's source code. Otherwise found errors can relate to desugar implementation (compiler internals) which is not the compilation error but debug info for compiler developers. Finally it's much easier to make end-user errors readable and user-friendly this way. -2. Desugarer that comes before analysis must duplicate some validation because it's unsafe to desugar some constructs before ensuring they are valid. E.g. desugar struct selectors without knowing fir sure that outport's type is a valid structure. Also many desugaring transformations are only possible on analyzed program with all type expressions resolved. - -Actually it's impossible to have desugarer before analysis. It's possible to have two desugarers - one before and one after. But that would make compiler much more complicated without visible benefits. diff --git a/docs/faq.md b/docs/faq.md deleted file mode 100644 index 7b6fb6e8..00000000 --- a/docs/faq.md +++ /dev/null @@ -1,63 +0,0 @@ -# Frequently Asked Questions (FAQ) - -## What is this? - -This is **Neva** - first visual general-purpose flow-based programming language with static structural typing and implicit parallelism. - -## Why yet another language? - -The goal is to create a system that is so powerful and easy to use at the same time, that even a person with zero programming skills can create effective and maintainable software with it. Imagine what a professional programmer could do with this tool. - -To achieve this we need many things. 2 of them can highlighted among them all: - -1. Visual programming - natural way of thinking -2. Implicit parallelism - elimination of manual concurrency management - -## Why not yet another language? - -Conventional programming paradigms served us well by taking us so far but it's time to admit that they have failed at visual programming and that parallelism is usually hard to implement right with them. Also dataflow is just what the things are in real world. This is the natural way of thinking about computation. - -## No manual concurrency management - -Any conventional program become more difficult when you add parallelism. As soon as you have more than one thread, bad things can happen - deadlocks, race-conditions, you name it. There are languages that makes this simpler by introdusing concurrency primitives from dataflow world such as goroutines and channels in Go (CSP) or Erlang's processes (actor-model). However, it's still programmer's responsibility to manage those primitives. Concept of parallelism is simple, any adult understands it. But to make use of computer parallelism one must understand coroutines, channels, mutexes and atomics. - -## Visual programming - -The argument that visual programming is less maintanable is wrong. This is just different form of representing a data. Flow-based approach allowes to abstract things away exactly like we used to with text-based programming. - -Actually there's no dependency on visual programming. Neva designed with support for visual programming in mind but in fact it's possible to use text representation. - -## Why FBP and not OOP/FP/etc? - -1. Higher level programming -2. Implicit concurrency -3. Easy to visualize - -_Higher level programming_ means there's no: variables, functions, for loops, classes, methods, etc. All these things are low-level constructions that must be used under the hood as implementation details, but not as the API for the programmer. It's possible to have general purpose programming language with support for implicit concurrency and visual programming without using such things. Actually using of such low-level things is something that makes support for visual programming harder. - -_Implicit concurrency_ means that programmer doesn't have to think about concurrency at all. At the same time any Neva program is concurrent by default. In fact there's no way to write non-concurrent programs. Explicit concurrency is like manual memory management - the great care must be put into. Concurrent programs in conventional langauges are always harder to maintain than regular ones. Not just all Neva programs are concurrent but programmer simply doesn't have a way to interact with concurrency. This is just how it works (thanks to FBP). - -_Easy to visualize_ means that the nature of FBP programs is that we do not have [control flow](https://en.wikipedia.org/wiki/Control_flow), but instead we control [data flow](https://en.wikipedia.org/wiki/Dataflow_programming). This is how real electronic components works - there's electricity that flows through connections implementing specific logic. This is also how we document software with visual schemas - sort of boxes connected by arrowes where data flows from one component to another being transformed in someway. But those schemas are usually "dead" - they're not connected with the source code in anyway. FBP allowes to make diagrams source code itself. - -## Is Neva "classical FBP"? - -No. But it inherits so many ideas from it that it would be better to use word "FBP" than anything else. There's a [great article](https://jpaulm.github.io/fbp/fbp-inspired-vs-real-fbp.html) by mr. J. Paul Morrison (inventor of FBP) on this topic. - -Now here's what makes Neva different from classical FBP: - -- Neva has C-like syntax for its textual representation while FBP syntax is somewhat esoteric. It's important to node though that despite C-like syntax Neva programs are 100% declarative -- Neva doesn't let you program in "implementation-level" language like Go (similar to how Python doesn't let you program in assembly). FBP on the other hand forces you to program in langauges like Go or Java to implement elementary components. -- Neva introduces builtin observability via runtime interceptor and messages tracing, FBP has nothing like that -- Existing FBP implementations are essentially interpreters. Neva has both compiler and interpreter. -- Neva is statically typed while FBP isn't. FBP's idea is that you write code by hand in statically typed langauge like Go or Java and then use it in a non-typed FBP program, introducing runtime type-checks where needed -- Neva have _runtime functions_. In FBP there's just _elementary components_ that are written by programmer. Mr. Morrison did not like the idea of having "atomic" components like e.g. "numbers adder" -- Neva introduces hierarchical structure of program entities and package management similar to Go. Entities are packed into reusable packages and could be either public or private. -- Neva leverages existing Go's GC, FBP on the other hand introduces IP's life-cycle -- Neva's concurrency model runs on top of Go's scheduler which means it uses CSP as a lower-level fundament. FBP implementations on the other hand used to use shared state with mutex locks -- Neva has low-level program representation (LLR). FBP on the other hand doesn't describe anything like that - -Also there's differences in naming: - -- _Message_ instead of _IP (information package)_ not to be confused with "IP" as _internet protocol_ -- _Node_ instead of _process_ 1) not to be confused with _OS processes_ -- _Bound inports_ instead of _IIPs_ because of not using word _IP_ diff --git a/docs/quick_start.md b/docs/quick_start.md deleted file mode 100644 index 29630a7b..00000000 --- a/docs/quick_start.md +++ /dev/null @@ -1,3 +0,0 @@ -# Quick Start - -... \ No newline at end of file diff --git a/examples/0_do_nothing/main.neva b/examples/0_do_nothing/main.neva index 6f9ba013..1924f516 100644 --- a/examples/0_do_nothing/main.neva +++ b/examples/0_do_nothing/main.neva @@ -1,9 +1,7 @@ // This is the smallest possible program that compiles. // It literally does absolutely literally nothing. -// Here we learn components, ports, networks, connections and port addrs. +// Here we learn component, ports, networks, connections and port addrs. -components { - Main(enter any) (exit any) { - net { in:enter -> out:exit } - } +component Main(start any) (stop any) { + net { in:start -> out:stop } } \ No newline at end of file diff --git a/examples/1_echo/main.neva b/examples/1_echo/main.neva index ec44c826..06602590 100644 --- a/examples/1_echo/main.neva +++ b/examples/1_echo/main.neva @@ -2,20 +2,16 @@ // It does so in a loop - it won't terminate untill you press Ctrl+C. // Here we learn packages, stdlib, io package, nodes and type parameters -import { - std/io -} +import { std/io } -components { - Main(enter any) (exit any) { - nodes { - reader io.Reader - printer Printer - } - net { - in:enter -> reader:sig - reader.s -> printer:msg - printer:msg -> reader:sig - } +component Main(start any) (stop any) { + nodes { + reader io.Reader + printer Printer + } + net { + in:start -> reader:sig + reader.s -> printer:msg + printer:msg -> reader:sig } } \ No newline at end of file diff --git a/examples/2_hello_world/0_verbose/main.neva b/examples/2_hello_world/0_verbose/main.neva new file mode 100644 index 00000000..c89a8fbd --- /dev/null +++ b/examples/2_hello_world/0_verbose/main.neva @@ -0,0 +1,19 @@ +// Surprisingly "hello world" isn't the simplest program in Nevalang. +// Here we learn constants, compiler directives and blockers. + +const greeting string = 'Hello, World!' + +component Main(start any) (stop any) { + nodes { + #bind(greeting) + greeting Emitter + printer Printer + blocker Blocker + } + net { + in:start -> blocker:sig + greeting:msg -> blocker:data + blocker:data -> printer:msg + printer:msg -> out:stop + } +} \ No newline at end of file diff --git a/examples/2_hello_world/1_with_const_sender/main.neva b/examples/2_hello_world/1_with_const_sender/main.neva new file mode 100644 index 00000000..062d1cff --- /dev/null +++ b/examples/2_hello_world/1_with_const_sender/main.neva @@ -0,0 +1,17 @@ +// In this example we use `$` suntatic sugar called "const sender" +// that allows to avoid using compiler directives for sending constants. + +const greeting string = 'Hello, World!' + +component Main(start any) (stop any) { + nodes { + printer Printer + blocker Blocker + } + net { + in:start -> blocker:sig + $greeting -> blocker:data + blocker:data -> printer:msg + printer:msg -> out:stop + } +} \ No newline at end of file diff --git a/examples/2_hello_world/with_then_connection/main.neva b/examples/2_hello_world/2_with_then_connection/main.neva similarity index 52% rename from examples/2_hello_world/with_then_connection/main.neva rename to examples/2_hello_world/2_with_then_connection/main.neva index ac97c4cf..c2e69028 100644 --- a/examples/2_hello_world/with_then_connection/main.neva +++ b/examples/2_hello_world/2_with_then_connection/main.neva @@ -2,16 +2,12 @@ // Called "then connections" that allows to avoid explicit usage of blockers. // It's extremely useful when working with constants to keep code simple. -const { - greeting string 'Hello, World!' -} +const greeting string = 'Hello, World!' -components { - Main(enter any) (exit any) { - nodes { printer Printer } - net { - in:enter -> ($greeting -> printer:msg) - printer:msg -> out:exit - } +component Main(start any) (stop any) { + nodes { printer Printer } + net { + in:start -> ($greeting -> printer:msg) + printer:msg -> out:stop } } \ No newline at end of file diff --git a/examples/2_hello_world/3_with_literal_sender/main.neva b/examples/2_hello_world/3_with_literal_sender/main.neva new file mode 100644 index 00000000..66a13867 --- /dev/null +++ b/examples/2_hello_world/3_with_literal_sender/main.neva @@ -0,0 +1,14 @@ +// Finally, the shortest "hello world" with "literal senders". +// Why have const senders then, one might ask? +// First of all, only primitive messages such as bool, int, float and string +// could be used as network senders. So no structs, lists or maps senders. +// Secondly, what if you wanna use your message in several places? +// Finally, you might wanna move your message to const just because it's big! + +component Main(start any) (stop any) { + nodes { printer Printer } + net { + in:start -> ('Hello, World!' -> printer:data) + printer:sig -> out:stop + } +} \ No newline at end of file diff --git a/examples/2_hello_world/verbose/main.neva b/examples/2_hello_world/verbose/main.neva deleted file mode 100644 index 9f04c42d..00000000 --- a/examples/2_hello_world/verbose/main.neva +++ /dev/null @@ -1,23 +0,0 @@ -// Surprisingly "hello world" isn't the simplest program in Nevalang. -// Here we learn constants, compiler directives and blockers. - -const { - greeting string 'Hello, World!' -} - -components { - Main(enter any) (exit any) { - nodes { - #runtime_func_msg(greeting) - greeting Distributor - printer Printer - blocker Blocker - } - net { - in:enter -> blocker:sig - greeting:msg -> blocker:data - blocker:data -> printer:msg - printer:msg -> out:exit - } - } -} \ No newline at end of file diff --git a/examples/2_hello_world/with_const_sender/main.neva b/examples/2_hello_world/with_const_sender/main.neva deleted file mode 100644 index 9462265d..00000000 --- a/examples/2_hello_world/with_const_sender/main.neva +++ /dev/null @@ -1,21 +0,0 @@ -// In this example we use `$` suntatic sugar called "const sender" -// that allows to avoid using compiler directives for sending constants. - -const { - greeting string 'Hello, World!' -} - -components { - Main(enter any) (exit any) { - nodes { - printer Printer - blocker Blocker - } - net { - in:enter -> blocker:sig - $greeting -> blocker:data - blocker:data -> printer:msg - printer:msg -> out:exit - } - } -} \ No newline at end of file diff --git a/examples/3_interfaces/main.neva b/examples/3_interfaces/main.neva index 37c42a1a..f55b28ff 100644 --- a/examples/3_interfaces/main.neva +++ b/examples/3_interfaces/main.neva @@ -1,30 +1,24 @@ -// Here we learn interfaces and how to use them. +// Here we learn interface and DI. // It's essential to understand bridges. -interfaces { - IExample(msg T) (msg T) -} +interface IPrinter(data T) (sig T) -components { - Main(enter any) (exit any) { +component { + Main(start any) (stop any) { nodes { - sub SubComponent { - dep Printer - } + subNode SecondComponent { depNode Printer } } net { - in:enter -> sub:msg - sub:msg -> out:exit + in:start -> subNode:msg + subNode:msg -> out:stop } } - SubComponent (msg any) (msg any) { - nodes { - dep IExample - } + SecondComponent (msg any) (msg any) { + nodes { depNode IPrinter } net { - in:msg -> dep:msg - dep:msg -> out:msg + in:msg -> depNode:data + depNode:sig -> out:msg } } } \ No newline at end of file diff --git a/examples/4_add_numbers/verbose/main.neva b/examples/4_add_numbers/verbose/main.neva index 43f82a9f..770af352 100644 --- a/examples/4_add_numbers/verbose/main.neva +++ b/examples/4_add_numbers/verbose/main.neva @@ -1,25 +1,18 @@ // Here we learn `stream` and streamers -const { - a 1 - b 1 -} - -components { - Main(enter any) (exit any) { - nodes { - adder Adder - streamer PortStreamer - printer Printer - } - net { - in:enter -> ( - $a -> streamer:p[0] - $b -> streamer:p[1] - ) - streamer:seq -> adder:seq - adder:res -> printer:msg - printer:sig -> out:exit - } +component Main(start any) (stop any) { + nodes { + adder Adder + streamer PortStreamer + printer Printer + } + net { + in:start -> ( + 1 -> streamer:p[0] + 2 -> streamer:p[1] + ) + streamer:seq -> adder:seq + adder:res -> printer:msg + printer:sig -> out:stop } } \ No newline at end of file diff --git a/examples/4_add_numbers/with_bridge/main.neva b/examples/4_add_numbers/with_bridge/main.neva index 7ddd1fa0..14a77ae6 100644 --- a/examples/4_add_numbers/with_bridge/main.neva +++ b/examples/4_add_numbers/with_bridge/main.neva @@ -1,23 +1,16 @@ // Here we learn how to avoid explicit usage of streamers by using bridges. -const { - a 1 - b 1 -} - -components { - Main(enter any) (exit any) { - nodes { - adder PortBridge { handler Adder } - printer Printer - } - net { - in:enter -> ( - $a -> adder:p[0] - $b -> adder:p[1] - ) - adder:res -> printer:msg - printer:sig -> out:exit - } +component Main(start any) (stop any) { + nodes { + adder PortBridge { handler Adder } + printer Printer + } + net { + in:start -> ( + 1 -> adder:p[0] + 2 -> adder:p[1] + ) + adder:res -> printer:msg + printer:sig -> out:stop } } \ No newline at end of file diff --git a/examples/5_add_real_numbers/naive/main.neva b/examples/5_add_real_numbers/naive/main.neva index b85103a2..fd63d92c 100644 --- a/examples/5_add_real_numbers/naive/main.neva +++ b/examples/5_add_real_numbers/naive/main.neva @@ -5,27 +5,22 @@ import { std/strconv } -components { - Main(enter any) (exit any) { - nodes { - reader1 io.Reader - reader2 io.Reader - parser1 strconv.NumParser - parser2 strconv.NumParser - adder PortBridge { handler Adder } - printer Printer - } - net { - in:enter -> reader1:sig - reader1:s -> parser1:s - parser1:res -> { - adder:p[0] - reader2:sig - } - reader2:s -> parser2:s - parser2:res -> adder:p[1] - adder:res -> print:msg - print:msg -> out:exit - } +component Main(start any) (stop any) { + nodes { + reader1 io.Reader + reader2 io.Reader + parser1 strconv.NumParser + parser2 strconv.NumParser + adder PortBridge { handler Adder } + printer Printer + } + net { + in:start -> reader1:sig + reader1:s -> parser1:s + parser1:res -> [adder:p[0], reader2:sig] + reader2:s -> parser2:s + parser2:res -> adder:p[1] + adder:res -> print:msg + print:msg -> out:stop } } \ No newline at end of file diff --git a/examples/5_add_real_numbers/with_err_handling/main.neva b/examples/5_add_real_numbers/with_err_handling/main.neva new file mode 100644 index 00000000..69ae6c6f --- /dev/null +++ b/examples/5_add_real_numbers/with_err_handling/main.neva @@ -0,0 +1,28 @@ +// Here we learn how to handle errors by fixing this simple program + +import { + std/io + std/strconv +} + +component Main(start any) (stop any) { + nodes { + reader1 io.Reader + reader2 io.Reader + parser1 strconv.NumParser + parser2 strconv.NumParser + adder PortBridge { handler Adder } + printer Printer + } + net { + in:start -> reader1:sig + reader1:s -> parser1:s + parser1:err -> printer:v + parser1:res -> [adder:p[0], reader2:sig] + reader2:s -> parser2:s + parser2:err -> printer:msg + parser2:res -> adder:p[1] + add:res -> printer:msg + printer:msg -> out:stop + } +} \ No newline at end of file diff --git a/examples/5_add_real_numbers/with_error_handling/main.neva b/examples/5_add_real_numbers/with_error_handling/main.neva deleted file mode 100644 index 8a6ea1fe..00000000 --- a/examples/5_add_real_numbers/with_error_handling/main.neva +++ /dev/null @@ -1,33 +0,0 @@ -// Here we learn how to handle errors by fixing this simple program - -import { - std/io - std/strconv -} - -components { - Main(enter any) (exit any) { - nodes { - reader1 io.Reader - reader2 io.Reader - parser1 strconv.NumParser - parser2 strconv.NumParser - adder PortBridge { handler Adder } - printer Printer - } - net { - in:enter -> reader1:sig - reader1:s -> parser1:s - parser1:err -> printer:v - parser1:res -> { - adder:p[0] - reader2:sig - } - reader2:s -> parser2:s - parser2:err -> printer:msg - parser2:res -> adder:p[1] - add:res -> printer:msg - printer:msg -> out:exit - } - } -} \ No newline at end of file diff --git a/examples/5_add_real_numbers/with_sub_components/main.neva b/examples/5_add_real_numbers/with_sub_components/main.neva index 30980dd2..0f698a9b 100644 --- a/examples/5_add_real_numbers/with_sub_components/main.neva +++ b/examples/5_add_real_numbers/with_sub_components/main.neva @@ -5,16 +5,14 @@ import { std/strconv } -components { - Main(enter any) (exit any) { - nodes { - aux Aux - } +component { + Main(start any) (stop any) { + nodes { aux Aux } net { - in:enter -> aux:sig + in:start -> aux:sig aux:res -> printer:msg aux:err -> printer:msg - printer:msg -> out:exit + printer:msg -> out:stop } } @@ -22,12 +20,10 @@ components { nodes { reader1 IntReader reader2 IntReader - adder PortBridge { - handler Adder - } + adder PortBridge { handler Adder } } net { - in:enter -> reader1.sig + in:start -> reader1.sig reader1:num -> [adder:p[0], reader2:sig] reader1:err -> out:err reader2.num -> adder.p[1] diff --git a/examples/6_struct_builder/verbose/main.neva b/examples/6_struct_builder/verbose/main.neva index 26d1852b..603e7b74 100644 --- a/examples/6_struct_builder/verbose/main.neva +++ b/examples/6_struct_builder/verbose/main.neva @@ -1,32 +1,25 @@ // Here we learn how to build structures -// by creating custom components with compiler directives. +// by creating custom component with compiler directives. -types { - User struct { - age int - name string - } -} - -const { - age int 32 - name string 'John' +type User struct { + age int + name string } -components { - #runtime_func(StructBuilder) - MyStructBuilder(age int, name string) (msg User) - - Main(enter any) (exit any) { +component { + Main(start any) (stop any) { nodes { builder MyStructBuilder printer Printer } net { - $age -> builder:age - $name -> builder:name + 32 -> builder:age + 'John' -> builder:name builder:msg -> printer:msg - printer:msg -> out:exit + printer:msg -> out:stop } } + + #extern(StructBuilder) + MyStructBuilder(age int, name string) (msg User) } \ No newline at end of file diff --git a/examples/6_struct_builder/with_sugar/main.neva b/examples/6_struct_builder/with_sugar/main.neva index fe6599d9..2387f3d7 100644 --- a/examples/6_struct_builder/with_sugar/main.neva +++ b/examples/6_struct_builder/with_sugar/main.neva @@ -1,30 +1,21 @@ // Here we learn how to build structures -// without custom components and compiler directives +// without custom component and compiler directives // by simply using builtin StructBuilder. -types { - User struct { - age int - name string - } -} - -const { - age int 32 - name string 'John' +type User struct { + age int + name string } -components { - Main(enter any) (exit any) { - nodes { - builder StructBuilder - print Print - } - net { - $age -> builder.age - $name -> builder.name - builder.v -> print.v - print.v -> out:exit - } +component Main(start any) (stop any) { + nodes { + builder StructBuilder + print Print + } + net { + 32 -> builder:age + 'John' -> builder:name + builder:msg -> print:data + print:sig -> out:stop } } \ No newline at end of file diff --git a/examples/7_struct_selector/verbose/main.neva b/examples/7_struct_selector/verbose/main.neva index bef78f4e..e760b48b 100644 --- a/examples/7_struct_selector/verbose/main.neva +++ b/examples/7_struct_selector/verbose/main.neva @@ -1,7 +1,7 @@ // Here we learn how to read struct field // by using builtin component with compiler directive. -types { +type { User struct { name string pet Pet @@ -12,24 +12,25 @@ types { } const { - user User { - name: 'john' - pet: { name: 'Charley' } + user User = { + name: 'John', + pet: { name: 'Charley' }, } - path list ['pet', 'name'] + path list = ['pet', 'name'] } -components { - Main(enter any) (exit any) { +component { + Main(start any) (stop any) { nodes { printer Printer - #runtime_func_msg(path) + + #bind(path) selector StructSelector } net { - in:enter -> ($user -> selector:msg) + in:start -> ($user -> selector:msg) selector:msg -> printer:msg - printer:msg -> out:exit + printer:msg -> out:stop } } } \ No newline at end of file diff --git a/examples/7_struct_selector/with_selectors/main.neva b/examples/7_struct_selector/with_sugar/main.neva similarity index 55% rename from examples/7_struct_selector/with_selectors/main.neva rename to examples/7_struct_selector/with_sugar/main.neva index 49a8d7f2..58c2902e 100644 --- a/examples/7_struct_selector/with_selectors/main.neva +++ b/examples/7_struct_selector/with_sugar/main.neva @@ -1,29 +1,30 @@ // Here we learn how to read struct fields without compiler directives // by using another one syntax sugare `.` called "struct selectors". -types { +type { User struct { - age int + name string + pet Pet + } + Pet struct { name string } } -const { - u User { - age: 32 - name: 'john' - } +const user User = { + name: 'John', + pet: { name: 'Charley' }, } -components { - Main(enter any) (exit any) { +component { + Main(start any) (stop any) { nodes { locker Locker printer Printer } net { - in:enter -> ($u.pet.name -> printer:msg) - printer:msg -> out:exit + in:start -> ($user.pet.name -> printer:msg) + printer:msg -> out:stop } } } \ No newline at end of file diff --git a/go.mod b/go.mod index df55ecc6..1e603666 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,18 @@ module github.com/nevalang/neva go 1.21 require ( + github.com/antlr4-go/antlr/v4 v4.13.0 + github.com/go-git/go-git/v5 v5.10.0 github.com/golang/mock v1.6.0 github.com/stretchr/testify v1.8.2 -) - -require ( - github.com/go-git/go-git/v5 v5.10.0 github.com/tliron/commonlog v0.2.10 + github.com/tliron/glsp v0.2.0 + golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc + gopkg.in/yaml.v3 v3.0.1 ) +require github.com/caarlos0/env/v10 v10.0.0 // indirect + require ( dario.cat/mergo v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect @@ -19,7 +22,9 @@ require ( github.com/acomagu/bufpipe v1.0.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/cloudflare/circl v1.3.3 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect @@ -35,13 +40,17 @@ require ( github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sergi/go-diff v1.1.0 // indirect github.com/skeema/knownhosts v1.2.0 // indirect github.com/sourcegraph/jsonrpc2 v0.2.0 // indirect github.com/tliron/kutil v0.3.13 // indirect + github.com/urfave/cli/v2 v2.27.1 github.com/xanzy/ssh-agent v0.3.3 // indirect + github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/crypto v0.16.0 // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.17.0 // indirect @@ -50,12 +59,3 @@ require ( golang.org/x/tools v0.13.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) - -require ( - github.com/antlr4-go/antlr/v4 v4.13.0 - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/tliron/glsp v0.2.0 - golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc - gopkg.in/yaml.v3 v3.0.1 -) diff --git a/go.sum b/go.sum index 5b14eb45..0e219c72 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,12 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/caarlos0/env/v10 v10.0.0 h1:yIHUBZGsyqCnpTkbjk8asUlx6RFhhEs+h7TOBdgdzXA= +github.com/caarlos0/env/v10 v10.0.0/go.mod h1:ZfulV76NvVPw3tm591U4SwL3Xx9ldzBP9aGxzeN7G18= github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -84,6 +88,8 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= @@ -108,10 +114,14 @@ github.com/tliron/glsp v0.2.0 h1:zhBD0wDVVqlpuPYtjmhIXI/8W5KQewPjaS4SYRevKYQ= github.com/tliron/glsp v0.2.0/go.mod h1:lQDXPfht/Um/FJLthIpGyXclyKq7uVUolignlAyK66Q= github.com/tliron/kutil v0.3.13 h1:hB2k7zWYhuuQ8pqJ6Gu/LxDw8UUnjBlhBbwUt5rUiSs= github.com/tliron/kutil v0.3.13/go.mod h1:sazY84VhpRez9rFf6ajtZBdpThJ/OIVL7Mue6GC/rds= +github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho= +github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/internal/compiler/analyzer/component.go b/internal/compiler/analyzer/component.go index d5cee0b4..9328c3bf 100644 --- a/internal/compiler/analyzer/component.go +++ b/internal/compiler/analyzer/component.go @@ -10,38 +10,38 @@ import ( //nolint:lll var ( - ErrNodeWrongEntity = errors.New("Node can only refer to components or interfaces") - ErrNodeTypeArgsMissing = errors.New("Not enough type arguments") - ErrNodeTypeArgsTooMuch = errors.New("Too much type arguments") - ErrNonComponentNodeWithDI = errors.New("Only component node can have dependency injection") - ErrUnusedNode = errors.New("Unused node found") - ErrUnusedNodeInport = errors.New("Unused node inport found") - ErrUnusedNodeOutports = errors.New("All node's outports are unused") - ErrSenderIsEmpty = errors.New("Sender in network must contain either port address or constant reference") - ErrReadSelfOut = errors.New("Component cannot read from self outport") - ErrWriteSelfIn = errors.New("Component cannot write to self inport") - ErrInportNotFound = errors.New("Referenced inport not found in component's interface") - ErrNodeNotFound = errors.New("Referenced node not found") - ErrPortNotFound = errors.New("Port not found") - ErrNormCompWithRuntimeFunc = errors.New("Component with nodes or network cannot use #runtime_func directive") - ErrNormComponentWithoutNet = errors.New("Component must have network except it uses #runtime_func directive") - ErrNormNodeRuntimeMsg = errors.New("Node can't use #runtime_func_msg if it isn't instantiated with the component that use #runtime_func") - ErrInterfaceNodeWithRuntimeMsg = errors.New("Interface node cannot use #runtime_func_msg directive") - ErrRuntimeFuncZeroArgs = errors.New("Component that use #runtime_func directive must provide at least one argument") - ErrRuntimeMsgArgs = errors.New("Node with #runtime_func_msg directive must provide exactly one argument") - ErrRuntimeFuncOverloadingArg = errors.New("Component that use #runtime_func with more than one argument must provide arguments in a form of pairs") - ErrRuntimeFuncOverloadingNodeArgs = errors.New("Node instantiated with component with #runtime_func with > 1 argument, must have exactly one type-argument for overloading") + ErrNodeWrongEntity = errors.New("Node can only refer to components or interfaces") + ErrNodeTypeArgsMissing = errors.New("Not enough type arguments") + ErrNodeTypeArgsTooMuch = errors.New("Too much type arguments") + ErrNonComponentNodeWithDI = errors.New("Only component node can have dependency injection") + ErrUnusedNode = errors.New("Unused node found") + ErrUnusedNodeInport = errors.New("Unused node inport found") + ErrUnusedNodeOutports = errors.New("All node's outports are unused") + ErrSenderIsEmpty = errors.New("Sender in network must contain port address, constant reference or message literal") + ErrReadSelfOut = errors.New("Component cannot read from self outport") + ErrWriteSelfIn = errors.New("Component cannot write to self inport") + ErrInportNotFound = errors.New("Referenced inport not found in component's interface") + ErrNodeNotFound = errors.New("Referenced node not found") + ErrPortNotFound = errors.New("Port not found") + ErrNormCompWithExtern = errors.New("Component with nodes or network cannot use #extern directive") + ErrNormComponentWithoutNet = errors.New("Component must have network except it uses #extern directive") + ErrNormNodeBind = errors.New("Node can't use #bind if it isn't instantiated with the component that use #extern") + ErrInterfaceNodeBindDirective = errors.New("Interface node cannot use #bind directive") + ErrExternNoArgs = errors.New("Component that use #extern directive must provide at least one argument") + ErrBindDirectiveArgs = errors.New("Node with #bind directive must provide exactly one argument") + ErrExternOverloadingArg = errors.New("Component that use #extern with more than one argument must provide arguments in a form of pairs") + ErrExternOverloadingNodeArgs = errors.New("Node instantiated with component with #extern with > 1 argument, must have exactly one type-argument for overloading") ) func (a Analyzer) analyzeComponent( //nolint:funlen component src.Component, scope src.Scope, ) (src.Component, *compiler.Error) { - runtimeFuncArgs, isRuntimeFunc := component.Directives[compiler.RuntimeFuncDirective] + runtimeFuncArgs, isRuntimeFunc := component.Directives[compiler.ExternDirective] if isRuntimeFunc && len(runtimeFuncArgs) == 0 { return src.Component{}, &compiler.Error{ - Err: ErrRuntimeFuncZeroArgs, + Err: ErrExternNoArgs, Location: &scope.Location, Meta: &component.Meta, } @@ -52,7 +52,7 @@ func (a Analyzer) analyzeComponent( //nolint:funlen parts := strings.Split(runtimeFuncArg, " ") if len(parts) != 2 { return src.Component{}, &compiler.Error{ - Err: ErrRuntimeFuncOverloadingArg, + Err: ErrExternOverloadingArg, Location: &scope.Location, Meta: &component.Meta, } @@ -74,7 +74,7 @@ func (a Analyzer) analyzeComponent( //nolint:funlen if isRuntimeFunc { if len(component.Nodes) != 0 || len(component.Net) != 0 { return src.Component{}, &compiler.Error{ - Err: ErrNormCompWithRuntimeFunc, + Err: ErrNormCompWithExtern, Location: &scope.Location, Meta: &component.Meta, } diff --git a/internal/compiler/analyzer/component_net.go b/internal/compiler/analyzer/component_net.go index 88cb429a..f8fbe54d 100644 --- a/internal/compiler/analyzer/component_net.go +++ b/internal/compiler/analyzer/component_net.go @@ -10,11 +10,14 @@ import ( ) var ( - ErrStructFieldNotFound = errors.New("Struct field not found") - ErrUnusedOutports = errors.New("All component's outports are unused") - ErrUnusedOutport = errors.New("Unused outport found") - ErrUnusedInports = errors.New("All component inports are unused") - ErrUnusedInport = errors.New("Unused inport found") + ErrStructFieldNotFound = errors.New("Struct field not found") + ErrUnusedOutports = errors.New("All component's outports are unused") + ErrUnusedOutport = errors.New("Unused outport found") + ErrUnusedInports = errors.New("All component inports are unused") + ErrUnusedInport = errors.New("Unused inport found") + ErrLiteralSenderTypeEmpty = errors.New("Literal network sender must contain message value") + ErrLiteralSenderKind = errors.New("Literal network sender must have type of kind instantiation") + ErrLiteralSenderType = errors.New("Literal network sender must have primitive type") ) func (a Analyzer) analyzeComponentNetwork( @@ -49,14 +52,14 @@ func (a Analyzer) analyzeConnections( scope src.Scope, ) *compiler.Error { for _, conn := range net { - if err := a.analyzeNetConn(conn, compInterface, nodes, nodesIfaces, scope, nodesUsage); err != nil { + if err := a.analyzeConnection(conn, compInterface, nodes, nodesIfaces, scope, nodesUsage); err != nil { return err } } return nil } -func (a Analyzer) analyzeNetConn( //nolint:funlen +func (a Analyzer) analyzeConnection( //nolint:funlen conn src.Connection, compInterface src.Interface, nodes map[string]src.Node, @@ -384,14 +387,14 @@ func (a Analyzer) getResolvedPortType( return resolvedOutportType, nil } -func (a Analyzer) getSenderType( +func (a Analyzer) getSenderType( //nolint:funlen senderSide src.ConnectionSenderSide, inports map[string]src.Port, nodes map[string]src.Node, nodesIfaces map[string]src.Interface, scope src.Scope, ) (ts.Expr, *compiler.Error) { - if senderSide.PortAddr == nil && senderSide.ConstRef == nil { + if senderSide.PortAddr == nil && senderSide.Const == nil { return ts.Expr{}, &compiler.Error{ Err: ErrSenderIsEmpty, Location: &scope.Location, @@ -399,15 +402,24 @@ func (a Analyzer) getSenderType( } } - if senderSide.ConstRef != nil { - expr, err := a.getResolvedConstType(*senderSide.ConstRef, scope) - if err != nil { - return ts.Expr{}, compiler.Error{ + if senderSide.Const != nil { + if senderSide.Const.Ref != nil { + expr, err := a.getResolvedConstType(*senderSide.Const.Ref, scope) + if err != nil { + return ts.Expr{}, compiler.Error{ + Location: &scope.Location, + Meta: &senderSide.Const.Ref.Meta, + }.Merge(err) + } + return expr, nil + } + if err := a.validateLiteralSender(senderSide.Const); err != nil { + return ts.Expr{}, &compiler.Error{ + Err: err, Location: &scope.Location, - Meta: &senderSide.ConstRef.Meta, - }.Merge(err) + Meta: &senderSide.Const.Ref.Meta, + } } - return expr, nil } if senderSide.PortAddr.Node == "out" { @@ -442,6 +454,20 @@ func (a Analyzer) getSenderType( return nodeOutportType, nil } +func (a Analyzer) validateLiteralSender(cnst *src.Const) error { + if cnst.Value == nil { + return ErrLiteralSenderTypeEmpty + } + if cnst.Value.TypeExpr.Inst == nil { + return ErrLiteralSenderKind + } + switch cnst.Value.TypeExpr.Inst.Ref.String() { + case "bool", "int", "float", "string": + return nil + } + return ErrLiteralSenderType +} + func (a Analyzer) getNodeOutportType( portAddr src.PortAddr, nodes map[string]src.Node, diff --git a/internal/compiler/analyzer/component_nodes.go b/internal/compiler/analyzer/component_nodes.go index 1183601a..8f51a3f0 100644 --- a/internal/compiler/analyzer/component_nodes.go +++ b/internal/compiler/analyzer/component_nodes.go @@ -60,16 +60,16 @@ func (a Analyzer) analyzeComponentNode(node src.Node, scope src.Scope) (src.Node } } - runtimeMsgArgs, hasRuntimeMsg := node.Directives[compiler.RuntimeFuncMsgDirective] - if hasRuntimeMsg && len(runtimeMsgArgs) != 1 { + bindDirectiveArgs, usesBindDirective := node.Directives[compiler.BindDirective] + if usesBindDirective && len(bindDirectiveArgs) != 1 { return src.Node{}, src.Interface{}, &compiler.Error{ - Err: ErrRuntimeMsgArgs, + Err: ErrBindDirectiveArgs, Location: &location, Meta: entity.Meta(), } } - iface, aerr := a.getResolvedNodeInterface(entity, hasRuntimeMsg, location, node, scope) + iface, aerr := a.getResolvedNodeInterface(entity, usesBindDirective, location, node, scope) if aerr != nil { return src.Node{}, src.Interface{}, aerr } @@ -141,7 +141,7 @@ func (a Analyzer) getResolvedNodeInterface( //nolint:funlen if entity.Kind == src.InterfaceEntity { if hasRuntimeMsg { return src.Interface{}, &compiler.Error{ - Err: ErrInterfaceNodeWithRuntimeMsg, + Err: ErrInterfaceNodeBindDirective, Location: &location, Meta: entity.Meta(), } @@ -158,11 +158,11 @@ func (a Analyzer) getResolvedNodeInterface( //nolint:funlen return entity.Interface, nil } - runtimeFuncArgs, isRuntimeFunc := entity.Component.Directives[compiler.RuntimeFuncDirective] + runtimeFuncArgs, isRuntimeFunc := entity.Component.Directives[compiler.ExternDirective] if hasRuntimeMsg && !isRuntimeFunc { return src.Interface{}, &compiler.Error{ - Err: ErrNormNodeRuntimeMsg, + Err: ErrNormNodeBind, Location: &location, Meta: entity.Meta(), } @@ -170,7 +170,7 @@ func (a Analyzer) getResolvedNodeInterface( //nolint:funlen if len(runtimeFuncArgs) > 1 && len(node.TypeArgs) != 1 { return src.Interface{}, &compiler.Error{ - Err: ErrRuntimeFuncOverloadingNodeArgs, + Err: ErrExternOverloadingNodeArgs, Location: &location, Meta: entity.Meta(), } @@ -178,7 +178,7 @@ func (a Analyzer) getResolvedNodeInterface( //nolint:funlen iface := entity.Component.Interface - _, hasStructInportsDirective := entity.Component.Directives[compiler.StructInports] + _, hasStructInportsDirective := entity.Component.Directives[compiler.AutoportsDirective] if !hasStructInportsDirective { return iface, nil diff --git a/internal/compiler/analyzer/const.go b/internal/compiler/analyzer/const.go index e764de09..2de09100 100644 --- a/internal/compiler/analyzer/const.go +++ b/internal/compiler/analyzer/const.go @@ -16,6 +16,8 @@ var ( ErrConstSeveralValues = errors.New("Constant cannot have several values at once") ) +// TODO validate messages themselves + //nolint:funlen func (a Analyzer) analyzeConst(constant src.Const, scope src.Scope) (src.Const, *compiler.Error) { //nolint:gocyclo,gocognit,lll if constant.Value == nil && constant.Ref == nil { @@ -86,7 +88,7 @@ func (a Analyzer) analyzeConst(constant src.Const, scope src.Scope) (src.Const, Meta: &constant.Meta, } } - case "int", "enum": + case "int": if constant.Value.Bool != nil || constant.Value.Float != nil || constant.Value.Str != nil || @@ -110,7 +112,7 @@ func (a Analyzer) analyzeConst(constant src.Const, scope src.Scope) (src.Const, Meta: &constant.Meta, } } - case "str": + case "string": if constant.Value.Bool != nil || constant.Value.Int != nil || constant.Value.Float != nil || @@ -151,5 +153,6 @@ func (a Analyzer) analyzeConst(constant src.Const, scope src.Scope) (src.Const, return src.Const{ Value: &valueCopy, + Meta: constant.Meta, }, nil } diff --git a/internal/compiler/analyzer/main_component.go b/internal/compiler/analyzer/main_component.go index 2ddfdc5f..34b94c3e 100644 --- a/internal/compiler/analyzer/main_component.go +++ b/internal/compiler/analyzer/main_component.go @@ -51,7 +51,7 @@ func (a Analyzer) analyzeMainComponentIO(io src.IO) *compiler.Error { } } - enterInport, ok := io.In["enter"] + enterInport, ok := io.In["start"] if !ok { return &compiler.Error{Err: ErrMainComponentWithoutEnterInport} } @@ -62,7 +62,7 @@ func (a Analyzer) analyzeMainComponentIO(io src.IO) *compiler.Error { } } - exitOutport, ok := io.Out["exit"] + exitOutport, ok := io.Out["stop"] if !ok { return &compiler.Error{Err: ErrMainComponentWithoutExitOutport} } diff --git a/internal/compiler/contract.go b/internal/compiler/contract.go index 5e6c9775..6ee78731 100644 --- a/internal/compiler/contract.go +++ b/internal/compiler/contract.go @@ -8,9 +8,9 @@ import ( ) const ( - RuntimeFuncDirective src.Directive = "runtime_func" - RuntimeFuncMsgDirective src.Directive = "runtime_func_msg" - StructInports src.Directive = "struct_inports" + ExternDirective src.Directive = "extern" + BindDirective src.Directive = "bind" + AutoportsDirective src.Directive = "autoports" ) type ( @@ -45,4 +45,10 @@ type ( Backend interface { GenerateTarget(*ir.Program) ([]byte, error) } + + STDLib interface { + Emitter() src.Interface + Destructor() src.Interface + Blocker() src.Interface + } ) diff --git a/internal/compiler/desugarer/component.go b/internal/compiler/desugarer/component.go index c45ea0e6..771d1932 100644 --- a/internal/compiler/desugarer/component.go +++ b/internal/compiler/desugarer/component.go @@ -45,7 +45,7 @@ func (d Desugarer) desugarComponent( //nolint:funlen continue } - _, ok := entity.Component.Directives[compiler.StructInports] + _, ok := entity.Component.Directives[compiler.AutoportsDirective] if !ok { desugaredNodes[nodeName] = node continue @@ -152,7 +152,7 @@ func (d Desugarer) handleConns( //nolint:funlen ) } - if conn.SenderSide.ConstRef == nil && + if conn.SenderSide.Const == nil && len(conn.SenderSide.Selectors) == 0 && len(conn.ReceiverSide.ThenConnections) == 0 { desugaredConns = append(desugaredConns, conn) @@ -179,13 +179,23 @@ func (d Desugarer) handleConns( //nolint:funlen desugaredConns = append(desugaredConns, result.connToInsert) } - if conn.SenderSide.ConstRef != nil { - result, err := d.handleConstSender(conn, scope) - if err != nil { - return handleConnsResult{}, err + if conn.SenderSide.Const != nil { //nolint:nestif + if conn.SenderSide.Const.Ref != nil { + result, err := d.handleConstRefSender(conn, scope) + if err != nil { + return handleConnsResult{}, err + } + nodesToInsert[result.emitterNodeName] = result.emitterNode + conn = result.desugaredConn + } else if conn.SenderSide.Const.Value != nil { + result, err := d.handleLiteralSender(conn, scope) + if err != nil { + return handleConnsResult{}, err + } + nodesToInsert[result.emitterNodeName] = result.emitterNode + conn = result.desugaredConn + constsToInsert[result.constName] = *conn.SenderSide.Const } - nodesToInsert[result.constNodeName] = result.constNode - conn = result.desugaredConstConn } desugaredConns = append(desugaredConns, conn) diff --git a/internal/compiler/desugarer/const_sender.go b/internal/compiler/desugarer/const_sender.go index aad9b40b..1d7ae9c5 100644 --- a/internal/compiler/desugarer/const_sender.go +++ b/internal/compiler/desugarer/const_sender.go @@ -2,64 +2,135 @@ package desugarer import ( "fmt" + "sync/atomic" "github.com/nevalang/neva/internal/compiler" src "github.com/nevalang/neva/pkg/sourcecode" ts "github.com/nevalang/neva/pkg/typesystem" ) -var constComponentRef = src.EntityRef{ +var emitterComponentRef = src.EntityRef{ Pkg: "builtin", - Name: "Const", + Name: "Emitter", } -type handleConstSenderResult struct { - desugaredConstConn src.Connection - constNodeName string - constNode src.Node +type handleLiteralSenderResult struct { + handleConstRefSenderResult // conceptually incorrrect but convenient to reuse + // constant src.Const + constName string } -func (d Desugarer) handleConstSender(conn src.Connection, scope src.Scope) (handleConstSenderResult, *compiler.Error) { - constTypeExpr, err := d.getConstType(*conn.SenderSide.ConstRef, scope) +type handleConstRefSenderResult struct { + desugaredConn src.Connection + emitterNodeName string + emitterNode src.Node +} + +// In the future compiler can operate in concurrently +var litSendersCount atomic.Uint32 + +func (d Desugarer) handleLiteralSender( + conn src.Connection, + scope src.Scope, +) ( + handleLiteralSenderResult, + *compiler.Error, +) { + counter := litSendersCount.Load() + litSendersCount.Store(counter + 1) + constName := fmt.Sprintf("literal-%d", counter) + + // we can't call d.handleConstRefSender() + // because our virtual const isn't in the scope + + emitterNodeName := "$" + constName + emitterNode := src.Node{ + Directives: map[src.Directive][]string{ + compiler.BindDirective: {constName}, + }, + EntityRef: emitterComponentRef, + TypeArgs: []ts.Expr{ + conn. + SenderSide. + Const. + Value. + TypeExpr, + }, + } + emitterNodeOutportAddr := src.PortAddr{ + Node: emitterNodeName, + Port: "msg", + } + + return handleLiteralSenderResult{ + constName: constName, + handleConstRefSenderResult: handleConstRefSenderResult{ + desugaredConn: src.Connection{ + SenderSide: src.ConnectionSenderSide{ + PortAddr: &emitterNodeOutportAddr, + Selectors: conn.SenderSide.Selectors, + Meta: conn.SenderSide.Meta, + }, + ReceiverSide: conn.ReceiverSide, + Meta: conn.Meta, + }, + emitterNodeName: emitterNodeName, + emitterNode: emitterNode, + }, + }, nil +} + +func (d Desugarer) handleConstRefSender( + conn src.Connection, + scope src.Scope, +) ( + handleConstRefSenderResult, + *compiler.Error, +) { + constTypeExpr, err := d.getConstTypeByRef(*conn.SenderSide.Const.Ref, scope) if err != nil { - return handleConstSenderResult{}, compiler.Error{ - Err: fmt.Errorf("Unable to get constant type by reference '%v'", *conn.SenderSide.ConstRef), + return handleConstRefSenderResult{}, compiler.Error{ + Err: fmt.Errorf( + "Unable to get constant type by reference '%v'", + *conn.SenderSide.Const.Ref, + ), Location: &scope.Location, - Meta: &conn.SenderSide.ConstRef.Meta, + Meta: &conn.SenderSide.Const.Ref.Meta, }.Merge(err) } - constRefStr := conn.SenderSide.ConstRef.String() - constNodeName := fmt.Sprintf("__%v__", constRefStr) - constNode := src.Node{ + constRefStr := conn.SenderSide.Const.Ref.String() + + emitterNodeName := "$" + constRefStr + emitterNode := src.Node{ Directives: map[src.Directive][]string{ - compiler.RuntimeFuncMsgDirective: {constRefStr}, + compiler.BindDirective: {constRefStr}, }, - EntityRef: constComponentRef, + EntityRef: emitterComponentRef, TypeArgs: []ts.Expr{constTypeExpr}, } - constNodeOutportAddr := src.PortAddr{ - Node: constNodeName, - Port: "v", + emitterNodeOutportAddr := src.PortAddr{ + Node: emitterNodeName, + Port: "msg", } - return handleConstSenderResult{ - desugaredConstConn: src.Connection{ + return handleConstRefSenderResult{ + desugaredConn: src.Connection{ SenderSide: src.ConnectionSenderSide{ - PortAddr: &constNodeOutportAddr, + PortAddr: &emitterNodeOutportAddr, Selectors: conn.SenderSide.Selectors, Meta: conn.SenderSide.Meta, }, ReceiverSide: conn.ReceiverSide, Meta: conn.Meta, }, - constNodeName: constNodeName, - constNode: constNode, + emitterNodeName: emitterNodeName, + emitterNode: emitterNode, }, nil } -// getConstType is needed to figure out type parameters for Const node -func (d Desugarer) getConstType(ref src.EntityRef, scope src.Scope) (ts.Expr, *compiler.Error) { +// getConstTypeByRef is needed to figure out type parameters for Const node +func (d Desugarer) getConstTypeByRef(ref src.EntityRef, scope src.Scope) (ts.Expr, *compiler.Error) { entity, _, err := scope.Entity(ref) if err != nil { return ts.Expr{}, &compiler.Error{ @@ -78,7 +149,7 @@ func (d Desugarer) getConstType(ref src.EntityRef, scope src.Scope) (ts.Expr, *c } if entity.Const.Ref != nil { - expr, err := d.getConstType(*entity.Const.Ref, scope) + expr, err := d.getConstTypeByRef(*entity.Const.Ref, scope) if err != nil { return ts.Expr{}, compiler.Error{ Location: &scope.Location, diff --git a/internal/compiler/desugarer/void.go b/internal/compiler/desugarer/destructor.go similarity index 94% rename from internal/compiler/desugarer/void.go rename to internal/compiler/desugarer/destructor.go index afd504d5..ff2f7f5c 100644 --- a/internal/compiler/desugarer/void.go +++ b/internal/compiler/desugarer/destructor.go @@ -9,14 +9,14 @@ type voidResult struct { } func (Desugarer) getVoidNodeAndConns(unusedOutports nodePortsMap) voidResult { - voidNodeName := "__void__" + destructorNodeName := "__destructor__" result := voidResult{ - voidNodeName: voidNodeName, + voidNodeName: destructorNodeName, voidNode: src.Node{ EntityRef: src.EntityRef{ Pkg: "builtin", - Name: "Void", + Name: "Destructor", }, }, voidConns: make([]src.Connection, 0, len(unusedOutports.m)), @@ -25,8 +25,8 @@ func (Desugarer) getVoidNodeAndConns(unusedOutports nodePortsMap) voidResult { receiverSides := []src.ConnectionReceiver{ { PortAddr: src.PortAddr{ - Node: voidNodeName, - Port: "v", + Node: destructorNodeName, + Port: "msg", }, }, } diff --git a/internal/compiler/desugarer/desugarer_test.go b/internal/compiler/desugarer/desugarer_test.go index 4b6d5708..0fb57e87 100644 --- a/internal/compiler/desugarer/desugarer_test.go +++ b/internal/compiler/desugarer/desugarer_test.go @@ -31,7 +31,7 @@ func TestDesugarer_Desugar(t *testing.T) { "bar": { // const must be present so desugarer can figure out type args for Const node Kind: src.ConstEntity, Const: src.Const{ - Value: &src.Msg{ + Value: &src.Message{ TypeExpr: typesystem.Expr{ Inst: &typesystem.InstExpr{Ref: src.EntityRef{Name: "int"}}, }, @@ -45,7 +45,9 @@ func TestDesugarer_Desugar(t *testing.T) { Net: []src.Connection{ { SenderSide: src.ConnectionSenderSide{ - ConstRef: &src.EntityRef{Name: "bar"}, + Const: &src.Const{ + Ref: &src.EntityRef{Name: "bar"}, + }, }, }, }, @@ -83,7 +85,7 @@ func TestDesugarer_Desugar(t *testing.T) { "bar": { Kind: src.ConstEntity, Const: src.Const{ - Value: &src.Msg{ + Value: &src.Message{ TypeExpr: typesystem.Expr{ Inst: &typesystem.InstExpr{Ref: src.EntityRef{Name: "int"}}, }, @@ -97,11 +99,11 @@ func TestDesugarer_Desugar(t *testing.T) { Nodes: map[string]src.Node{ "__bar__": { // <-- const node added Directives: map[src.Directive][]string{ - "runtime_func_msg": {"bar"}, + "bind": {"bar"}, }, EntityRef: src.EntityRef{ Pkg: "builtin", - Name: "Const", + Name: "Emitter", }, TypeArgs: []typesystem.Expr{ { @@ -196,9 +198,9 @@ func TestDesugarer_Desugar(t *testing.T) { Component: src.Component{ Nodes: map[string]src.Node{ "bar": {EntityRef: src.EntityRef{Name: "Bar"}}, // that one node - "__void__": { // <-- new node + "__destructor__": { // <-- new node EntityRef: src.EntityRef{ - Name: "Void", + Name: "Destructor", Pkg: "builtin", }, }, @@ -215,7 +217,7 @@ func TestDesugarer_Desugar(t *testing.T) { Receivers: []src.ConnectionReceiver{ { PortAddr: src.PortAddr{ - Node: "__void__", + Node: "__destructor__", Port: "v", }, }, diff --git a/internal/compiler/desugarer/struct_selectors.go b/internal/compiler/desugarer/struct_selectors.go index 55096887..eaaba4f1 100644 --- a/internal/compiler/desugarer/struct_selectors.go +++ b/internal/compiler/desugarer/struct_selectors.go @@ -67,7 +67,7 @@ func (d Desugarer) desugarStructSelectors( //nolint:funlen selectorNode := src.Node{ Directives: map[src.Directive][]string{ // pass selectors down to component through the constant via directive - compiler.RuntimeFuncMsgDirective: {constName}, + compiler.BindDirective: {constName}, }, EntityRef: selectorNodeRef, TypeArgs: src.TypeArgs{lastFIeldType}, // specify selector node's outport type (equal to the last selector) @@ -78,7 +78,9 @@ func (d Desugarer) desugarStructSelectors( //nolint:funlen SenderSide: src.ConnectionSenderSide{ // preserve original sender port PortAddr: senderSide.PortAddr, - ConstRef: senderSide.ConstRef, + Const: &src.Const{ + Ref: senderSide.Const.Ref, + }, // remove selectors in desugared version Selectors: nil, }, @@ -145,7 +147,7 @@ func (d Desugarer) getStructFieldType(structType ts.Expr, selectors []string) (t var ( strTypeExpr = ts.Expr{ Inst: &ts.InstExpr{ - Ref: src.EntityRef{Pkg: "builtin", Name: "str"}, + Ref: src.EntityRef{Pkg: "builtin", Name: "string"}, }, } @@ -164,14 +166,14 @@ var ( func (Desugarer) createPathConst(senderSide src.ConnectionSenderSide) src.Const { constToInsert := src.Const{ - Value: &src.Msg{ + Value: &src.Message{ TypeExpr: pathConstTypeExpr, List: make([]src.Const, 0, len(senderSide.Selectors)), }, } for _, selector := range senderSide.Selectors { constToInsert.Value.List = append(constToInsert.Value.List, src.Const{ - Value: &src.Msg{ + Value: &src.Message{ TypeExpr: strTypeExpr, Str: compiler.Pointer(selector), }, @@ -186,9 +188,9 @@ func (d Desugarer) getSenderType( nodes map[string]src.Node, ) (ts.Expr, *compiler.Error) { var selectorNodeTypeArg ts.Expr - if senderSide.ConstRef != nil { + if senderSide.Const.Ref != nil { var err *compiler.Error - selectorNodeTypeArg, err = d.getConstType(*senderSide.ConstRef, scope) + selectorNodeTypeArg, err = d.getConstTypeByRef(*senderSide.Const.Ref, scope) if err != nil { return ts.Expr{}, err } diff --git a/internal/compiler/desugarer/then_connections.go b/internal/compiler/desugarer/then_connections.go index feba443d..af2f3f61 100644 --- a/internal/compiler/desugarer/then_connections.go +++ b/internal/compiler/desugarer/then_connections.go @@ -11,10 +11,10 @@ import ( ts "github.com/nevalang/neva/pkg/typesystem" ) -var lockNode = src.Node{ +var blockerNode = src.Node{ EntityRef: src.EntityRef{ Pkg: "builtin", - Name: "Lock", + Name: "Blocker", }, TypeArgs: []typesystem.Expr{ ts.Expr{ @@ -53,7 +53,7 @@ func (d Desugarer) handleThenConns( //nolint:funlen desugaredThenConn.SenderSide.String(), ) - extraNodes[lockNodeName] = lockNode + extraNodes[lockNodeName] = blockerNode extraConns = append( extraConns, diff --git a/internal/compiler/irgen/irgen.go b/internal/compiler/irgen/irgen.go index 339df919..4ed71c5d 100644 --- a/internal/compiler/irgen/irgen.go +++ b/internal/compiler/irgen/irgen.go @@ -26,7 +26,7 @@ type ( portsUsage struct { in map[relPortAddr]struct{} out map[relPortAddr]struct{} - constValue *src.Msg // const value found by ref from net goes here and then to nodeContext + constValue *src.Message // const value found by ref from net goes here and then to nodeContext } relPortAddr struct { @@ -61,10 +61,10 @@ func (g Generator) Generate(ctx context.Context, build src.Build, mainPkgName st }, portsUsage: portsUsage{ in: map[relPortAddr]struct{}{ - {Port: "enter"}: {}, + {Port: "start"}: {}, }, out: map[relPortAddr]struct{}{ - {Port: "exit"}: {}, + {Port: "stop"}: {}, }, }, } diff --git a/internal/compiler/irgen/runtime_func.go b/internal/compiler/irgen/runtime_func.go index 004b1fae..67598e87 100644 --- a/internal/compiler/irgen/runtime_func.go +++ b/internal/compiler/irgen/runtime_func.go @@ -11,7 +11,7 @@ import ( ) func getRuntimeFunc(component src.Component, nodeTypeArgs []ts.Expr) (string, error) { - args, ok := component.Directives[compiler.RuntimeFuncDirective] + args, ok := component.Directives[compiler.ExternDirective] if !ok { return "", nil } @@ -32,7 +32,7 @@ func getRuntimeFunc(component src.Component, nodeTypeArgs []ts.Expr) (string, er } func getRuntimeFuncMsg(node src.Node, scope src.Scope) (*ir.Msg, *compiler.Error) { - args, ok := node.Directives[compiler.RuntimeFuncMsgDirective] + args, ok := node.Directives[compiler.BindDirective] if !ok { return nil, nil } diff --git a/internal/compiler/parser/generated/neva.interp b/internal/compiler/parser/generated/neva.interp index 01d733d2..d8d05e20 100644 --- a/internal/compiler/parser/generated/neva.interp +++ b/internal/compiler/parser/generated/neva.interp @@ -10,21 +10,22 @@ null '/' '@' '.' -'types' +'type' '<' '>' 'enum' -'[' -']' 'struct' '|' -'interfaces' +'interface' 'const' +'=' 'true' 'false' 'nil' +'[' +']' ':' -'components' +'component' 'nodes' 'net' '->' @@ -69,6 +70,7 @@ null null null null +null COMMENT PUB_KW IDENTIFIER @@ -97,6 +99,8 @@ importedEntityRef pkgRef entityName typeStmt +singleTypeStmt +groupTypeStmt typeDef typeParams typeParamList @@ -106,29 +110,34 @@ typeInstExpr typeArgs typeLitExpr enumTypeExpr -arrTypeExpr structTypeExpr structFields structField unionTypeExpr nonUnionTypeExpr interfaceStmt +singleInterfaceStmt +groupInterfaceStmt interfaceDef inPortsDef outPortsDef portsDef portDef constStmt +singleConstStmt +groupConstStmt constDef constVal bool nil -arrLit +listLit listItems structLit structValueFields structValueField compStmt +singleCompStmt +groupCompStmt compDef compBody compNodesDef @@ -152,4 +161,4 @@ multipleReceiverSide atn: -[4, 1, 37, 926, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 1, 0, 1, 0, 1, 0, 5, 0, 144, 8, 0, 10, 0, 12, 0, 147, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 156, 8, 1, 1, 2, 1, 2, 1, 2, 4, 2, 161, 8, 2, 11, 2, 12, 2, 162, 1, 3, 1, 3, 1, 3, 3, 3, 168, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 174, 8, 4, 10, 4, 12, 4, 177, 9, 4, 1, 4, 1, 4, 1, 5, 4, 5, 182, 8, 5, 11, 5, 12, 5, 183, 1, 6, 1, 6, 5, 6, 188, 8, 6, 10, 6, 12, 6, 191, 9, 6, 1, 6, 1, 6, 5, 6, 195, 8, 6, 10, 6, 12, 6, 198, 9, 6, 1, 6, 5, 6, 201, 8, 6, 10, 6, 12, 6, 204, 9, 6, 1, 6, 1, 6, 1, 7, 3, 7, 209, 8, 7, 1, 7, 1, 7, 5, 7, 213, 8, 7, 10, 7, 12, 7, 216, 9, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 5, 11, 229, 8, 11, 10, 11, 12, 11, 232, 9, 11, 1, 12, 1, 12, 3, 12, 236, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 243, 8, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 5, 17, 251, 8, 17, 10, 17, 12, 17, 254, 9, 17, 1, 17, 1, 17, 5, 17, 258, 8, 17, 10, 17, 12, 17, 261, 9, 17, 1, 17, 1, 17, 5, 17, 265, 8, 17, 10, 17, 12, 17, 268, 9, 17, 5, 17, 270, 8, 17, 10, 17, 12, 17, 273, 9, 17, 1, 17, 1, 17, 1, 18, 3, 18, 278, 8, 18, 1, 18, 1, 18, 3, 18, 282, 8, 18, 1, 18, 3, 18, 285, 8, 18, 1, 19, 1, 19, 5, 19, 289, 8, 19, 10, 19, 12, 19, 292, 9, 19, 1, 19, 3, 19, 295, 8, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 302, 8, 20, 10, 20, 12, 20, 305, 9, 20, 1, 20, 1, 20, 5, 20, 309, 8, 20, 10, 20, 12, 20, 312, 9, 20, 5, 20, 314, 8, 20, 10, 20, 12, 20, 317, 9, 20, 1, 21, 1, 21, 3, 21, 321, 8, 21, 1, 22, 1, 22, 1, 22, 3, 22, 326, 8, 22, 1, 23, 1, 23, 3, 23, 330, 8, 23, 1, 24, 1, 24, 5, 24, 334, 8, 24, 10, 24, 12, 24, 337, 9, 24, 1, 24, 1, 24, 1, 24, 5, 24, 342, 8, 24, 10, 24, 12, 24, 345, 9, 24, 1, 24, 5, 24, 348, 8, 24, 10, 24, 12, 24, 351, 9, 24, 1, 24, 5, 24, 354, 8, 24, 10, 24, 12, 24, 357, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 3, 25, 364, 8, 25, 1, 26, 1, 26, 5, 26, 368, 8, 26, 10, 26, 12, 26, 371, 9, 26, 1, 26, 1, 26, 5, 26, 375, 8, 26, 10, 26, 12, 26, 378, 9, 26, 1, 26, 1, 26, 1, 26, 5, 26, 383, 8, 26, 10, 26, 12, 26, 386, 9, 26, 1, 26, 5, 26, 389, 8, 26, 10, 26, 12, 26, 392, 9, 26, 1, 26, 5, 26, 395, 8, 26, 10, 26, 12, 26, 398, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 5, 27, 404, 8, 27, 10, 27, 12, 27, 407, 9, 27, 1, 27, 1, 27, 5, 27, 411, 8, 27, 10, 27, 12, 27, 414, 9, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 5, 28, 421, 8, 28, 10, 28, 12, 28, 424, 9, 28, 1, 28, 1, 28, 5, 28, 428, 8, 28, 10, 28, 12, 28, 431, 9, 28, 1, 28, 3, 28, 434, 8, 28, 1, 28, 1, 28, 1, 29, 1, 29, 4, 29, 440, 8, 29, 11, 29, 12, 29, 441, 1, 29, 5, 29, 445, 8, 29, 10, 29, 12, 29, 448, 9, 29, 1, 30, 1, 30, 1, 30, 5, 30, 453, 8, 30, 10, 30, 12, 30, 456, 9, 30, 1, 31, 1, 31, 5, 31, 460, 8, 31, 10, 31, 12, 31, 463, 9, 31, 1, 31, 1, 31, 5, 31, 467, 8, 31, 10, 31, 12, 31, 470, 9, 31, 1, 31, 4, 31, 473, 8, 31, 11, 31, 12, 31, 474, 1, 32, 1, 32, 3, 32, 479, 8, 32, 1, 33, 1, 33, 5, 33, 483, 8, 33, 10, 33, 12, 33, 486, 9, 33, 1, 33, 1, 33, 5, 33, 490, 8, 33, 10, 33, 12, 33, 493, 9, 33, 1, 33, 5, 33, 496, 8, 33, 10, 33, 12, 33, 499, 9, 33, 1, 33, 1, 33, 1, 34, 3, 34, 504, 8, 34, 1, 34, 1, 34, 3, 34, 508, 8, 34, 1, 34, 1, 34, 1, 34, 5, 34, 513, 8, 34, 10, 34, 12, 34, 516, 9, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 5, 37, 524, 8, 37, 10, 37, 12, 37, 527, 9, 37, 1, 37, 3, 37, 530, 8, 37, 1, 37, 1, 37, 1, 37, 5, 37, 535, 8, 37, 10, 37, 12, 37, 538, 9, 37, 3, 37, 540, 8, 37, 1, 37, 1, 37, 1, 38, 5, 38, 545, 8, 38, 10, 38, 12, 38, 548, 9, 38, 1, 38, 1, 38, 1, 38, 5, 38, 553, 8, 38, 10, 38, 12, 38, 556, 9, 38, 1, 39, 1, 39, 5, 39, 560, 8, 39, 10, 39, 12, 39, 563, 9, 39, 1, 39, 1, 39, 5, 39, 567, 8, 39, 10, 39, 12, 39, 570, 9, 39, 1, 39, 5, 39, 573, 8, 39, 10, 39, 12, 39, 576, 9, 39, 1, 39, 1, 39, 1, 40, 3, 40, 581, 8, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 587, 8, 40, 10, 40, 12, 40, 590, 9, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 3, 41, 599, 8, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 5, 44, 607, 8, 44, 10, 44, 12, 44, 610, 9, 44, 1, 44, 3, 44, 613, 8, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 5, 45, 621, 8, 45, 10, 45, 12, 45, 624, 9, 45, 1, 45, 1, 45, 5, 45, 628, 8, 45, 10, 45, 12, 45, 631, 9, 45, 5, 45, 633, 8, 45, 10, 45, 12, 45, 636, 9, 45, 3, 45, 638, 8, 45, 1, 46, 1, 46, 5, 46, 642, 8, 46, 10, 46, 12, 46, 645, 9, 46, 1, 46, 3, 46, 648, 8, 46, 1, 46, 1, 46, 1, 47, 1, 47, 5, 47, 654, 8, 47, 10, 47, 12, 47, 657, 9, 47, 1, 47, 5, 47, 660, 8, 47, 10, 47, 12, 47, 663, 9, 47, 1, 48, 1, 48, 1, 48, 1, 48, 5, 48, 669, 8, 48, 10, 48, 12, 48, 672, 9, 48, 1, 49, 1, 49, 5, 49, 676, 8, 49, 10, 49, 12, 49, 679, 9, 49, 1, 49, 1, 49, 5, 49, 683, 8, 49, 10, 49, 12, 49, 686, 9, 49, 1, 49, 5, 49, 689, 8, 49, 10, 49, 12, 49, 692, 9, 49, 1, 49, 1, 49, 1, 50, 3, 50, 697, 8, 50, 1, 50, 1, 50, 3, 50, 701, 8, 50, 1, 50, 5, 50, 704, 8, 50, 10, 50, 12, 50, 707, 9, 50, 1, 51, 1, 51, 5, 51, 711, 8, 51, 10, 51, 12, 51, 714, 9, 51, 1, 51, 1, 51, 5, 51, 718, 8, 51, 10, 51, 12, 51, 721, 9, 51, 3, 51, 723, 8, 51, 1, 51, 1, 51, 5, 51, 727, 8, 51, 10, 51, 12, 51, 730, 9, 51, 3, 51, 732, 8, 51, 1, 51, 1, 51, 1, 52, 1, 52, 5, 52, 738, 8, 52, 10, 52, 12, 52, 741, 9, 52, 1, 52, 1, 52, 1, 53, 1, 53, 5, 53, 747, 8, 53, 10, 53, 12, 53, 750, 9, 53, 1, 53, 1, 53, 5, 53, 754, 8, 53, 10, 53, 12, 53, 757, 9, 53, 5, 53, 759, 8, 53, 10, 53, 12, 53, 762, 9, 53, 1, 53, 1, 53, 1, 54, 3, 54, 767, 8, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 5, 55, 774, 8, 55, 10, 55, 12, 55, 777, 9, 55, 1, 55, 3, 55, 780, 8, 55, 1, 55, 5, 55, 783, 8, 55, 10, 55, 12, 55, 786, 9, 55, 1, 55, 3, 55, 789, 8, 55, 1, 56, 1, 56, 1, 57, 1, 57, 5, 57, 795, 8, 57, 10, 57, 12, 57, 798, 9, 57, 1, 57, 1, 57, 5, 57, 802, 8, 57, 10, 57, 12, 57, 805, 9, 57, 1, 57, 3, 57, 808, 8, 57, 1, 57, 5, 57, 811, 8, 57, 10, 57, 12, 57, 814, 9, 57, 1, 57, 1, 57, 1, 58, 1, 58, 5, 58, 820, 8, 58, 10, 58, 12, 58, 823, 9, 58, 1, 58, 5, 58, 826, 8, 58, 10, 58, 12, 58, 829, 9, 58, 1, 59, 1, 59, 1, 59, 1, 59, 3, 59, 835, 8, 59, 1, 60, 1, 60, 3, 60, 839, 8, 60, 1, 60, 3, 60, 842, 8, 60, 1, 61, 1, 61, 3, 61, 846, 8, 61, 1, 62, 1, 62, 5, 62, 850, 8, 62, 10, 62, 12, 62, 853, 9, 62, 1, 62, 1, 62, 1, 62, 5, 62, 858, 8, 62, 10, 62, 12, 62, 861, 9, 62, 1, 62, 5, 62, 864, 8, 62, 10, 62, 12, 62, 867, 9, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 878, 8, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 5, 68, 892, 8, 68, 10, 68, 12, 68, 895, 9, 68, 1, 69, 1, 69, 5, 69, 899, 8, 69, 10, 69, 12, 69, 902, 9, 69, 1, 69, 1, 69, 1, 69, 5, 69, 907, 8, 69, 10, 69, 12, 69, 910, 9, 69, 1, 69, 1, 69, 5, 69, 914, 8, 69, 10, 69, 12, 69, 917, 9, 69, 5, 69, 919, 8, 69, 10, 69, 12, 69, 922, 9, 69, 1, 69, 1, 69, 1, 69, 0, 0, 70, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 0, 2, 2, 0, 9, 9, 32, 32, 1, 0, 21, 22, 987, 0, 145, 1, 0, 0, 0, 2, 155, 1, 0, 0, 0, 4, 160, 1, 0, 0, 0, 6, 164, 1, 0, 0, 0, 8, 169, 1, 0, 0, 0, 10, 181, 1, 0, 0, 0, 12, 185, 1, 0, 0, 0, 14, 208, 1, 0, 0, 0, 16, 217, 1, 0, 0, 0, 18, 219, 1, 0, 0, 0, 20, 223, 1, 0, 0, 0, 22, 225, 1, 0, 0, 0, 24, 235, 1, 0, 0, 0, 26, 237, 1, 0, 0, 0, 28, 239, 1, 0, 0, 0, 30, 244, 1, 0, 0, 0, 32, 246, 1, 0, 0, 0, 34, 248, 1, 0, 0, 0, 36, 277, 1, 0, 0, 0, 38, 286, 1, 0, 0, 0, 40, 298, 1, 0, 0, 0, 42, 318, 1, 0, 0, 0, 44, 325, 1, 0, 0, 0, 46, 327, 1, 0, 0, 0, 48, 331, 1, 0, 0, 0, 50, 363, 1, 0, 0, 0, 52, 365, 1, 0, 0, 0, 54, 401, 1, 0, 0, 0, 56, 418, 1, 0, 0, 0, 58, 437, 1, 0, 0, 0, 60, 449, 1, 0, 0, 0, 62, 457, 1, 0, 0, 0, 64, 478, 1, 0, 0, 0, 66, 480, 1, 0, 0, 0, 68, 503, 1, 0, 0, 0, 70, 517, 1, 0, 0, 0, 72, 519, 1, 0, 0, 0, 74, 521, 1, 0, 0, 0, 76, 546, 1, 0, 0, 0, 78, 557, 1, 0, 0, 0, 80, 580, 1, 0, 0, 0, 82, 598, 1, 0, 0, 0, 84, 600, 1, 0, 0, 0, 86, 602, 1, 0, 0, 0, 88, 604, 1, 0, 0, 0, 90, 637, 1, 0, 0, 0, 92, 639, 1, 0, 0, 0, 94, 651, 1, 0, 0, 0, 96, 664, 1, 0, 0, 0, 98, 673, 1, 0, 0, 0, 100, 696, 1, 0, 0, 0, 102, 708, 1, 0, 0, 0, 104, 735, 1, 0, 0, 0, 106, 744, 1, 0, 0, 0, 108, 766, 1, 0, 0, 0, 110, 771, 1, 0, 0, 0, 112, 790, 1, 0, 0, 0, 114, 792, 1, 0, 0, 0, 116, 817, 1, 0, 0, 0, 118, 830, 1, 0, 0, 0, 120, 838, 1, 0, 0, 0, 122, 845, 1, 0, 0, 0, 124, 847, 1, 0, 0, 0, 126, 870, 1, 0, 0, 0, 128, 873, 1, 0, 0, 0, 130, 879, 1, 0, 0, 0, 132, 881, 1, 0, 0, 0, 134, 883, 1, 0, 0, 0, 136, 887, 1, 0, 0, 0, 138, 896, 1, 0, 0, 0, 140, 144, 5, 36, 0, 0, 141, 144, 5, 30, 0, 0, 142, 144, 3, 2, 1, 0, 143, 140, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 142, 1, 0, 0, 0, 144, 147, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 148, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 148, 149, 5, 0, 0, 1, 149, 1, 1, 0, 0, 0, 150, 156, 3, 12, 6, 0, 151, 156, 3, 34, 17, 0, 152, 156, 3, 66, 33, 0, 153, 156, 3, 78, 39, 0, 154, 156, 3, 98, 49, 0, 155, 150, 1, 0, 0, 0, 155, 151, 1, 0, 0, 0, 155, 152, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, 3, 1, 0, 0, 0, 157, 158, 3, 6, 3, 0, 158, 159, 5, 36, 0, 0, 159, 161, 1, 0, 0, 0, 160, 157, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 5, 1, 0, 0, 0, 164, 165, 5, 1, 0, 0, 165, 167, 5, 32, 0, 0, 166, 168, 3, 8, 4, 0, 167, 166, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 7, 1, 0, 0, 0, 169, 170, 5, 2, 0, 0, 170, 175, 3, 10, 5, 0, 171, 172, 5, 3, 0, 0, 172, 174, 3, 10, 5, 0, 173, 171, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 4, 0, 0, 179, 9, 1, 0, 0, 0, 180, 182, 5, 32, 0, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 11, 1, 0, 0, 0, 185, 189, 5, 5, 0, 0, 186, 188, 5, 36, 0, 0, 187, 186, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 192, 196, 5, 6, 0, 0, 193, 195, 5, 36, 0, 0, 194, 193, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 202, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 199, 201, 3, 14, 7, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 5, 7, 0, 0, 206, 13, 1, 0, 0, 0, 207, 209, 3, 16, 8, 0, 208, 207, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 214, 3, 18, 9, 0, 211, 213, 5, 36, 0, 0, 212, 211, 1, 0, 0, 0, 213, 216, 1, 0, 0, 0, 214, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 15, 1, 0, 0, 0, 216, 214, 1, 0, 0, 0, 217, 218, 5, 32, 0, 0, 218, 17, 1, 0, 0, 0, 219, 220, 3, 20, 10, 0, 220, 221, 5, 8, 0, 0, 221, 222, 3, 22, 11, 0, 222, 19, 1, 0, 0, 0, 223, 224, 7, 0, 0, 0, 224, 21, 1, 0, 0, 0, 225, 230, 5, 32, 0, 0, 226, 227, 5, 8, 0, 0, 227, 229, 5, 32, 0, 0, 228, 226, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 23, 1, 0, 0, 0, 232, 230, 1, 0, 0, 0, 233, 236, 3, 26, 13, 0, 234, 236, 3, 28, 14, 0, 235, 233, 1, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 25, 1, 0, 0, 0, 237, 238, 5, 32, 0, 0, 238, 27, 1, 0, 0, 0, 239, 242, 3, 30, 15, 0, 240, 241, 5, 10, 0, 0, 241, 243, 3, 32, 16, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 29, 1, 0, 0, 0, 244, 245, 5, 32, 0, 0, 245, 31, 1, 0, 0, 0, 246, 247, 5, 32, 0, 0, 247, 33, 1, 0, 0, 0, 248, 252, 5, 11, 0, 0, 249, 251, 5, 36, 0, 0, 250, 249, 1, 0, 0, 0, 251, 254, 1, 0, 0, 0, 252, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 255, 1, 0, 0, 0, 254, 252, 1, 0, 0, 0, 255, 259, 5, 6, 0, 0, 256, 258, 5, 36, 0, 0, 257, 256, 1, 0, 0, 0, 258, 261, 1, 0, 0, 0, 259, 257, 1, 0, 0, 0, 259, 260, 1, 0, 0, 0, 260, 271, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 262, 266, 3, 36, 18, 0, 263, 265, 5, 36, 0, 0, 264, 263, 1, 0, 0, 0, 265, 268, 1, 0, 0, 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, 266, 1, 0, 0, 0, 269, 262, 1, 0, 0, 0, 270, 273, 1, 0, 0, 0, 271, 269, 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 274, 1, 0, 0, 0, 273, 271, 1, 0, 0, 0, 274, 275, 5, 7, 0, 0, 275, 35, 1, 0, 0, 0, 276, 278, 5, 31, 0, 0, 277, 276, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, 281, 5, 32, 0, 0, 280, 282, 3, 38, 19, 0, 281, 280, 1, 0, 0, 0, 281, 282, 1, 0, 0, 0, 282, 284, 1, 0, 0, 0, 283, 285, 3, 44, 22, 0, 284, 283, 1, 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 37, 1, 0, 0, 0, 286, 290, 5, 12, 0, 0, 287, 289, 5, 36, 0, 0, 288, 287, 1, 0, 0, 0, 289, 292, 1, 0, 0, 0, 290, 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 294, 1, 0, 0, 0, 292, 290, 1, 0, 0, 0, 293, 295, 3, 40, 20, 0, 294, 293, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 5, 13, 0, 0, 297, 39, 1, 0, 0, 0, 298, 315, 3, 42, 21, 0, 299, 303, 5, 3, 0, 0, 300, 302, 5, 36, 0, 0, 301, 300, 1, 0, 0, 0, 302, 305, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, 304, 1, 0, 0, 0, 304, 306, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 306, 310, 3, 42, 21, 0, 307, 309, 5, 36, 0, 0, 308, 307, 1, 0, 0, 0, 309, 312, 1, 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 310, 1, 0, 0, 0, 313, 299, 1, 0, 0, 0, 314, 317, 1, 0, 0, 0, 315, 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 41, 1, 0, 0, 0, 317, 315, 1, 0, 0, 0, 318, 320, 5, 32, 0, 0, 319, 321, 3, 44, 22, 0, 320, 319, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 43, 1, 0, 0, 0, 322, 326, 3, 46, 23, 0, 323, 326, 3, 50, 25, 0, 324, 326, 3, 62, 31, 0, 325, 322, 1, 0, 0, 0, 325, 323, 1, 0, 0, 0, 325, 324, 1, 0, 0, 0, 326, 45, 1, 0, 0, 0, 327, 329, 3, 24, 12, 0, 328, 330, 3, 48, 24, 0, 329, 328, 1, 0, 0, 0, 329, 330, 1, 0, 0, 0, 330, 47, 1, 0, 0, 0, 331, 335, 5, 12, 0, 0, 332, 334, 5, 36, 0, 0, 333, 332, 1, 0, 0, 0, 334, 337, 1, 0, 0, 0, 335, 333, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 338, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 338, 349, 3, 44, 22, 0, 339, 343, 5, 3, 0, 0, 340, 342, 5, 36, 0, 0, 341, 340, 1, 0, 0, 0, 342, 345, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, 0, 344, 346, 1, 0, 0, 0, 345, 343, 1, 0, 0, 0, 346, 348, 3, 44, 22, 0, 347, 339, 1, 0, 0, 0, 348, 351, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 350, 1, 0, 0, 0, 350, 355, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 352, 354, 5, 36, 0, 0, 353, 352, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 353, 1, 0, 0, 0, 355, 356, 1, 0, 0, 0, 356, 358, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, 358, 359, 5, 13, 0, 0, 359, 49, 1, 0, 0, 0, 360, 364, 3, 52, 26, 0, 361, 364, 3, 54, 27, 0, 362, 364, 3, 56, 28, 0, 363, 360, 1, 0, 0, 0, 363, 361, 1, 0, 0, 0, 363, 362, 1, 0, 0, 0, 364, 51, 1, 0, 0, 0, 365, 369, 5, 14, 0, 0, 366, 368, 5, 36, 0, 0, 367, 366, 1, 0, 0, 0, 368, 371, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 372, 1, 0, 0, 0, 371, 369, 1, 0, 0, 0, 372, 376, 5, 6, 0, 0, 373, 375, 5, 36, 0, 0, 374, 373, 1, 0, 0, 0, 375, 378, 1, 0, 0, 0, 376, 374, 1, 0, 0, 0, 376, 377, 1, 0, 0, 0, 377, 379, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 379, 390, 5, 32, 0, 0, 380, 384, 5, 3, 0, 0, 381, 383, 5, 36, 0, 0, 382, 381, 1, 0, 0, 0, 383, 386, 1, 0, 0, 0, 384, 382, 1, 0, 0, 0, 384, 385, 1, 0, 0, 0, 385, 387, 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 389, 5, 32, 0, 0, 388, 380, 1, 0, 0, 0, 389, 392, 1, 0, 0, 0, 390, 388, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 396, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 393, 395, 5, 36, 0, 0, 394, 393, 1, 0, 0, 0, 395, 398, 1, 0, 0, 0, 396, 394, 1, 0, 0, 0, 396, 397, 1, 0, 0, 0, 397, 399, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 399, 400, 5, 7, 0, 0, 400, 53, 1, 0, 0, 0, 401, 405, 5, 15, 0, 0, 402, 404, 5, 36, 0, 0, 403, 402, 1, 0, 0, 0, 404, 407, 1, 0, 0, 0, 405, 403, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 406, 408, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 408, 412, 5, 33, 0, 0, 409, 411, 5, 36, 0, 0, 410, 409, 1, 0, 0, 0, 411, 414, 1, 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 415, 1, 0, 0, 0, 414, 412, 1, 0, 0, 0, 415, 416, 5, 16, 0, 0, 416, 417, 3, 44, 22, 0, 417, 55, 1, 0, 0, 0, 418, 422, 5, 17, 0, 0, 419, 421, 5, 36, 0, 0, 420, 419, 1, 0, 0, 0, 421, 424, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 425, 1, 0, 0, 0, 424, 422, 1, 0, 0, 0, 425, 429, 5, 6, 0, 0, 426, 428, 5, 36, 0, 0, 427, 426, 1, 0, 0, 0, 428, 431, 1, 0, 0, 0, 429, 427, 1, 0, 0, 0, 429, 430, 1, 0, 0, 0, 430, 433, 1, 0, 0, 0, 431, 429, 1, 0, 0, 0, 432, 434, 3, 58, 29, 0, 433, 432, 1, 0, 0, 0, 433, 434, 1, 0, 0, 0, 434, 435, 1, 0, 0, 0, 435, 436, 5, 7, 0, 0, 436, 57, 1, 0, 0, 0, 437, 446, 3, 60, 30, 0, 438, 440, 5, 36, 0, 0, 439, 438, 1, 0, 0, 0, 440, 441, 1, 0, 0, 0, 441, 439, 1, 0, 0, 0, 441, 442, 1, 0, 0, 0, 442, 443, 1, 0, 0, 0, 443, 445, 3, 60, 30, 0, 444, 439, 1, 0, 0, 0, 445, 448, 1, 0, 0, 0, 446, 444, 1, 0, 0, 0, 446, 447, 1, 0, 0, 0, 447, 59, 1, 0, 0, 0, 448, 446, 1, 0, 0, 0, 449, 450, 5, 32, 0, 0, 450, 454, 3, 44, 22, 0, 451, 453, 5, 36, 0, 0, 452, 451, 1, 0, 0, 0, 453, 456, 1, 0, 0, 0, 454, 452, 1, 0, 0, 0, 454, 455, 1, 0, 0, 0, 455, 61, 1, 0, 0, 0, 456, 454, 1, 0, 0, 0, 457, 472, 3, 64, 32, 0, 458, 460, 5, 36, 0, 0, 459, 458, 1, 0, 0, 0, 460, 463, 1, 0, 0, 0, 461, 459, 1, 0, 0, 0, 461, 462, 1, 0, 0, 0, 462, 464, 1, 0, 0, 0, 463, 461, 1, 0, 0, 0, 464, 468, 5, 18, 0, 0, 465, 467, 5, 36, 0, 0, 466, 465, 1, 0, 0, 0, 467, 470, 1, 0, 0, 0, 468, 466, 1, 0, 0, 0, 468, 469, 1, 0, 0, 0, 469, 471, 1, 0, 0, 0, 470, 468, 1, 0, 0, 0, 471, 473, 3, 64, 32, 0, 472, 461, 1, 0, 0, 0, 473, 474, 1, 0, 0, 0, 474, 472, 1, 0, 0, 0, 474, 475, 1, 0, 0, 0, 475, 63, 1, 0, 0, 0, 476, 479, 3, 46, 23, 0, 477, 479, 3, 50, 25, 0, 478, 476, 1, 0, 0, 0, 478, 477, 1, 0, 0, 0, 479, 65, 1, 0, 0, 0, 480, 484, 5, 19, 0, 0, 481, 483, 5, 36, 0, 0, 482, 481, 1, 0, 0, 0, 483, 486, 1, 0, 0, 0, 484, 482, 1, 0, 0, 0, 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 484, 1, 0, 0, 0, 487, 491, 5, 6, 0, 0, 488, 490, 5, 36, 0, 0, 489, 488, 1, 0, 0, 0, 490, 493, 1, 0, 0, 0, 491, 489, 1, 0, 0, 0, 491, 492, 1, 0, 0, 0, 492, 497, 1, 0, 0, 0, 493, 491, 1, 0, 0, 0, 494, 496, 3, 68, 34, 0, 495, 494, 1, 0, 0, 0, 496, 499, 1, 0, 0, 0, 497, 495, 1, 0, 0, 0, 497, 498, 1, 0, 0, 0, 498, 500, 1, 0, 0, 0, 499, 497, 1, 0, 0, 0, 500, 501, 5, 7, 0, 0, 501, 67, 1, 0, 0, 0, 502, 504, 5, 31, 0, 0, 503, 502, 1, 0, 0, 0, 503, 504, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 507, 5, 32, 0, 0, 506, 508, 3, 38, 19, 0, 507, 506, 1, 0, 0, 0, 507, 508, 1, 0, 0, 0, 508, 509, 1, 0, 0, 0, 509, 510, 3, 70, 35, 0, 510, 514, 3, 72, 36, 0, 511, 513, 5, 36, 0, 0, 512, 511, 1, 0, 0, 0, 513, 516, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, 1, 0, 0, 0, 515, 69, 1, 0, 0, 0, 516, 514, 1, 0, 0, 0, 517, 518, 3, 74, 37, 0, 518, 71, 1, 0, 0, 0, 519, 520, 3, 74, 37, 0, 520, 73, 1, 0, 0, 0, 521, 539, 5, 2, 0, 0, 522, 524, 5, 36, 0, 0, 523, 522, 1, 0, 0, 0, 524, 527, 1, 0, 0, 0, 525, 523, 1, 0, 0, 0, 525, 526, 1, 0, 0, 0, 526, 540, 1, 0, 0, 0, 527, 525, 1, 0, 0, 0, 528, 530, 3, 76, 38, 0, 529, 528, 1, 0, 0, 0, 529, 530, 1, 0, 0, 0, 530, 540, 1, 0, 0, 0, 531, 536, 3, 76, 38, 0, 532, 533, 5, 3, 0, 0, 533, 535, 3, 76, 38, 0, 534, 532, 1, 0, 0, 0, 535, 538, 1, 0, 0, 0, 536, 534, 1, 0, 0, 0, 536, 537, 1, 0, 0, 0, 537, 540, 1, 0, 0, 0, 538, 536, 1, 0, 0, 0, 539, 525, 1, 0, 0, 0, 539, 529, 1, 0, 0, 0, 539, 531, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 5, 4, 0, 0, 542, 75, 1, 0, 0, 0, 543, 545, 5, 36, 0, 0, 544, 543, 1, 0, 0, 0, 545, 548, 1, 0, 0, 0, 546, 544, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, 549, 1, 0, 0, 0, 548, 546, 1, 0, 0, 0, 549, 550, 5, 32, 0, 0, 550, 554, 3, 44, 22, 0, 551, 553, 5, 36, 0, 0, 552, 551, 1, 0, 0, 0, 553, 556, 1, 0, 0, 0, 554, 552, 1, 0, 0, 0, 554, 555, 1, 0, 0, 0, 555, 77, 1, 0, 0, 0, 556, 554, 1, 0, 0, 0, 557, 561, 5, 20, 0, 0, 558, 560, 5, 36, 0, 0, 559, 558, 1, 0, 0, 0, 560, 563, 1, 0, 0, 0, 561, 559, 1, 0, 0, 0, 561, 562, 1, 0, 0, 0, 562, 564, 1, 0, 0, 0, 563, 561, 1, 0, 0, 0, 564, 568, 5, 6, 0, 0, 565, 567, 5, 36, 0, 0, 566, 565, 1, 0, 0, 0, 567, 570, 1, 0, 0, 0, 568, 566, 1, 0, 0, 0, 568, 569, 1, 0, 0, 0, 569, 574, 1, 0, 0, 0, 570, 568, 1, 0, 0, 0, 571, 573, 3, 80, 40, 0, 572, 571, 1, 0, 0, 0, 573, 576, 1, 0, 0, 0, 574, 572, 1, 0, 0, 0, 574, 575, 1, 0, 0, 0, 575, 577, 1, 0, 0, 0, 576, 574, 1, 0, 0, 0, 577, 578, 5, 7, 0, 0, 578, 79, 1, 0, 0, 0, 579, 581, 5, 31, 0, 0, 580, 579, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 582, 1, 0, 0, 0, 582, 583, 5, 32, 0, 0, 583, 584, 3, 44, 22, 0, 584, 588, 3, 82, 41, 0, 585, 587, 5, 36, 0, 0, 586, 585, 1, 0, 0, 0, 587, 590, 1, 0, 0, 0, 588, 586, 1, 0, 0, 0, 588, 589, 1, 0, 0, 0, 589, 81, 1, 0, 0, 0, 590, 588, 1, 0, 0, 0, 591, 599, 3, 84, 42, 0, 592, 599, 5, 33, 0, 0, 593, 599, 5, 34, 0, 0, 594, 599, 5, 35, 0, 0, 595, 599, 3, 88, 44, 0, 596, 599, 3, 92, 46, 0, 597, 599, 3, 86, 43, 0, 598, 591, 1, 0, 0, 0, 598, 592, 1, 0, 0, 0, 598, 593, 1, 0, 0, 0, 598, 594, 1, 0, 0, 0, 598, 595, 1, 0, 0, 0, 598, 596, 1, 0, 0, 0, 598, 597, 1, 0, 0, 0, 599, 83, 1, 0, 0, 0, 600, 601, 7, 1, 0, 0, 601, 85, 1, 0, 0, 0, 602, 603, 5, 23, 0, 0, 603, 87, 1, 0, 0, 0, 604, 608, 5, 15, 0, 0, 605, 607, 5, 36, 0, 0, 606, 605, 1, 0, 0, 0, 607, 610, 1, 0, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, 1, 0, 0, 0, 609, 612, 1, 0, 0, 0, 610, 608, 1, 0, 0, 0, 611, 613, 3, 90, 45, 0, 612, 611, 1, 0, 0, 0, 612, 613, 1, 0, 0, 0, 613, 614, 1, 0, 0, 0, 614, 615, 5, 16, 0, 0, 615, 89, 1, 0, 0, 0, 616, 638, 3, 82, 41, 0, 617, 634, 3, 82, 41, 0, 618, 622, 5, 3, 0, 0, 619, 621, 5, 36, 0, 0, 620, 619, 1, 0, 0, 0, 621, 624, 1, 0, 0, 0, 622, 620, 1, 0, 0, 0, 622, 623, 1, 0, 0, 0, 623, 625, 1, 0, 0, 0, 624, 622, 1, 0, 0, 0, 625, 629, 3, 82, 41, 0, 626, 628, 5, 36, 0, 0, 627, 626, 1, 0, 0, 0, 628, 631, 1, 0, 0, 0, 629, 627, 1, 0, 0, 0, 629, 630, 1, 0, 0, 0, 630, 633, 1, 0, 0, 0, 631, 629, 1, 0, 0, 0, 632, 618, 1, 0, 0, 0, 633, 636, 1, 0, 0, 0, 634, 632, 1, 0, 0, 0, 634, 635, 1, 0, 0, 0, 635, 638, 1, 0, 0, 0, 636, 634, 1, 0, 0, 0, 637, 616, 1, 0, 0, 0, 637, 617, 1, 0, 0, 0, 638, 91, 1, 0, 0, 0, 639, 643, 5, 6, 0, 0, 640, 642, 5, 36, 0, 0, 641, 640, 1, 0, 0, 0, 642, 645, 1, 0, 0, 0, 643, 641, 1, 0, 0, 0, 643, 644, 1, 0, 0, 0, 644, 647, 1, 0, 0, 0, 645, 643, 1, 0, 0, 0, 646, 648, 3, 94, 47, 0, 647, 646, 1, 0, 0, 0, 647, 648, 1, 0, 0, 0, 648, 649, 1, 0, 0, 0, 649, 650, 5, 7, 0, 0, 650, 93, 1, 0, 0, 0, 651, 661, 3, 96, 48, 0, 652, 654, 5, 36, 0, 0, 653, 652, 1, 0, 0, 0, 654, 657, 1, 0, 0, 0, 655, 653, 1, 0, 0, 0, 655, 656, 1, 0, 0, 0, 656, 658, 1, 0, 0, 0, 657, 655, 1, 0, 0, 0, 658, 660, 3, 96, 48, 0, 659, 655, 1, 0, 0, 0, 660, 663, 1, 0, 0, 0, 661, 659, 1, 0, 0, 0, 661, 662, 1, 0, 0, 0, 662, 95, 1, 0, 0, 0, 663, 661, 1, 0, 0, 0, 664, 665, 5, 32, 0, 0, 665, 666, 5, 24, 0, 0, 666, 670, 3, 82, 41, 0, 667, 669, 5, 36, 0, 0, 668, 667, 1, 0, 0, 0, 669, 672, 1, 0, 0, 0, 670, 668, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 671, 97, 1, 0, 0, 0, 672, 670, 1, 0, 0, 0, 673, 677, 5, 25, 0, 0, 674, 676, 5, 36, 0, 0, 675, 674, 1, 0, 0, 0, 676, 679, 1, 0, 0, 0, 677, 675, 1, 0, 0, 0, 677, 678, 1, 0, 0, 0, 678, 680, 1, 0, 0, 0, 679, 677, 1, 0, 0, 0, 680, 684, 5, 6, 0, 0, 681, 683, 5, 36, 0, 0, 682, 681, 1, 0, 0, 0, 683, 686, 1, 0, 0, 0, 684, 682, 1, 0, 0, 0, 684, 685, 1, 0, 0, 0, 685, 690, 1, 0, 0, 0, 686, 684, 1, 0, 0, 0, 687, 689, 3, 100, 50, 0, 688, 687, 1, 0, 0, 0, 689, 692, 1, 0, 0, 0, 690, 688, 1, 0, 0, 0, 690, 691, 1, 0, 0, 0, 691, 693, 1, 0, 0, 0, 692, 690, 1, 0, 0, 0, 693, 694, 5, 7, 0, 0, 694, 99, 1, 0, 0, 0, 695, 697, 3, 4, 2, 0, 696, 695, 1, 0, 0, 0, 696, 697, 1, 0, 0, 0, 697, 698, 1, 0, 0, 0, 698, 700, 3, 68, 34, 0, 699, 701, 3, 102, 51, 0, 700, 699, 1, 0, 0, 0, 700, 701, 1, 0, 0, 0, 701, 705, 1, 0, 0, 0, 702, 704, 5, 36, 0, 0, 703, 702, 1, 0, 0, 0, 704, 707, 1, 0, 0, 0, 705, 703, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 706, 101, 1, 0, 0, 0, 707, 705, 1, 0, 0, 0, 708, 712, 5, 6, 0, 0, 709, 711, 5, 36, 0, 0, 710, 709, 1, 0, 0, 0, 711, 714, 1, 0, 0, 0, 712, 710, 1, 0, 0, 0, 712, 713, 1, 0, 0, 0, 713, 722, 1, 0, 0, 0, 714, 712, 1, 0, 0, 0, 715, 719, 3, 104, 52, 0, 716, 718, 5, 36, 0, 0, 717, 716, 1, 0, 0, 0, 718, 721, 1, 0, 0, 0, 719, 717, 1, 0, 0, 0, 719, 720, 1, 0, 0, 0, 720, 723, 1, 0, 0, 0, 721, 719, 1, 0, 0, 0, 722, 715, 1, 0, 0, 0, 722, 723, 1, 0, 0, 0, 723, 731, 1, 0, 0, 0, 724, 728, 3, 114, 57, 0, 725, 727, 5, 36, 0, 0, 726, 725, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 726, 1, 0, 0, 0, 728, 729, 1, 0, 0, 0, 729, 732, 1, 0, 0, 0, 730, 728, 1, 0, 0, 0, 731, 724, 1, 0, 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 1, 0, 0, 0, 733, 734, 5, 7, 0, 0, 734, 103, 1, 0, 0, 0, 735, 739, 5, 26, 0, 0, 736, 738, 5, 36, 0, 0, 737, 736, 1, 0, 0, 0, 738, 741, 1, 0, 0, 0, 739, 737, 1, 0, 0, 0, 739, 740, 1, 0, 0, 0, 740, 742, 1, 0, 0, 0, 741, 739, 1, 0, 0, 0, 742, 743, 3, 106, 53, 0, 743, 105, 1, 0, 0, 0, 744, 748, 5, 6, 0, 0, 745, 747, 5, 36, 0, 0, 746, 745, 1, 0, 0, 0, 747, 750, 1, 0, 0, 0, 748, 746, 1, 0, 0, 0, 748, 749, 1, 0, 0, 0, 749, 760, 1, 0, 0, 0, 750, 748, 1, 0, 0, 0, 751, 755, 3, 108, 54, 0, 752, 754, 5, 36, 0, 0, 753, 752, 1, 0, 0, 0, 754, 757, 1, 0, 0, 0, 755, 753, 1, 0, 0, 0, 755, 756, 1, 0, 0, 0, 756, 759, 1, 0, 0, 0, 757, 755, 1, 0, 0, 0, 758, 751, 1, 0, 0, 0, 759, 762, 1, 0, 0, 0, 760, 758, 1, 0, 0, 0, 760, 761, 1, 0, 0, 0, 761, 763, 1, 0, 0, 0, 762, 760, 1, 0, 0, 0, 763, 764, 5, 7, 0, 0, 764, 107, 1, 0, 0, 0, 765, 767, 3, 4, 2, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 768, 1, 0, 0, 0, 768, 769, 5, 32, 0, 0, 769, 770, 3, 110, 55, 0, 770, 109, 1, 0, 0, 0, 771, 775, 3, 24, 12, 0, 772, 774, 5, 36, 0, 0, 773, 772, 1, 0, 0, 0, 774, 777, 1, 0, 0, 0, 775, 773, 1, 0, 0, 0, 775, 776, 1, 0, 0, 0, 776, 779, 1, 0, 0, 0, 777, 775, 1, 0, 0, 0, 778, 780, 3, 48, 24, 0, 779, 778, 1, 0, 0, 0, 779, 780, 1, 0, 0, 0, 780, 784, 1, 0, 0, 0, 781, 783, 5, 36, 0, 0, 782, 781, 1, 0, 0, 0, 783, 786, 1, 0, 0, 0, 784, 782, 1, 0, 0, 0, 784, 785, 1, 0, 0, 0, 785, 788, 1, 0, 0, 0, 786, 784, 1, 0, 0, 0, 787, 789, 3, 112, 56, 0, 788, 787, 1, 0, 0, 0, 788, 789, 1, 0, 0, 0, 789, 111, 1, 0, 0, 0, 790, 791, 3, 106, 53, 0, 791, 113, 1, 0, 0, 0, 792, 796, 5, 27, 0, 0, 793, 795, 5, 36, 0, 0, 794, 793, 1, 0, 0, 0, 795, 798, 1, 0, 0, 0, 796, 794, 1, 0, 0, 0, 796, 797, 1, 0, 0, 0, 797, 799, 1, 0, 0, 0, 798, 796, 1, 0, 0, 0, 799, 803, 5, 6, 0, 0, 800, 802, 5, 36, 0, 0, 801, 800, 1, 0, 0, 0, 802, 805, 1, 0, 0, 0, 803, 801, 1, 0, 0, 0, 803, 804, 1, 0, 0, 0, 804, 807, 1, 0, 0, 0, 805, 803, 1, 0, 0, 0, 806, 808, 3, 116, 58, 0, 807, 806, 1, 0, 0, 0, 807, 808, 1, 0, 0, 0, 808, 812, 1, 0, 0, 0, 809, 811, 5, 36, 0, 0, 810, 809, 1, 0, 0, 0, 811, 814, 1, 0, 0, 0, 812, 810, 1, 0, 0, 0, 812, 813, 1, 0, 0, 0, 813, 815, 1, 0, 0, 0, 814, 812, 1, 0, 0, 0, 815, 816, 5, 7, 0, 0, 816, 115, 1, 0, 0, 0, 817, 827, 3, 118, 59, 0, 818, 820, 5, 36, 0, 0, 819, 818, 1, 0, 0, 0, 820, 823, 1, 0, 0, 0, 821, 819, 1, 0, 0, 0, 821, 822, 1, 0, 0, 0, 822, 824, 1, 0, 0, 0, 823, 821, 1, 0, 0, 0, 824, 826, 3, 118, 59, 0, 825, 821, 1, 0, 0, 0, 826, 829, 1, 0, 0, 0, 827, 825, 1, 0, 0, 0, 827, 828, 1, 0, 0, 0, 828, 117, 1, 0, 0, 0, 829, 827, 1, 0, 0, 0, 830, 831, 3, 120, 60, 0, 831, 834, 5, 28, 0, 0, 832, 835, 3, 122, 61, 0, 833, 835, 3, 138, 69, 0, 834, 832, 1, 0, 0, 0, 834, 833, 1, 0, 0, 0, 835, 119, 1, 0, 0, 0, 836, 839, 3, 128, 64, 0, 837, 839, 3, 126, 63, 0, 838, 836, 1, 0, 0, 0, 838, 837, 1, 0, 0, 0, 839, 841, 1, 0, 0, 0, 840, 842, 3, 136, 68, 0, 841, 840, 1, 0, 0, 0, 841, 842, 1, 0, 0, 0, 842, 121, 1, 0, 0, 0, 843, 846, 3, 128, 64, 0, 844, 846, 3, 124, 62, 0, 845, 843, 1, 0, 0, 0, 845, 844, 1, 0, 0, 0, 846, 123, 1, 0, 0, 0, 847, 851, 5, 2, 0, 0, 848, 850, 5, 36, 0, 0, 849, 848, 1, 0, 0, 0, 850, 853, 1, 0, 0, 0, 851, 849, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, 853, 851, 1, 0, 0, 0, 854, 859, 3, 118, 59, 0, 855, 856, 5, 36, 0, 0, 856, 858, 3, 118, 59, 0, 857, 855, 1, 0, 0, 0, 858, 861, 1, 0, 0, 0, 859, 857, 1, 0, 0, 0, 859, 860, 1, 0, 0, 0, 860, 865, 1, 0, 0, 0, 861, 859, 1, 0, 0, 0, 862, 864, 5, 36, 0, 0, 863, 862, 1, 0, 0, 0, 864, 867, 1, 0, 0, 0, 865, 863, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 868, 1, 0, 0, 0, 867, 865, 1, 0, 0, 0, 868, 869, 5, 4, 0, 0, 869, 125, 1, 0, 0, 0, 870, 871, 5, 29, 0, 0, 871, 872, 3, 24, 12, 0, 872, 127, 1, 0, 0, 0, 873, 874, 3, 130, 65, 0, 874, 875, 5, 24, 0, 0, 875, 877, 3, 132, 66, 0, 876, 878, 3, 134, 67, 0, 877, 876, 1, 0, 0, 0, 877, 878, 1, 0, 0, 0, 878, 129, 1, 0, 0, 0, 879, 880, 5, 32, 0, 0, 880, 131, 1, 0, 0, 0, 881, 882, 5, 32, 0, 0, 882, 133, 1, 0, 0, 0, 883, 884, 5, 15, 0, 0, 884, 885, 5, 33, 0, 0, 885, 886, 5, 16, 0, 0, 886, 135, 1, 0, 0, 0, 887, 888, 5, 10, 0, 0, 888, 893, 5, 32, 0, 0, 889, 890, 5, 10, 0, 0, 890, 892, 5, 32, 0, 0, 891, 889, 1, 0, 0, 0, 892, 895, 1, 0, 0, 0, 893, 891, 1, 0, 0, 0, 893, 894, 1, 0, 0, 0, 894, 137, 1, 0, 0, 0, 895, 893, 1, 0, 0, 0, 896, 900, 5, 15, 0, 0, 897, 899, 5, 36, 0, 0, 898, 897, 1, 0, 0, 0, 899, 902, 1, 0, 0, 0, 900, 898, 1, 0, 0, 0, 900, 901, 1, 0, 0, 0, 901, 903, 1, 0, 0, 0, 902, 900, 1, 0, 0, 0, 903, 920, 3, 122, 61, 0, 904, 908, 5, 3, 0, 0, 905, 907, 5, 36, 0, 0, 906, 905, 1, 0, 0, 0, 907, 910, 1, 0, 0, 0, 908, 906, 1, 0, 0, 0, 908, 909, 1, 0, 0, 0, 909, 911, 1, 0, 0, 0, 910, 908, 1, 0, 0, 0, 911, 915, 3, 122, 61, 0, 912, 914, 5, 36, 0, 0, 913, 912, 1, 0, 0, 0, 914, 917, 1, 0, 0, 0, 915, 913, 1, 0, 0, 0, 915, 916, 1, 0, 0, 0, 916, 919, 1, 0, 0, 0, 917, 915, 1, 0, 0, 0, 918, 904, 1, 0, 0, 0, 919, 922, 1, 0, 0, 0, 920, 918, 1, 0, 0, 0, 920, 921, 1, 0, 0, 0, 921, 923, 1, 0, 0, 0, 922, 920, 1, 0, 0, 0, 923, 924, 5, 16, 0, 0, 924, 139, 1, 0, 0, 0, 120, 143, 145, 155, 162, 167, 175, 183, 189, 196, 202, 208, 214, 230, 235, 242, 252, 259, 266, 271, 277, 281, 284, 290, 294, 303, 310, 315, 320, 325, 329, 335, 343, 349, 355, 363, 369, 376, 384, 390, 396, 405, 412, 422, 429, 433, 441, 446, 454, 461, 468, 474, 478, 484, 491, 497, 503, 507, 514, 525, 529, 536, 539, 546, 554, 561, 568, 574, 580, 588, 598, 608, 612, 622, 629, 634, 637, 643, 647, 655, 661, 670, 677, 684, 690, 696, 700, 705, 712, 719, 722, 728, 731, 739, 748, 755, 760, 766, 775, 779, 784, 788, 796, 803, 807, 812, 821, 827, 834, 838, 841, 845, 851, 859, 865, 877, 893, 900, 908, 915, 920] \ No newline at end of file +[4, 1, 38, 973, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 1, 0, 1, 0, 1, 0, 5, 0, 158, 8, 0, 10, 0, 12, 0, 161, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 170, 8, 1, 1, 2, 1, 2, 1, 2, 4, 2, 175, 8, 2, 11, 2, 12, 2, 176, 1, 3, 1, 3, 1, 3, 3, 3, 182, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 188, 8, 4, 10, 4, 12, 4, 191, 9, 4, 1, 4, 1, 4, 1, 5, 4, 5, 196, 8, 5, 11, 5, 12, 5, 197, 1, 6, 1, 6, 5, 6, 202, 8, 6, 10, 6, 12, 6, 205, 9, 6, 1, 6, 1, 6, 5, 6, 209, 8, 6, 10, 6, 12, 6, 212, 9, 6, 1, 6, 5, 6, 215, 8, 6, 10, 6, 12, 6, 218, 9, 6, 1, 6, 1, 6, 1, 7, 3, 7, 223, 8, 7, 1, 7, 1, 7, 5, 7, 227, 8, 7, 10, 7, 12, 7, 230, 9, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 5, 11, 243, 8, 11, 10, 11, 12, 11, 246, 9, 11, 1, 12, 1, 12, 3, 12, 250, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 257, 8, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 3, 17, 265, 8, 17, 1, 18, 3, 18, 268, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 5, 19, 275, 8, 19, 10, 19, 12, 19, 278, 9, 19, 1, 19, 1, 19, 5, 19, 282, 8, 19, 10, 19, 12, 19, 285, 9, 19, 1, 19, 3, 19, 288, 8, 19, 1, 19, 1, 19, 5, 19, 292, 8, 19, 10, 19, 12, 19, 295, 9, 19, 5, 19, 297, 8, 19, 10, 19, 12, 19, 300, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 3, 20, 306, 8, 20, 1, 20, 3, 20, 309, 8, 20, 1, 21, 1, 21, 5, 21, 313, 8, 21, 10, 21, 12, 21, 316, 9, 21, 1, 21, 3, 21, 319, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 5, 22, 326, 8, 22, 10, 22, 12, 22, 329, 9, 22, 1, 22, 1, 22, 5, 22, 333, 8, 22, 10, 22, 12, 22, 336, 9, 22, 5, 22, 338, 8, 22, 10, 22, 12, 22, 341, 9, 22, 1, 23, 1, 23, 3, 23, 345, 8, 23, 1, 24, 1, 24, 1, 24, 3, 24, 350, 8, 24, 1, 25, 1, 25, 3, 25, 354, 8, 25, 1, 26, 1, 26, 5, 26, 358, 8, 26, 10, 26, 12, 26, 361, 9, 26, 1, 26, 1, 26, 1, 26, 5, 26, 366, 8, 26, 10, 26, 12, 26, 369, 9, 26, 1, 26, 5, 26, 372, 8, 26, 10, 26, 12, 26, 375, 9, 26, 1, 26, 5, 26, 378, 8, 26, 10, 26, 12, 26, 381, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 3, 27, 387, 8, 27, 1, 28, 1, 28, 5, 28, 391, 8, 28, 10, 28, 12, 28, 394, 9, 28, 1, 28, 1, 28, 5, 28, 398, 8, 28, 10, 28, 12, 28, 401, 9, 28, 1, 28, 1, 28, 1, 28, 5, 28, 406, 8, 28, 10, 28, 12, 28, 409, 9, 28, 1, 28, 5, 28, 412, 8, 28, 10, 28, 12, 28, 415, 9, 28, 1, 28, 5, 28, 418, 8, 28, 10, 28, 12, 28, 421, 9, 28, 1, 28, 1, 28, 1, 29, 1, 29, 5, 29, 427, 8, 29, 10, 29, 12, 29, 430, 9, 29, 1, 29, 1, 29, 5, 29, 434, 8, 29, 10, 29, 12, 29, 437, 9, 29, 1, 29, 3, 29, 440, 8, 29, 1, 29, 1, 29, 1, 30, 1, 30, 4, 30, 446, 8, 30, 11, 30, 12, 30, 447, 1, 30, 5, 30, 451, 8, 30, 10, 30, 12, 30, 454, 9, 30, 1, 31, 1, 31, 1, 31, 5, 31, 459, 8, 31, 10, 31, 12, 31, 462, 9, 31, 1, 32, 1, 32, 5, 32, 466, 8, 32, 10, 32, 12, 32, 469, 9, 32, 1, 32, 1, 32, 5, 32, 473, 8, 32, 10, 32, 12, 32, 476, 9, 32, 1, 32, 4, 32, 479, 8, 32, 11, 32, 12, 32, 480, 1, 33, 1, 33, 3, 33, 485, 8, 33, 1, 34, 1, 34, 3, 34, 489, 8, 34, 1, 35, 3, 35, 492, 8, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 5, 36, 499, 8, 36, 10, 36, 12, 36, 502, 9, 36, 1, 36, 1, 36, 5, 36, 506, 8, 36, 10, 36, 12, 36, 509, 9, 36, 1, 36, 3, 36, 512, 8, 36, 1, 36, 5, 36, 515, 8, 36, 10, 36, 12, 36, 518, 9, 36, 1, 36, 1, 36, 1, 37, 1, 37, 3, 37, 524, 8, 37, 1, 37, 1, 37, 1, 37, 5, 37, 529, 8, 37, 10, 37, 12, 37, 532, 9, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 5, 40, 540, 8, 40, 10, 40, 12, 40, 543, 9, 40, 1, 40, 3, 40, 546, 8, 40, 1, 40, 1, 40, 1, 40, 5, 40, 551, 8, 40, 10, 40, 12, 40, 554, 9, 40, 3, 40, 556, 8, 40, 1, 40, 1, 40, 1, 41, 5, 41, 561, 8, 41, 10, 41, 12, 41, 564, 9, 41, 1, 41, 1, 41, 1, 41, 5, 41, 569, 8, 41, 10, 41, 12, 41, 572, 9, 41, 1, 42, 1, 42, 3, 42, 576, 8, 42, 1, 43, 3, 43, 579, 8, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 5, 44, 586, 8, 44, 10, 44, 12, 44, 589, 9, 44, 1, 44, 1, 44, 5, 44, 593, 8, 44, 10, 44, 12, 44, 596, 9, 44, 1, 44, 3, 44, 599, 8, 44, 1, 44, 5, 44, 602, 8, 44, 10, 44, 12, 44, 605, 9, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 5, 45, 614, 8, 45, 10, 45, 12, 45, 617, 9, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 626, 8, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 5, 49, 634, 8, 49, 10, 49, 12, 49, 637, 9, 49, 1, 49, 3, 49, 640, 8, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 5, 50, 648, 8, 50, 10, 50, 12, 50, 651, 9, 50, 1, 50, 1, 50, 5, 50, 655, 8, 50, 10, 50, 12, 50, 658, 9, 50, 5, 50, 660, 8, 50, 10, 50, 12, 50, 663, 9, 50, 3, 50, 665, 8, 50, 1, 51, 1, 51, 5, 51, 669, 8, 51, 10, 51, 12, 51, 672, 9, 51, 1, 51, 3, 51, 675, 8, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 5, 52, 682, 8, 52, 10, 52, 12, 52, 685, 9, 52, 1, 52, 5, 52, 688, 8, 52, 10, 52, 12, 52, 691, 9, 52, 1, 52, 3, 52, 694, 8, 52, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 700, 8, 53, 10, 53, 12, 53, 703, 9, 53, 1, 54, 1, 54, 3, 54, 707, 8, 54, 1, 55, 3, 55, 710, 8, 55, 1, 55, 3, 55, 713, 8, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 5, 56, 720, 8, 56, 10, 56, 12, 56, 723, 9, 56, 1, 56, 1, 56, 5, 56, 727, 8, 56, 10, 56, 12, 56, 730, 9, 56, 1, 56, 3, 56, 733, 8, 56, 1, 56, 3, 56, 736, 8, 56, 1, 56, 5, 56, 739, 8, 56, 10, 56, 12, 56, 742, 9, 56, 1, 56, 1, 56, 1, 57, 1, 57, 3, 57, 748, 8, 57, 1, 57, 5, 57, 751, 8, 57, 10, 57, 12, 57, 754, 9, 57, 1, 58, 1, 58, 5, 58, 758, 8, 58, 10, 58, 12, 58, 761, 9, 58, 1, 58, 1, 58, 5, 58, 765, 8, 58, 10, 58, 12, 58, 768, 9, 58, 3, 58, 770, 8, 58, 1, 58, 1, 58, 5, 58, 774, 8, 58, 10, 58, 12, 58, 777, 9, 58, 3, 58, 779, 8, 58, 1, 58, 1, 58, 1, 59, 1, 59, 5, 59, 785, 8, 59, 10, 59, 12, 59, 788, 9, 59, 1, 59, 1, 59, 1, 60, 1, 60, 5, 60, 794, 8, 60, 10, 60, 12, 60, 797, 9, 60, 1, 60, 1, 60, 5, 60, 801, 8, 60, 10, 60, 12, 60, 804, 9, 60, 5, 60, 806, 8, 60, 10, 60, 12, 60, 809, 9, 60, 1, 60, 1, 60, 1, 61, 3, 61, 814, 8, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 5, 62, 821, 8, 62, 10, 62, 12, 62, 824, 9, 62, 1, 62, 3, 62, 827, 8, 62, 1, 62, 5, 62, 830, 8, 62, 10, 62, 12, 62, 833, 9, 62, 1, 62, 3, 62, 836, 8, 62, 1, 63, 1, 63, 1, 64, 1, 64, 5, 64, 842, 8, 64, 10, 64, 12, 64, 845, 9, 64, 1, 64, 1, 64, 5, 64, 849, 8, 64, 10, 64, 12, 64, 852, 9, 64, 1, 64, 3, 64, 855, 8, 64, 1, 64, 5, 64, 858, 8, 64, 10, 64, 12, 64, 861, 9, 64, 1, 64, 1, 64, 1, 65, 1, 65, 5, 65, 867, 8, 65, 10, 65, 12, 65, 870, 9, 65, 1, 65, 5, 65, 873, 8, 65, 10, 65, 12, 65, 876, 9, 65, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 882, 8, 66, 1, 67, 1, 67, 3, 67, 886, 8, 67, 1, 67, 3, 67, 889, 8, 67, 1, 68, 1, 68, 3, 68, 893, 8, 68, 1, 69, 1, 69, 5, 69, 897, 8, 69, 10, 69, 12, 69, 900, 9, 69, 1, 69, 1, 69, 1, 69, 5, 69, 905, 8, 69, 10, 69, 12, 69, 908, 9, 69, 1, 69, 5, 69, 911, 8, 69, 10, 69, 12, 69, 914, 9, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 925, 8, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 5, 75, 939, 8, 75, 10, 75, 12, 75, 942, 9, 75, 1, 76, 1, 76, 5, 76, 946, 8, 76, 10, 76, 12, 76, 949, 9, 76, 1, 76, 1, 76, 1, 76, 5, 76, 954, 8, 76, 10, 76, 12, 76, 957, 9, 76, 1, 76, 1, 76, 5, 76, 961, 8, 76, 10, 76, 12, 76, 964, 9, 76, 5, 76, 966, 8, 76, 10, 76, 12, 76, 969, 9, 76, 1, 76, 1, 76, 1, 76, 0, 0, 77, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 0, 2, 2, 0, 9, 9, 33, 33, 1, 0, 20, 21, 1035, 0, 159, 1, 0, 0, 0, 2, 169, 1, 0, 0, 0, 4, 174, 1, 0, 0, 0, 6, 178, 1, 0, 0, 0, 8, 183, 1, 0, 0, 0, 10, 195, 1, 0, 0, 0, 12, 199, 1, 0, 0, 0, 14, 222, 1, 0, 0, 0, 16, 231, 1, 0, 0, 0, 18, 233, 1, 0, 0, 0, 20, 237, 1, 0, 0, 0, 22, 239, 1, 0, 0, 0, 24, 249, 1, 0, 0, 0, 26, 251, 1, 0, 0, 0, 28, 253, 1, 0, 0, 0, 30, 258, 1, 0, 0, 0, 32, 260, 1, 0, 0, 0, 34, 264, 1, 0, 0, 0, 36, 267, 1, 0, 0, 0, 38, 272, 1, 0, 0, 0, 40, 303, 1, 0, 0, 0, 42, 310, 1, 0, 0, 0, 44, 322, 1, 0, 0, 0, 46, 342, 1, 0, 0, 0, 48, 349, 1, 0, 0, 0, 50, 351, 1, 0, 0, 0, 52, 355, 1, 0, 0, 0, 54, 386, 1, 0, 0, 0, 56, 388, 1, 0, 0, 0, 58, 424, 1, 0, 0, 0, 60, 443, 1, 0, 0, 0, 62, 455, 1, 0, 0, 0, 64, 463, 1, 0, 0, 0, 66, 484, 1, 0, 0, 0, 68, 488, 1, 0, 0, 0, 70, 491, 1, 0, 0, 0, 72, 496, 1, 0, 0, 0, 74, 521, 1, 0, 0, 0, 76, 533, 1, 0, 0, 0, 78, 535, 1, 0, 0, 0, 80, 537, 1, 0, 0, 0, 82, 562, 1, 0, 0, 0, 84, 575, 1, 0, 0, 0, 86, 578, 1, 0, 0, 0, 88, 583, 1, 0, 0, 0, 90, 608, 1, 0, 0, 0, 92, 625, 1, 0, 0, 0, 94, 627, 1, 0, 0, 0, 96, 629, 1, 0, 0, 0, 98, 631, 1, 0, 0, 0, 100, 664, 1, 0, 0, 0, 102, 666, 1, 0, 0, 0, 104, 678, 1, 0, 0, 0, 106, 695, 1, 0, 0, 0, 108, 706, 1, 0, 0, 0, 110, 709, 1, 0, 0, 0, 112, 717, 1, 0, 0, 0, 114, 745, 1, 0, 0, 0, 116, 755, 1, 0, 0, 0, 118, 782, 1, 0, 0, 0, 120, 791, 1, 0, 0, 0, 122, 813, 1, 0, 0, 0, 124, 818, 1, 0, 0, 0, 126, 837, 1, 0, 0, 0, 128, 839, 1, 0, 0, 0, 130, 864, 1, 0, 0, 0, 132, 877, 1, 0, 0, 0, 134, 885, 1, 0, 0, 0, 136, 892, 1, 0, 0, 0, 138, 894, 1, 0, 0, 0, 140, 917, 1, 0, 0, 0, 142, 920, 1, 0, 0, 0, 144, 926, 1, 0, 0, 0, 146, 928, 1, 0, 0, 0, 148, 930, 1, 0, 0, 0, 150, 934, 1, 0, 0, 0, 152, 943, 1, 0, 0, 0, 154, 158, 5, 37, 0, 0, 155, 158, 5, 31, 0, 0, 156, 158, 3, 2, 1, 0, 157, 154, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 156, 1, 0, 0, 0, 158, 161, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 162, 1, 0, 0, 0, 161, 159, 1, 0, 0, 0, 162, 163, 5, 0, 0, 1, 163, 1, 1, 0, 0, 0, 164, 170, 3, 12, 6, 0, 165, 170, 3, 34, 17, 0, 166, 170, 3, 68, 34, 0, 167, 170, 3, 84, 42, 0, 168, 170, 3, 108, 54, 0, 169, 164, 1, 0, 0, 0, 169, 165, 1, 0, 0, 0, 169, 166, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 168, 1, 0, 0, 0, 170, 3, 1, 0, 0, 0, 171, 172, 3, 6, 3, 0, 172, 173, 5, 37, 0, 0, 173, 175, 1, 0, 0, 0, 174, 171, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 5, 1, 0, 0, 0, 178, 179, 5, 1, 0, 0, 179, 181, 5, 33, 0, 0, 180, 182, 3, 8, 4, 0, 181, 180, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 7, 1, 0, 0, 0, 183, 184, 5, 2, 0, 0, 184, 189, 3, 10, 5, 0, 185, 186, 5, 3, 0, 0, 186, 188, 3, 10, 5, 0, 187, 185, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 192, 193, 5, 4, 0, 0, 193, 9, 1, 0, 0, 0, 194, 196, 5, 33, 0, 0, 195, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 11, 1, 0, 0, 0, 199, 203, 5, 5, 0, 0, 200, 202, 5, 37, 0, 0, 201, 200, 1, 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 206, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 210, 5, 6, 0, 0, 207, 209, 5, 37, 0, 0, 208, 207, 1, 0, 0, 0, 209, 212, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 216, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 215, 3, 14, 7, 0, 214, 213, 1, 0, 0, 0, 215, 218, 1, 0, 0, 0, 216, 214, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 219, 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 219, 220, 5, 7, 0, 0, 220, 13, 1, 0, 0, 0, 221, 223, 3, 16, 8, 0, 222, 221, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 228, 3, 18, 9, 0, 225, 227, 5, 37, 0, 0, 226, 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 15, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 5, 33, 0, 0, 232, 17, 1, 0, 0, 0, 233, 234, 3, 20, 10, 0, 234, 235, 5, 8, 0, 0, 235, 236, 3, 22, 11, 0, 236, 19, 1, 0, 0, 0, 237, 238, 7, 0, 0, 0, 238, 21, 1, 0, 0, 0, 239, 244, 5, 33, 0, 0, 240, 241, 5, 8, 0, 0, 241, 243, 5, 33, 0, 0, 242, 240, 1, 0, 0, 0, 243, 246, 1, 0, 0, 0, 244, 242, 1, 0, 0, 0, 244, 245, 1, 0, 0, 0, 245, 23, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 247, 250, 3, 26, 13, 0, 248, 250, 3, 28, 14, 0, 249, 247, 1, 0, 0, 0, 249, 248, 1, 0, 0, 0, 250, 25, 1, 0, 0, 0, 251, 252, 5, 33, 0, 0, 252, 27, 1, 0, 0, 0, 253, 256, 3, 30, 15, 0, 254, 255, 5, 10, 0, 0, 255, 257, 3, 32, 16, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 29, 1, 0, 0, 0, 258, 259, 5, 33, 0, 0, 259, 31, 1, 0, 0, 0, 260, 261, 5, 33, 0, 0, 261, 33, 1, 0, 0, 0, 262, 265, 3, 36, 18, 0, 263, 265, 3, 38, 19, 0, 264, 262, 1, 0, 0, 0, 264, 263, 1, 0, 0, 0, 265, 35, 1, 0, 0, 0, 266, 268, 5, 32, 0, 0, 267, 266, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 270, 5, 11, 0, 0, 270, 271, 3, 40, 20, 0, 271, 37, 1, 0, 0, 0, 272, 276, 5, 11, 0, 0, 273, 275, 5, 37, 0, 0, 274, 273, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 279, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 283, 5, 6, 0, 0, 280, 282, 5, 37, 0, 0, 281, 280, 1, 0, 0, 0, 282, 285, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, 284, 1, 0, 0, 0, 284, 298, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 286, 288, 5, 32, 0, 0, 287, 286, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 293, 3, 40, 20, 0, 290, 292, 5, 37, 0, 0, 291, 290, 1, 0, 0, 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, 297, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 296, 287, 1, 0, 0, 0, 297, 300, 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 301, 1, 0, 0, 0, 300, 298, 1, 0, 0, 0, 301, 302, 5, 7, 0, 0, 302, 39, 1, 0, 0, 0, 303, 305, 5, 33, 0, 0, 304, 306, 3, 42, 21, 0, 305, 304, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 308, 1, 0, 0, 0, 307, 309, 3, 48, 24, 0, 308, 307, 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 41, 1, 0, 0, 0, 310, 314, 5, 12, 0, 0, 311, 313, 5, 37, 0, 0, 312, 311, 1, 0, 0, 0, 313, 316, 1, 0, 0, 0, 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 318, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 317, 319, 3, 44, 22, 0, 318, 317, 1, 0, 0, 0, 318, 319, 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 321, 5, 13, 0, 0, 321, 43, 1, 0, 0, 0, 322, 339, 3, 46, 23, 0, 323, 327, 5, 3, 0, 0, 324, 326, 5, 37, 0, 0, 325, 324, 1, 0, 0, 0, 326, 329, 1, 0, 0, 0, 327, 325, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 330, 1, 0, 0, 0, 329, 327, 1, 0, 0, 0, 330, 334, 3, 46, 23, 0, 331, 333, 5, 37, 0, 0, 332, 331, 1, 0, 0, 0, 333, 336, 1, 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 338, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 337, 323, 1, 0, 0, 0, 338, 341, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 45, 1, 0, 0, 0, 341, 339, 1, 0, 0, 0, 342, 344, 5, 33, 0, 0, 343, 345, 3, 48, 24, 0, 344, 343, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 47, 1, 0, 0, 0, 346, 350, 3, 50, 25, 0, 347, 350, 3, 54, 27, 0, 348, 350, 3, 64, 32, 0, 349, 346, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 350, 49, 1, 0, 0, 0, 351, 353, 3, 24, 12, 0, 352, 354, 3, 52, 26, 0, 353, 352, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 51, 1, 0, 0, 0, 355, 359, 5, 12, 0, 0, 356, 358, 5, 37, 0, 0, 357, 356, 1, 0, 0, 0, 358, 361, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 359, 360, 1, 0, 0, 0, 360, 362, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 362, 373, 3, 48, 24, 0, 363, 367, 5, 3, 0, 0, 364, 366, 5, 37, 0, 0, 365, 364, 1, 0, 0, 0, 366, 369, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 370, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, 370, 372, 3, 48, 24, 0, 371, 363, 1, 0, 0, 0, 372, 375, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 379, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0, 376, 378, 5, 37, 0, 0, 377, 376, 1, 0, 0, 0, 378, 381, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 382, 1, 0, 0, 0, 381, 379, 1, 0, 0, 0, 382, 383, 5, 13, 0, 0, 383, 53, 1, 0, 0, 0, 384, 387, 3, 56, 28, 0, 385, 387, 3, 58, 29, 0, 386, 384, 1, 0, 0, 0, 386, 385, 1, 0, 0, 0, 387, 55, 1, 0, 0, 0, 388, 392, 5, 14, 0, 0, 389, 391, 5, 37, 0, 0, 390, 389, 1, 0, 0, 0, 391, 394, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 392, 393, 1, 0, 0, 0, 393, 395, 1, 0, 0, 0, 394, 392, 1, 0, 0, 0, 395, 399, 5, 6, 0, 0, 396, 398, 5, 37, 0, 0, 397, 396, 1, 0, 0, 0, 398, 401, 1, 0, 0, 0, 399, 397, 1, 0, 0, 0, 399, 400, 1, 0, 0, 0, 400, 402, 1, 0, 0, 0, 401, 399, 1, 0, 0, 0, 402, 413, 5, 33, 0, 0, 403, 407, 5, 3, 0, 0, 404, 406, 5, 37, 0, 0, 405, 404, 1, 0, 0, 0, 406, 409, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 407, 408, 1, 0, 0, 0, 408, 410, 1, 0, 0, 0, 409, 407, 1, 0, 0, 0, 410, 412, 5, 33, 0, 0, 411, 403, 1, 0, 0, 0, 412, 415, 1, 0, 0, 0, 413, 411, 1, 0, 0, 0, 413, 414, 1, 0, 0, 0, 414, 419, 1, 0, 0, 0, 415, 413, 1, 0, 0, 0, 416, 418, 5, 37, 0, 0, 417, 416, 1, 0, 0, 0, 418, 421, 1, 0, 0, 0, 419, 417, 1, 0, 0, 0, 419, 420, 1, 0, 0, 0, 420, 422, 1, 0, 0, 0, 421, 419, 1, 0, 0, 0, 422, 423, 5, 7, 0, 0, 423, 57, 1, 0, 0, 0, 424, 428, 5, 15, 0, 0, 425, 427, 5, 37, 0, 0, 426, 425, 1, 0, 0, 0, 427, 430, 1, 0, 0, 0, 428, 426, 1, 0, 0, 0, 428, 429, 1, 0, 0, 0, 429, 431, 1, 0, 0, 0, 430, 428, 1, 0, 0, 0, 431, 435, 5, 6, 0, 0, 432, 434, 5, 37, 0, 0, 433, 432, 1, 0, 0, 0, 434, 437, 1, 0, 0, 0, 435, 433, 1, 0, 0, 0, 435, 436, 1, 0, 0, 0, 436, 439, 1, 0, 0, 0, 437, 435, 1, 0, 0, 0, 438, 440, 3, 60, 30, 0, 439, 438, 1, 0, 0, 0, 439, 440, 1, 0, 0, 0, 440, 441, 1, 0, 0, 0, 441, 442, 5, 7, 0, 0, 442, 59, 1, 0, 0, 0, 443, 452, 3, 62, 31, 0, 444, 446, 5, 37, 0, 0, 445, 444, 1, 0, 0, 0, 446, 447, 1, 0, 0, 0, 447, 445, 1, 0, 0, 0, 447, 448, 1, 0, 0, 0, 448, 449, 1, 0, 0, 0, 449, 451, 3, 62, 31, 0, 450, 445, 1, 0, 0, 0, 451, 454, 1, 0, 0, 0, 452, 450, 1, 0, 0, 0, 452, 453, 1, 0, 0, 0, 453, 61, 1, 0, 0, 0, 454, 452, 1, 0, 0, 0, 455, 456, 5, 33, 0, 0, 456, 460, 3, 48, 24, 0, 457, 459, 5, 37, 0, 0, 458, 457, 1, 0, 0, 0, 459, 462, 1, 0, 0, 0, 460, 458, 1, 0, 0, 0, 460, 461, 1, 0, 0, 0, 461, 63, 1, 0, 0, 0, 462, 460, 1, 0, 0, 0, 463, 478, 3, 66, 33, 0, 464, 466, 5, 37, 0, 0, 465, 464, 1, 0, 0, 0, 466, 469, 1, 0, 0, 0, 467, 465, 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 470, 1, 0, 0, 0, 469, 467, 1, 0, 0, 0, 470, 474, 5, 16, 0, 0, 471, 473, 5, 37, 0, 0, 472, 471, 1, 0, 0, 0, 473, 476, 1, 0, 0, 0, 474, 472, 1, 0, 0, 0, 474, 475, 1, 0, 0, 0, 475, 477, 1, 0, 0, 0, 476, 474, 1, 0, 0, 0, 477, 479, 3, 66, 33, 0, 478, 467, 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 478, 1, 0, 0, 0, 480, 481, 1, 0, 0, 0, 481, 65, 1, 0, 0, 0, 482, 485, 3, 50, 25, 0, 483, 485, 3, 54, 27, 0, 484, 482, 1, 0, 0, 0, 484, 483, 1, 0, 0, 0, 485, 67, 1, 0, 0, 0, 486, 489, 3, 70, 35, 0, 487, 489, 3, 72, 36, 0, 488, 486, 1, 0, 0, 0, 488, 487, 1, 0, 0, 0, 489, 69, 1, 0, 0, 0, 490, 492, 5, 32, 0, 0, 491, 490, 1, 0, 0, 0, 491, 492, 1, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 494, 5, 17, 0, 0, 494, 495, 3, 74, 37, 0, 495, 71, 1, 0, 0, 0, 496, 500, 5, 17, 0, 0, 497, 499, 5, 37, 0, 0, 498, 497, 1, 0, 0, 0, 499, 502, 1, 0, 0, 0, 500, 498, 1, 0, 0, 0, 500, 501, 1, 0, 0, 0, 501, 503, 1, 0, 0, 0, 502, 500, 1, 0, 0, 0, 503, 507, 5, 6, 0, 0, 504, 506, 5, 37, 0, 0, 505, 504, 1, 0, 0, 0, 506, 509, 1, 0, 0, 0, 507, 505, 1, 0, 0, 0, 507, 508, 1, 0, 0, 0, 508, 516, 1, 0, 0, 0, 509, 507, 1, 0, 0, 0, 510, 512, 5, 32, 0, 0, 511, 510, 1, 0, 0, 0, 511, 512, 1, 0, 0, 0, 512, 513, 1, 0, 0, 0, 513, 515, 3, 74, 37, 0, 514, 511, 1, 0, 0, 0, 515, 518, 1, 0, 0, 0, 516, 514, 1, 0, 0, 0, 516, 517, 1, 0, 0, 0, 517, 519, 1, 0, 0, 0, 518, 516, 1, 0, 0, 0, 519, 520, 5, 7, 0, 0, 520, 73, 1, 0, 0, 0, 521, 523, 5, 33, 0, 0, 522, 524, 3, 42, 21, 0, 523, 522, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, 0, 0, 0, 525, 526, 3, 76, 38, 0, 526, 530, 3, 78, 39, 0, 527, 529, 5, 37, 0, 0, 528, 527, 1, 0, 0, 0, 529, 532, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 530, 531, 1, 0, 0, 0, 531, 75, 1, 0, 0, 0, 532, 530, 1, 0, 0, 0, 533, 534, 3, 80, 40, 0, 534, 77, 1, 0, 0, 0, 535, 536, 3, 80, 40, 0, 536, 79, 1, 0, 0, 0, 537, 555, 5, 2, 0, 0, 538, 540, 5, 37, 0, 0, 539, 538, 1, 0, 0, 0, 540, 543, 1, 0, 0, 0, 541, 539, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, 556, 1, 0, 0, 0, 543, 541, 1, 0, 0, 0, 544, 546, 3, 82, 41, 0, 545, 544, 1, 0, 0, 0, 545, 546, 1, 0, 0, 0, 546, 556, 1, 0, 0, 0, 547, 552, 3, 82, 41, 0, 548, 549, 5, 3, 0, 0, 549, 551, 3, 82, 41, 0, 550, 548, 1, 0, 0, 0, 551, 554, 1, 0, 0, 0, 552, 550, 1, 0, 0, 0, 552, 553, 1, 0, 0, 0, 553, 556, 1, 0, 0, 0, 554, 552, 1, 0, 0, 0, 555, 541, 1, 0, 0, 0, 555, 545, 1, 0, 0, 0, 555, 547, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 5, 4, 0, 0, 558, 81, 1, 0, 0, 0, 559, 561, 5, 37, 0, 0, 560, 559, 1, 0, 0, 0, 561, 564, 1, 0, 0, 0, 562, 560, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, 565, 1, 0, 0, 0, 564, 562, 1, 0, 0, 0, 565, 566, 5, 33, 0, 0, 566, 570, 3, 48, 24, 0, 567, 569, 5, 37, 0, 0, 568, 567, 1, 0, 0, 0, 569, 572, 1, 0, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 83, 1, 0, 0, 0, 572, 570, 1, 0, 0, 0, 573, 576, 3, 86, 43, 0, 574, 576, 3, 88, 44, 0, 575, 573, 1, 0, 0, 0, 575, 574, 1, 0, 0, 0, 576, 85, 1, 0, 0, 0, 577, 579, 5, 32, 0, 0, 578, 577, 1, 0, 0, 0, 578, 579, 1, 0, 0, 0, 579, 580, 1, 0, 0, 0, 580, 581, 5, 18, 0, 0, 581, 582, 3, 90, 45, 0, 582, 87, 1, 0, 0, 0, 583, 587, 5, 18, 0, 0, 584, 586, 5, 37, 0, 0, 585, 584, 1, 0, 0, 0, 586, 589, 1, 0, 0, 0, 587, 585, 1, 0, 0, 0, 587, 588, 1, 0, 0, 0, 588, 590, 1, 0, 0, 0, 589, 587, 1, 0, 0, 0, 590, 594, 5, 6, 0, 0, 591, 593, 5, 37, 0, 0, 592, 591, 1, 0, 0, 0, 593, 596, 1, 0, 0, 0, 594, 592, 1, 0, 0, 0, 594, 595, 1, 0, 0, 0, 595, 603, 1, 0, 0, 0, 596, 594, 1, 0, 0, 0, 597, 599, 5, 32, 0, 0, 598, 597, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, 599, 600, 1, 0, 0, 0, 600, 602, 3, 90, 45, 0, 601, 598, 1, 0, 0, 0, 602, 605, 1, 0, 0, 0, 603, 601, 1, 0, 0, 0, 603, 604, 1, 0, 0, 0, 604, 606, 1, 0, 0, 0, 605, 603, 1, 0, 0, 0, 606, 607, 5, 7, 0, 0, 607, 89, 1, 0, 0, 0, 608, 609, 5, 33, 0, 0, 609, 610, 5, 19, 0, 0, 610, 611, 3, 48, 24, 0, 611, 615, 3, 92, 46, 0, 612, 614, 5, 37, 0, 0, 613, 612, 1, 0, 0, 0, 614, 617, 1, 0, 0, 0, 615, 613, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 91, 1, 0, 0, 0, 617, 615, 1, 0, 0, 0, 618, 626, 3, 96, 48, 0, 619, 626, 3, 94, 47, 0, 620, 626, 5, 34, 0, 0, 621, 626, 5, 35, 0, 0, 622, 626, 5, 36, 0, 0, 623, 626, 3, 98, 49, 0, 624, 626, 3, 102, 51, 0, 625, 618, 1, 0, 0, 0, 625, 619, 1, 0, 0, 0, 625, 620, 1, 0, 0, 0, 625, 621, 1, 0, 0, 0, 625, 622, 1, 0, 0, 0, 625, 623, 1, 0, 0, 0, 625, 624, 1, 0, 0, 0, 626, 93, 1, 0, 0, 0, 627, 628, 7, 1, 0, 0, 628, 95, 1, 0, 0, 0, 629, 630, 5, 22, 0, 0, 630, 97, 1, 0, 0, 0, 631, 635, 5, 23, 0, 0, 632, 634, 5, 37, 0, 0, 633, 632, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 639, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 640, 3, 100, 50, 0, 639, 638, 1, 0, 0, 0, 639, 640, 1, 0, 0, 0, 640, 641, 1, 0, 0, 0, 641, 642, 5, 24, 0, 0, 642, 99, 1, 0, 0, 0, 643, 665, 3, 92, 46, 0, 644, 661, 3, 92, 46, 0, 645, 649, 5, 3, 0, 0, 646, 648, 5, 37, 0, 0, 647, 646, 1, 0, 0, 0, 648, 651, 1, 0, 0, 0, 649, 647, 1, 0, 0, 0, 649, 650, 1, 0, 0, 0, 650, 652, 1, 0, 0, 0, 651, 649, 1, 0, 0, 0, 652, 656, 3, 92, 46, 0, 653, 655, 5, 37, 0, 0, 654, 653, 1, 0, 0, 0, 655, 658, 1, 0, 0, 0, 656, 654, 1, 0, 0, 0, 656, 657, 1, 0, 0, 0, 657, 660, 1, 0, 0, 0, 658, 656, 1, 0, 0, 0, 659, 645, 1, 0, 0, 0, 660, 663, 1, 0, 0, 0, 661, 659, 1, 0, 0, 0, 661, 662, 1, 0, 0, 0, 662, 665, 1, 0, 0, 0, 663, 661, 1, 0, 0, 0, 664, 643, 1, 0, 0, 0, 664, 644, 1, 0, 0, 0, 665, 101, 1, 0, 0, 0, 666, 670, 5, 6, 0, 0, 667, 669, 5, 37, 0, 0, 668, 667, 1, 0, 0, 0, 669, 672, 1, 0, 0, 0, 670, 668, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 671, 674, 1, 0, 0, 0, 672, 670, 1, 0, 0, 0, 673, 675, 3, 104, 52, 0, 674, 673, 1, 0, 0, 0, 674, 675, 1, 0, 0, 0, 675, 676, 1, 0, 0, 0, 676, 677, 5, 7, 0, 0, 677, 103, 1, 0, 0, 0, 678, 689, 3, 106, 53, 0, 679, 683, 5, 3, 0, 0, 680, 682, 5, 37, 0, 0, 681, 680, 1, 0, 0, 0, 682, 685, 1, 0, 0, 0, 683, 681, 1, 0, 0, 0, 683, 684, 1, 0, 0, 0, 684, 686, 1, 0, 0, 0, 685, 683, 1, 0, 0, 0, 686, 688, 3, 106, 53, 0, 687, 679, 1, 0, 0, 0, 688, 691, 1, 0, 0, 0, 689, 687, 1, 0, 0, 0, 689, 690, 1, 0, 0, 0, 690, 693, 1, 0, 0, 0, 691, 689, 1, 0, 0, 0, 692, 694, 5, 3, 0, 0, 693, 692, 1, 0, 0, 0, 693, 694, 1, 0, 0, 0, 694, 105, 1, 0, 0, 0, 695, 696, 5, 33, 0, 0, 696, 697, 5, 25, 0, 0, 697, 701, 3, 92, 46, 0, 698, 700, 5, 37, 0, 0, 699, 698, 1, 0, 0, 0, 700, 703, 1, 0, 0, 0, 701, 699, 1, 0, 0, 0, 701, 702, 1, 0, 0, 0, 702, 107, 1, 0, 0, 0, 703, 701, 1, 0, 0, 0, 704, 707, 3, 110, 55, 0, 705, 707, 3, 112, 56, 0, 706, 704, 1, 0, 0, 0, 706, 705, 1, 0, 0, 0, 707, 109, 1, 0, 0, 0, 708, 710, 3, 4, 2, 0, 709, 708, 1, 0, 0, 0, 709, 710, 1, 0, 0, 0, 710, 712, 1, 0, 0, 0, 711, 713, 5, 32, 0, 0, 712, 711, 1, 0, 0, 0, 712, 713, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 715, 5, 26, 0, 0, 715, 716, 3, 114, 57, 0, 716, 111, 1, 0, 0, 0, 717, 721, 5, 26, 0, 0, 718, 720, 5, 37, 0, 0, 719, 718, 1, 0, 0, 0, 720, 723, 1, 0, 0, 0, 721, 719, 1, 0, 0, 0, 721, 722, 1, 0, 0, 0, 722, 724, 1, 0, 0, 0, 723, 721, 1, 0, 0, 0, 724, 728, 5, 6, 0, 0, 725, 727, 5, 37, 0, 0, 726, 725, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 726, 1, 0, 0, 0, 728, 729, 1, 0, 0, 0, 729, 740, 1, 0, 0, 0, 730, 728, 1, 0, 0, 0, 731, 733, 3, 4, 2, 0, 732, 731, 1, 0, 0, 0, 732, 733, 1, 0, 0, 0, 733, 735, 1, 0, 0, 0, 734, 736, 5, 32, 0, 0, 735, 734, 1, 0, 0, 0, 735, 736, 1, 0, 0, 0, 736, 737, 1, 0, 0, 0, 737, 739, 3, 114, 57, 0, 738, 732, 1, 0, 0, 0, 739, 742, 1, 0, 0, 0, 740, 738, 1, 0, 0, 0, 740, 741, 1, 0, 0, 0, 741, 743, 1, 0, 0, 0, 742, 740, 1, 0, 0, 0, 743, 744, 5, 7, 0, 0, 744, 113, 1, 0, 0, 0, 745, 747, 3, 74, 37, 0, 746, 748, 3, 116, 58, 0, 747, 746, 1, 0, 0, 0, 747, 748, 1, 0, 0, 0, 748, 752, 1, 0, 0, 0, 749, 751, 5, 37, 0, 0, 750, 749, 1, 0, 0, 0, 751, 754, 1, 0, 0, 0, 752, 750, 1, 0, 0, 0, 752, 753, 1, 0, 0, 0, 753, 115, 1, 0, 0, 0, 754, 752, 1, 0, 0, 0, 755, 759, 5, 6, 0, 0, 756, 758, 5, 37, 0, 0, 757, 756, 1, 0, 0, 0, 758, 761, 1, 0, 0, 0, 759, 757, 1, 0, 0, 0, 759, 760, 1, 0, 0, 0, 760, 769, 1, 0, 0, 0, 761, 759, 1, 0, 0, 0, 762, 766, 3, 118, 59, 0, 763, 765, 5, 37, 0, 0, 764, 763, 1, 0, 0, 0, 765, 768, 1, 0, 0, 0, 766, 764, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 770, 1, 0, 0, 0, 768, 766, 1, 0, 0, 0, 769, 762, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, 778, 1, 0, 0, 0, 771, 775, 3, 128, 64, 0, 772, 774, 5, 37, 0, 0, 773, 772, 1, 0, 0, 0, 774, 777, 1, 0, 0, 0, 775, 773, 1, 0, 0, 0, 775, 776, 1, 0, 0, 0, 776, 779, 1, 0, 0, 0, 777, 775, 1, 0, 0, 0, 778, 771, 1, 0, 0, 0, 778, 779, 1, 0, 0, 0, 779, 780, 1, 0, 0, 0, 780, 781, 5, 7, 0, 0, 781, 117, 1, 0, 0, 0, 782, 786, 5, 27, 0, 0, 783, 785, 5, 37, 0, 0, 784, 783, 1, 0, 0, 0, 785, 788, 1, 0, 0, 0, 786, 784, 1, 0, 0, 0, 786, 787, 1, 0, 0, 0, 787, 789, 1, 0, 0, 0, 788, 786, 1, 0, 0, 0, 789, 790, 3, 120, 60, 0, 790, 119, 1, 0, 0, 0, 791, 795, 5, 6, 0, 0, 792, 794, 5, 37, 0, 0, 793, 792, 1, 0, 0, 0, 794, 797, 1, 0, 0, 0, 795, 793, 1, 0, 0, 0, 795, 796, 1, 0, 0, 0, 796, 807, 1, 0, 0, 0, 797, 795, 1, 0, 0, 0, 798, 802, 3, 122, 61, 0, 799, 801, 5, 37, 0, 0, 800, 799, 1, 0, 0, 0, 801, 804, 1, 0, 0, 0, 802, 800, 1, 0, 0, 0, 802, 803, 1, 0, 0, 0, 803, 806, 1, 0, 0, 0, 804, 802, 1, 0, 0, 0, 805, 798, 1, 0, 0, 0, 806, 809, 1, 0, 0, 0, 807, 805, 1, 0, 0, 0, 807, 808, 1, 0, 0, 0, 808, 810, 1, 0, 0, 0, 809, 807, 1, 0, 0, 0, 810, 811, 5, 7, 0, 0, 811, 121, 1, 0, 0, 0, 812, 814, 3, 4, 2, 0, 813, 812, 1, 0, 0, 0, 813, 814, 1, 0, 0, 0, 814, 815, 1, 0, 0, 0, 815, 816, 5, 33, 0, 0, 816, 817, 3, 124, 62, 0, 817, 123, 1, 0, 0, 0, 818, 822, 3, 24, 12, 0, 819, 821, 5, 37, 0, 0, 820, 819, 1, 0, 0, 0, 821, 824, 1, 0, 0, 0, 822, 820, 1, 0, 0, 0, 822, 823, 1, 0, 0, 0, 823, 826, 1, 0, 0, 0, 824, 822, 1, 0, 0, 0, 825, 827, 3, 52, 26, 0, 826, 825, 1, 0, 0, 0, 826, 827, 1, 0, 0, 0, 827, 831, 1, 0, 0, 0, 828, 830, 5, 37, 0, 0, 829, 828, 1, 0, 0, 0, 830, 833, 1, 0, 0, 0, 831, 829, 1, 0, 0, 0, 831, 832, 1, 0, 0, 0, 832, 835, 1, 0, 0, 0, 833, 831, 1, 0, 0, 0, 834, 836, 3, 126, 63, 0, 835, 834, 1, 0, 0, 0, 835, 836, 1, 0, 0, 0, 836, 125, 1, 0, 0, 0, 837, 838, 3, 120, 60, 0, 838, 127, 1, 0, 0, 0, 839, 843, 5, 28, 0, 0, 840, 842, 5, 37, 0, 0, 841, 840, 1, 0, 0, 0, 842, 845, 1, 0, 0, 0, 843, 841, 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 846, 1, 0, 0, 0, 845, 843, 1, 0, 0, 0, 846, 850, 5, 6, 0, 0, 847, 849, 5, 37, 0, 0, 848, 847, 1, 0, 0, 0, 849, 852, 1, 0, 0, 0, 850, 848, 1, 0, 0, 0, 850, 851, 1, 0, 0, 0, 851, 854, 1, 0, 0, 0, 852, 850, 1, 0, 0, 0, 853, 855, 3, 130, 65, 0, 854, 853, 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 859, 1, 0, 0, 0, 856, 858, 5, 37, 0, 0, 857, 856, 1, 0, 0, 0, 858, 861, 1, 0, 0, 0, 859, 857, 1, 0, 0, 0, 859, 860, 1, 0, 0, 0, 860, 862, 1, 0, 0, 0, 861, 859, 1, 0, 0, 0, 862, 863, 5, 7, 0, 0, 863, 129, 1, 0, 0, 0, 864, 874, 3, 132, 66, 0, 865, 867, 5, 37, 0, 0, 866, 865, 1, 0, 0, 0, 867, 870, 1, 0, 0, 0, 868, 866, 1, 0, 0, 0, 868, 869, 1, 0, 0, 0, 869, 871, 1, 0, 0, 0, 870, 868, 1, 0, 0, 0, 871, 873, 3, 132, 66, 0, 872, 868, 1, 0, 0, 0, 873, 876, 1, 0, 0, 0, 874, 872, 1, 0, 0, 0, 874, 875, 1, 0, 0, 0, 875, 131, 1, 0, 0, 0, 876, 874, 1, 0, 0, 0, 877, 878, 3, 134, 67, 0, 878, 881, 5, 29, 0, 0, 879, 882, 3, 136, 68, 0, 880, 882, 3, 152, 76, 0, 881, 879, 1, 0, 0, 0, 881, 880, 1, 0, 0, 0, 882, 133, 1, 0, 0, 0, 883, 886, 3, 142, 71, 0, 884, 886, 3, 140, 70, 0, 885, 883, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 888, 1, 0, 0, 0, 887, 889, 3, 150, 75, 0, 888, 887, 1, 0, 0, 0, 888, 889, 1, 0, 0, 0, 889, 135, 1, 0, 0, 0, 890, 893, 3, 142, 71, 0, 891, 893, 3, 138, 69, 0, 892, 890, 1, 0, 0, 0, 892, 891, 1, 0, 0, 0, 893, 137, 1, 0, 0, 0, 894, 898, 5, 2, 0, 0, 895, 897, 5, 37, 0, 0, 896, 895, 1, 0, 0, 0, 897, 900, 1, 0, 0, 0, 898, 896, 1, 0, 0, 0, 898, 899, 1, 0, 0, 0, 899, 901, 1, 0, 0, 0, 900, 898, 1, 0, 0, 0, 901, 906, 3, 132, 66, 0, 902, 903, 5, 37, 0, 0, 903, 905, 3, 132, 66, 0, 904, 902, 1, 0, 0, 0, 905, 908, 1, 0, 0, 0, 906, 904, 1, 0, 0, 0, 906, 907, 1, 0, 0, 0, 907, 912, 1, 0, 0, 0, 908, 906, 1, 0, 0, 0, 909, 911, 5, 37, 0, 0, 910, 909, 1, 0, 0, 0, 911, 914, 1, 0, 0, 0, 912, 910, 1, 0, 0, 0, 912, 913, 1, 0, 0, 0, 913, 915, 1, 0, 0, 0, 914, 912, 1, 0, 0, 0, 915, 916, 5, 4, 0, 0, 916, 139, 1, 0, 0, 0, 917, 918, 5, 30, 0, 0, 918, 919, 3, 24, 12, 0, 919, 141, 1, 0, 0, 0, 920, 921, 3, 144, 72, 0, 921, 922, 5, 25, 0, 0, 922, 924, 3, 146, 73, 0, 923, 925, 3, 148, 74, 0, 924, 923, 1, 0, 0, 0, 924, 925, 1, 0, 0, 0, 925, 143, 1, 0, 0, 0, 926, 927, 5, 33, 0, 0, 927, 145, 1, 0, 0, 0, 928, 929, 5, 33, 0, 0, 929, 147, 1, 0, 0, 0, 930, 931, 5, 23, 0, 0, 931, 932, 5, 34, 0, 0, 932, 933, 5, 24, 0, 0, 933, 149, 1, 0, 0, 0, 934, 935, 5, 10, 0, 0, 935, 940, 5, 33, 0, 0, 936, 937, 5, 10, 0, 0, 937, 939, 5, 33, 0, 0, 938, 936, 1, 0, 0, 0, 939, 942, 1, 0, 0, 0, 940, 938, 1, 0, 0, 0, 940, 941, 1, 0, 0, 0, 941, 151, 1, 0, 0, 0, 942, 940, 1, 0, 0, 0, 943, 947, 5, 23, 0, 0, 944, 946, 5, 37, 0, 0, 945, 944, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, 945, 1, 0, 0, 0, 947, 948, 1, 0, 0, 0, 948, 950, 1, 0, 0, 0, 949, 947, 1, 0, 0, 0, 950, 967, 3, 136, 68, 0, 951, 955, 5, 3, 0, 0, 952, 954, 5, 37, 0, 0, 953, 952, 1, 0, 0, 0, 954, 957, 1, 0, 0, 0, 955, 953, 1, 0, 0, 0, 955, 956, 1, 0, 0, 0, 956, 958, 1, 0, 0, 0, 957, 955, 1, 0, 0, 0, 958, 962, 3, 136, 68, 0, 959, 961, 5, 37, 0, 0, 960, 959, 1, 0, 0, 0, 961, 964, 1, 0, 0, 0, 962, 960, 1, 0, 0, 0, 962, 963, 1, 0, 0, 0, 963, 966, 1, 0, 0, 0, 964, 962, 1, 0, 0, 0, 965, 951, 1, 0, 0, 0, 966, 969, 1, 0, 0, 0, 967, 965, 1, 0, 0, 0, 967, 968, 1, 0, 0, 0, 968, 970, 1, 0, 0, 0, 969, 967, 1, 0, 0, 0, 970, 971, 5, 24, 0, 0, 971, 153, 1, 0, 0, 0, 129, 157, 159, 169, 176, 181, 189, 197, 203, 210, 216, 222, 228, 244, 249, 256, 264, 267, 276, 283, 287, 293, 298, 305, 308, 314, 318, 327, 334, 339, 344, 349, 353, 359, 367, 373, 379, 386, 392, 399, 407, 413, 419, 428, 435, 439, 447, 452, 460, 467, 474, 480, 484, 488, 491, 500, 507, 511, 516, 523, 530, 541, 545, 552, 555, 562, 570, 575, 578, 587, 594, 598, 603, 615, 625, 635, 639, 649, 656, 661, 664, 670, 674, 683, 689, 693, 701, 706, 709, 712, 721, 728, 732, 735, 740, 747, 752, 759, 766, 769, 775, 778, 786, 795, 802, 807, 813, 822, 826, 831, 835, 843, 850, 854, 859, 868, 874, 881, 885, 888, 892, 898, 906, 912, 924, 940, 947, 955, 962, 967] \ No newline at end of file diff --git a/internal/compiler/parser/generated/neva.tokens b/internal/compiler/parser/generated/neva.tokens index 76eb1106..d41b40ab 100644 --- a/internal/compiler/parser/generated/neva.tokens +++ b/internal/compiler/parser/generated/neva.tokens @@ -27,14 +27,15 @@ T__25=26 T__26=27 T__27=28 T__28=29 -COMMENT=30 -PUB_KW=31 -IDENTIFIER=32 -INT=33 -FLOAT=34 -STRING=35 -NEWLINE=36 -WS=37 +T__29=30 +COMMENT=31 +PUB_KW=32 +IDENTIFIER=33 +INT=34 +FLOAT=35 +STRING=36 +NEWLINE=37 +WS=38 '#'=1 '('=2 ','=3 @@ -45,23 +46,24 @@ WS=37 '/'=8 '@'=9 '.'=10 -'types'=11 +'type'=11 '<'=12 '>'=13 'enum'=14 -'['=15 -']'=16 -'struct'=17 -'|'=18 -'interfaces'=19 -'const'=20 -'true'=21 -'false'=22 -'nil'=23 -':'=24 -'components'=25 -'nodes'=26 -'net'=27 -'->'=28 -'$'=29 -'pub'=31 +'struct'=15 +'|'=16 +'interface'=17 +'const'=18 +'='=19 +'true'=20 +'false'=21 +'nil'=22 +'['=23 +']'=24 +':'=25 +'component'=26 +'nodes'=27 +'net'=28 +'->'=29 +'$'=30 +'pub'=32 diff --git a/internal/compiler/parser/generated/nevaLexer.interp b/internal/compiler/parser/generated/nevaLexer.interp index da1aeb4b..41c5cbd0 100644 --- a/internal/compiler/parser/generated/nevaLexer.interp +++ b/internal/compiler/parser/generated/nevaLexer.interp @@ -10,21 +10,22 @@ null '/' '@' '.' -'types' +'type' '<' '>' 'enum' -'[' -']' 'struct' '|' -'interfaces' +'interface' 'const' +'=' 'true' 'false' 'nil' +'[' +']' ':' -'components' +'component' 'nodes' 'net' '->' @@ -69,6 +70,7 @@ null null null null +null COMMENT PUB_KW IDENTIFIER @@ -108,6 +110,7 @@ T__25 T__26 T__27 T__28 +T__29 COMMENT PUB_KW IDENTIFIER @@ -126,4 +129,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 37, 251, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 195, 8, 29, 10, 29, 12, 29, 198, 9, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 5, 31, 207, 8, 31, 10, 31, 12, 31, 210, 9, 31, 1, 32, 1, 32, 1, 33, 4, 33, 215, 8, 33, 11, 33, 12, 33, 216, 1, 34, 5, 34, 220, 8, 34, 10, 34, 12, 34, 223, 9, 34, 1, 34, 1, 34, 4, 34, 227, 8, 34, 11, 34, 12, 34, 228, 1, 35, 1, 35, 5, 35, 233, 8, 35, 10, 35, 12, 35, 236, 9, 35, 1, 35, 1, 35, 1, 36, 3, 36, 241, 8, 36, 1, 36, 1, 36, 1, 37, 4, 37, 246, 8, 37, 11, 37, 12, 37, 247, 1, 37, 1, 37, 1, 234, 0, 38, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 0, 67, 33, 69, 34, 71, 35, 73, 36, 75, 37, 1, 0, 4, 2, 0, 10, 10, 13, 13, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 9, 9, 32, 32, 258, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 1, 77, 1, 0, 0, 0, 3, 79, 1, 0, 0, 0, 5, 81, 1, 0, 0, 0, 7, 83, 1, 0, 0, 0, 9, 85, 1, 0, 0, 0, 11, 92, 1, 0, 0, 0, 13, 94, 1, 0, 0, 0, 15, 96, 1, 0, 0, 0, 17, 98, 1, 0, 0, 0, 19, 100, 1, 0, 0, 0, 21, 102, 1, 0, 0, 0, 23, 108, 1, 0, 0, 0, 25, 110, 1, 0, 0, 0, 27, 112, 1, 0, 0, 0, 29, 117, 1, 0, 0, 0, 31, 119, 1, 0, 0, 0, 33, 121, 1, 0, 0, 0, 35, 128, 1, 0, 0, 0, 37, 130, 1, 0, 0, 0, 39, 141, 1, 0, 0, 0, 41, 147, 1, 0, 0, 0, 43, 152, 1, 0, 0, 0, 45, 158, 1, 0, 0, 0, 47, 162, 1, 0, 0, 0, 49, 164, 1, 0, 0, 0, 51, 175, 1, 0, 0, 0, 53, 181, 1, 0, 0, 0, 55, 185, 1, 0, 0, 0, 57, 188, 1, 0, 0, 0, 59, 190, 1, 0, 0, 0, 61, 199, 1, 0, 0, 0, 63, 203, 1, 0, 0, 0, 65, 211, 1, 0, 0, 0, 67, 214, 1, 0, 0, 0, 69, 221, 1, 0, 0, 0, 71, 230, 1, 0, 0, 0, 73, 240, 1, 0, 0, 0, 75, 245, 1, 0, 0, 0, 77, 78, 5, 35, 0, 0, 78, 2, 1, 0, 0, 0, 79, 80, 5, 40, 0, 0, 80, 4, 1, 0, 0, 0, 81, 82, 5, 44, 0, 0, 82, 6, 1, 0, 0, 0, 83, 84, 5, 41, 0, 0, 84, 8, 1, 0, 0, 0, 85, 86, 5, 105, 0, 0, 86, 87, 5, 109, 0, 0, 87, 88, 5, 112, 0, 0, 88, 89, 5, 111, 0, 0, 89, 90, 5, 114, 0, 0, 90, 91, 5, 116, 0, 0, 91, 10, 1, 0, 0, 0, 92, 93, 5, 123, 0, 0, 93, 12, 1, 0, 0, 0, 94, 95, 5, 125, 0, 0, 95, 14, 1, 0, 0, 0, 96, 97, 5, 47, 0, 0, 97, 16, 1, 0, 0, 0, 98, 99, 5, 64, 0, 0, 99, 18, 1, 0, 0, 0, 100, 101, 5, 46, 0, 0, 101, 20, 1, 0, 0, 0, 102, 103, 5, 116, 0, 0, 103, 104, 5, 121, 0, 0, 104, 105, 5, 112, 0, 0, 105, 106, 5, 101, 0, 0, 106, 107, 5, 115, 0, 0, 107, 22, 1, 0, 0, 0, 108, 109, 5, 60, 0, 0, 109, 24, 1, 0, 0, 0, 110, 111, 5, 62, 0, 0, 111, 26, 1, 0, 0, 0, 112, 113, 5, 101, 0, 0, 113, 114, 5, 110, 0, 0, 114, 115, 5, 117, 0, 0, 115, 116, 5, 109, 0, 0, 116, 28, 1, 0, 0, 0, 117, 118, 5, 91, 0, 0, 118, 30, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 32, 1, 0, 0, 0, 121, 122, 5, 115, 0, 0, 122, 123, 5, 116, 0, 0, 123, 124, 5, 114, 0, 0, 124, 125, 5, 117, 0, 0, 125, 126, 5, 99, 0, 0, 126, 127, 5, 116, 0, 0, 127, 34, 1, 0, 0, 0, 128, 129, 5, 124, 0, 0, 129, 36, 1, 0, 0, 0, 130, 131, 5, 105, 0, 0, 131, 132, 5, 110, 0, 0, 132, 133, 5, 116, 0, 0, 133, 134, 5, 101, 0, 0, 134, 135, 5, 114, 0, 0, 135, 136, 5, 102, 0, 0, 136, 137, 5, 97, 0, 0, 137, 138, 5, 99, 0, 0, 138, 139, 5, 101, 0, 0, 139, 140, 5, 115, 0, 0, 140, 38, 1, 0, 0, 0, 141, 142, 5, 99, 0, 0, 142, 143, 5, 111, 0, 0, 143, 144, 5, 110, 0, 0, 144, 145, 5, 115, 0, 0, 145, 146, 5, 116, 0, 0, 146, 40, 1, 0, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 114, 0, 0, 149, 150, 5, 117, 0, 0, 150, 151, 5, 101, 0, 0, 151, 42, 1, 0, 0, 0, 152, 153, 5, 102, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 108, 0, 0, 155, 156, 5, 115, 0, 0, 156, 157, 5, 101, 0, 0, 157, 44, 1, 0, 0, 0, 158, 159, 5, 110, 0, 0, 159, 160, 5, 105, 0, 0, 160, 161, 5, 108, 0, 0, 161, 46, 1, 0, 0, 0, 162, 163, 5, 58, 0, 0, 163, 48, 1, 0, 0, 0, 164, 165, 5, 99, 0, 0, 165, 166, 5, 111, 0, 0, 166, 167, 5, 109, 0, 0, 167, 168, 5, 112, 0, 0, 168, 169, 5, 111, 0, 0, 169, 170, 5, 110, 0, 0, 170, 171, 5, 101, 0, 0, 171, 172, 5, 110, 0, 0, 172, 173, 5, 116, 0, 0, 173, 174, 5, 115, 0, 0, 174, 50, 1, 0, 0, 0, 175, 176, 5, 110, 0, 0, 176, 177, 5, 111, 0, 0, 177, 178, 5, 100, 0, 0, 178, 179, 5, 101, 0, 0, 179, 180, 5, 115, 0, 0, 180, 52, 1, 0, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 101, 0, 0, 183, 184, 5, 116, 0, 0, 184, 54, 1, 0, 0, 0, 185, 186, 5, 45, 0, 0, 186, 187, 5, 62, 0, 0, 187, 56, 1, 0, 0, 0, 188, 189, 5, 36, 0, 0, 189, 58, 1, 0, 0, 0, 190, 191, 5, 47, 0, 0, 191, 192, 5, 47, 0, 0, 192, 196, 1, 0, 0, 0, 193, 195, 8, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 60, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 199, 200, 5, 112, 0, 0, 200, 201, 5, 117, 0, 0, 201, 202, 5, 98, 0, 0, 202, 62, 1, 0, 0, 0, 203, 208, 3, 65, 32, 0, 204, 207, 3, 65, 32, 0, 205, 207, 3, 67, 33, 0, 206, 204, 1, 0, 0, 0, 206, 205, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 64, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 7, 1, 0, 0, 212, 66, 1, 0, 0, 0, 213, 215, 7, 2, 0, 0, 214, 213, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 214, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 68, 1, 0, 0, 0, 218, 220, 7, 2, 0, 0, 219, 218, 1, 0, 0, 0, 220, 223, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 224, 1, 0, 0, 0, 223, 221, 1, 0, 0, 0, 224, 226, 5, 46, 0, 0, 225, 227, 7, 2, 0, 0, 226, 225, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 70, 1, 0, 0, 0, 230, 234, 5, 39, 0, 0, 231, 233, 9, 0, 0, 0, 232, 231, 1, 0, 0, 0, 233, 236, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 234, 232, 1, 0, 0, 0, 235, 237, 1, 0, 0, 0, 236, 234, 1, 0, 0, 0, 237, 238, 5, 39, 0, 0, 238, 72, 1, 0, 0, 0, 239, 241, 5, 13, 0, 0, 240, 239, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 243, 5, 10, 0, 0, 243, 74, 1, 0, 0, 0, 244, 246, 7, 3, 0, 0, 245, 244, 1, 0, 0, 0, 246, 247, 1, 0, 0, 0, 247, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 250, 6, 37, 0, 0, 250, 76, 1, 0, 0, 0, 10, 0, 196, 206, 208, 216, 221, 228, 234, 240, 247, 1, 0, 1, 0] \ No newline at end of file +[4, 0, 38, 252, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 5, 30, 196, 8, 30, 10, 30, 12, 30, 199, 9, 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 5, 32, 208, 8, 32, 10, 32, 12, 32, 211, 9, 32, 1, 33, 1, 33, 1, 34, 4, 34, 216, 8, 34, 11, 34, 12, 34, 217, 1, 35, 5, 35, 221, 8, 35, 10, 35, 12, 35, 224, 9, 35, 1, 35, 1, 35, 4, 35, 228, 8, 35, 11, 35, 12, 35, 229, 1, 36, 1, 36, 5, 36, 234, 8, 36, 10, 36, 12, 36, 237, 9, 36, 1, 36, 1, 36, 1, 37, 3, 37, 242, 8, 37, 1, 37, 1, 37, 1, 38, 4, 38, 247, 8, 38, 11, 38, 12, 38, 248, 1, 38, 1, 38, 1, 235, 0, 39, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 0, 69, 34, 71, 35, 73, 36, 75, 37, 77, 38, 1, 0, 4, 2, 0, 10, 10, 13, 13, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, 48, 57, 2, 0, 9, 9, 32, 32, 259, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 1, 79, 1, 0, 0, 0, 3, 81, 1, 0, 0, 0, 5, 83, 1, 0, 0, 0, 7, 85, 1, 0, 0, 0, 9, 87, 1, 0, 0, 0, 11, 94, 1, 0, 0, 0, 13, 96, 1, 0, 0, 0, 15, 98, 1, 0, 0, 0, 17, 100, 1, 0, 0, 0, 19, 102, 1, 0, 0, 0, 21, 104, 1, 0, 0, 0, 23, 109, 1, 0, 0, 0, 25, 111, 1, 0, 0, 0, 27, 113, 1, 0, 0, 0, 29, 118, 1, 0, 0, 0, 31, 125, 1, 0, 0, 0, 33, 127, 1, 0, 0, 0, 35, 137, 1, 0, 0, 0, 37, 143, 1, 0, 0, 0, 39, 145, 1, 0, 0, 0, 41, 150, 1, 0, 0, 0, 43, 156, 1, 0, 0, 0, 45, 160, 1, 0, 0, 0, 47, 162, 1, 0, 0, 0, 49, 164, 1, 0, 0, 0, 51, 166, 1, 0, 0, 0, 53, 176, 1, 0, 0, 0, 55, 182, 1, 0, 0, 0, 57, 186, 1, 0, 0, 0, 59, 189, 1, 0, 0, 0, 61, 191, 1, 0, 0, 0, 63, 200, 1, 0, 0, 0, 65, 204, 1, 0, 0, 0, 67, 212, 1, 0, 0, 0, 69, 215, 1, 0, 0, 0, 71, 222, 1, 0, 0, 0, 73, 231, 1, 0, 0, 0, 75, 241, 1, 0, 0, 0, 77, 246, 1, 0, 0, 0, 79, 80, 5, 35, 0, 0, 80, 2, 1, 0, 0, 0, 81, 82, 5, 40, 0, 0, 82, 4, 1, 0, 0, 0, 83, 84, 5, 44, 0, 0, 84, 6, 1, 0, 0, 0, 85, 86, 5, 41, 0, 0, 86, 8, 1, 0, 0, 0, 87, 88, 5, 105, 0, 0, 88, 89, 5, 109, 0, 0, 89, 90, 5, 112, 0, 0, 90, 91, 5, 111, 0, 0, 91, 92, 5, 114, 0, 0, 92, 93, 5, 116, 0, 0, 93, 10, 1, 0, 0, 0, 94, 95, 5, 123, 0, 0, 95, 12, 1, 0, 0, 0, 96, 97, 5, 125, 0, 0, 97, 14, 1, 0, 0, 0, 98, 99, 5, 47, 0, 0, 99, 16, 1, 0, 0, 0, 100, 101, 5, 64, 0, 0, 101, 18, 1, 0, 0, 0, 102, 103, 5, 46, 0, 0, 103, 20, 1, 0, 0, 0, 104, 105, 5, 116, 0, 0, 105, 106, 5, 121, 0, 0, 106, 107, 5, 112, 0, 0, 107, 108, 5, 101, 0, 0, 108, 22, 1, 0, 0, 0, 109, 110, 5, 60, 0, 0, 110, 24, 1, 0, 0, 0, 111, 112, 5, 62, 0, 0, 112, 26, 1, 0, 0, 0, 113, 114, 5, 101, 0, 0, 114, 115, 5, 110, 0, 0, 115, 116, 5, 117, 0, 0, 116, 117, 5, 109, 0, 0, 117, 28, 1, 0, 0, 0, 118, 119, 5, 115, 0, 0, 119, 120, 5, 116, 0, 0, 120, 121, 5, 114, 0, 0, 121, 122, 5, 117, 0, 0, 122, 123, 5, 99, 0, 0, 123, 124, 5, 116, 0, 0, 124, 30, 1, 0, 0, 0, 125, 126, 5, 124, 0, 0, 126, 32, 1, 0, 0, 0, 127, 128, 5, 105, 0, 0, 128, 129, 5, 110, 0, 0, 129, 130, 5, 116, 0, 0, 130, 131, 5, 101, 0, 0, 131, 132, 5, 114, 0, 0, 132, 133, 5, 102, 0, 0, 133, 134, 5, 97, 0, 0, 134, 135, 5, 99, 0, 0, 135, 136, 5, 101, 0, 0, 136, 34, 1, 0, 0, 0, 137, 138, 5, 99, 0, 0, 138, 139, 5, 111, 0, 0, 139, 140, 5, 110, 0, 0, 140, 141, 5, 115, 0, 0, 141, 142, 5, 116, 0, 0, 142, 36, 1, 0, 0, 0, 143, 144, 5, 61, 0, 0, 144, 38, 1, 0, 0, 0, 145, 146, 5, 116, 0, 0, 146, 147, 5, 114, 0, 0, 147, 148, 5, 117, 0, 0, 148, 149, 5, 101, 0, 0, 149, 40, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, 5, 97, 0, 0, 152, 153, 5, 108, 0, 0, 153, 154, 5, 115, 0, 0, 154, 155, 5, 101, 0, 0, 155, 42, 1, 0, 0, 0, 156, 157, 5, 110, 0, 0, 157, 158, 5, 105, 0, 0, 158, 159, 5, 108, 0, 0, 159, 44, 1, 0, 0, 0, 160, 161, 5, 91, 0, 0, 161, 46, 1, 0, 0, 0, 162, 163, 5, 93, 0, 0, 163, 48, 1, 0, 0, 0, 164, 165, 5, 58, 0, 0, 165, 50, 1, 0, 0, 0, 166, 167, 5, 99, 0, 0, 167, 168, 5, 111, 0, 0, 168, 169, 5, 109, 0, 0, 169, 170, 5, 112, 0, 0, 170, 171, 5, 111, 0, 0, 171, 172, 5, 110, 0, 0, 172, 173, 5, 101, 0, 0, 173, 174, 5, 110, 0, 0, 174, 175, 5, 116, 0, 0, 175, 52, 1, 0, 0, 0, 176, 177, 5, 110, 0, 0, 177, 178, 5, 111, 0, 0, 178, 179, 5, 100, 0, 0, 179, 180, 5, 101, 0, 0, 180, 181, 5, 115, 0, 0, 181, 54, 1, 0, 0, 0, 182, 183, 5, 110, 0, 0, 183, 184, 5, 101, 0, 0, 184, 185, 5, 116, 0, 0, 185, 56, 1, 0, 0, 0, 186, 187, 5, 45, 0, 0, 187, 188, 5, 62, 0, 0, 188, 58, 1, 0, 0, 0, 189, 190, 5, 36, 0, 0, 190, 60, 1, 0, 0, 0, 191, 192, 5, 47, 0, 0, 192, 193, 5, 47, 0, 0, 193, 197, 1, 0, 0, 0, 194, 196, 8, 0, 0, 0, 195, 194, 1, 0, 0, 0, 196, 199, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 62, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 200, 201, 5, 112, 0, 0, 201, 202, 5, 117, 0, 0, 202, 203, 5, 98, 0, 0, 203, 64, 1, 0, 0, 0, 204, 209, 3, 67, 33, 0, 205, 208, 3, 67, 33, 0, 206, 208, 3, 69, 34, 0, 207, 205, 1, 0, 0, 0, 207, 206, 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 66, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 212, 213, 7, 1, 0, 0, 213, 68, 1, 0, 0, 0, 214, 216, 7, 2, 0, 0, 215, 214, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 70, 1, 0, 0, 0, 219, 221, 7, 2, 0, 0, 220, 219, 1, 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 225, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 227, 5, 46, 0, 0, 226, 228, 7, 2, 0, 0, 227, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229, 230, 1, 0, 0, 0, 230, 72, 1, 0, 0, 0, 231, 235, 5, 39, 0, 0, 232, 234, 9, 0, 0, 0, 233, 232, 1, 0, 0, 0, 234, 237, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 236, 238, 1, 0, 0, 0, 237, 235, 1, 0, 0, 0, 238, 239, 5, 39, 0, 0, 239, 74, 1, 0, 0, 0, 240, 242, 5, 13, 0, 0, 241, 240, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 244, 5, 10, 0, 0, 244, 76, 1, 0, 0, 0, 245, 247, 7, 3, 0, 0, 246, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 6, 38, 0, 0, 251, 78, 1, 0, 0, 0, 10, 0, 197, 207, 209, 217, 222, 229, 235, 241, 248, 1, 0, 1, 0] \ No newline at end of file diff --git a/internal/compiler/parser/generated/nevaLexer.tokens b/internal/compiler/parser/generated/nevaLexer.tokens index 76eb1106..d41b40ab 100644 --- a/internal/compiler/parser/generated/nevaLexer.tokens +++ b/internal/compiler/parser/generated/nevaLexer.tokens @@ -27,14 +27,15 @@ T__25=26 T__26=27 T__27=28 T__28=29 -COMMENT=30 -PUB_KW=31 -IDENTIFIER=32 -INT=33 -FLOAT=34 -STRING=35 -NEWLINE=36 -WS=37 +T__29=30 +COMMENT=31 +PUB_KW=32 +IDENTIFIER=33 +INT=34 +FLOAT=35 +STRING=36 +NEWLINE=37 +WS=38 '#'=1 '('=2 ','=3 @@ -45,23 +46,24 @@ WS=37 '/'=8 '@'=9 '.'=10 -'types'=11 +'type'=11 '<'=12 '>'=13 'enum'=14 -'['=15 -']'=16 -'struct'=17 -'|'=18 -'interfaces'=19 -'const'=20 -'true'=21 -'false'=22 -'nil'=23 -':'=24 -'components'=25 -'nodes'=26 -'net'=27 -'->'=28 -'$'=29 -'pub'=31 +'struct'=15 +'|'=16 +'interface'=17 +'const'=18 +'='=19 +'true'=20 +'false'=21 +'nil'=22 +'['=23 +']'=24 +':'=25 +'component'=26 +'nodes'=27 +'net'=28 +'->'=29 +'$'=30 +'pub'=32 diff --git a/internal/compiler/parser/generated/neva_base_listener.go b/internal/compiler/parser/generated/neva_base_listener.go index 9dc169c1..ba44ed88 100644 --- a/internal/compiler/parser/generated/neva_base_listener.go +++ b/internal/compiler/parser/generated/neva_base_listener.go @@ -128,6 +128,18 @@ func (s *BasenevaListener) EnterTypeStmt(ctx *TypeStmtContext) {} // ExitTypeStmt is called when production typeStmt is exited. func (s *BasenevaListener) ExitTypeStmt(ctx *TypeStmtContext) {} +// EnterSingleTypeStmt is called when production singleTypeStmt is entered. +func (s *BasenevaListener) EnterSingleTypeStmt(ctx *SingleTypeStmtContext) {} + +// ExitSingleTypeStmt is called when production singleTypeStmt is exited. +func (s *BasenevaListener) ExitSingleTypeStmt(ctx *SingleTypeStmtContext) {} + +// EnterGroupTypeStmt is called when production groupTypeStmt is entered. +func (s *BasenevaListener) EnterGroupTypeStmt(ctx *GroupTypeStmtContext) {} + +// ExitGroupTypeStmt is called when production groupTypeStmt is exited. +func (s *BasenevaListener) ExitGroupTypeStmt(ctx *GroupTypeStmtContext) {} + // EnterTypeDef is called when production typeDef is entered. func (s *BasenevaListener) EnterTypeDef(ctx *TypeDefContext) {} @@ -182,12 +194,6 @@ func (s *BasenevaListener) EnterEnumTypeExpr(ctx *EnumTypeExprContext) {} // ExitEnumTypeExpr is called when production enumTypeExpr is exited. func (s *BasenevaListener) ExitEnumTypeExpr(ctx *EnumTypeExprContext) {} -// EnterArrTypeExpr is called when production arrTypeExpr is entered. -func (s *BasenevaListener) EnterArrTypeExpr(ctx *ArrTypeExprContext) {} - -// ExitArrTypeExpr is called when production arrTypeExpr is exited. -func (s *BasenevaListener) ExitArrTypeExpr(ctx *ArrTypeExprContext) {} - // EnterStructTypeExpr is called when production structTypeExpr is entered. func (s *BasenevaListener) EnterStructTypeExpr(ctx *StructTypeExprContext) {} @@ -224,6 +230,18 @@ func (s *BasenevaListener) EnterInterfaceStmt(ctx *InterfaceStmtContext) {} // ExitInterfaceStmt is called when production interfaceStmt is exited. func (s *BasenevaListener) ExitInterfaceStmt(ctx *InterfaceStmtContext) {} +// EnterSingleInterfaceStmt is called when production singleInterfaceStmt is entered. +func (s *BasenevaListener) EnterSingleInterfaceStmt(ctx *SingleInterfaceStmtContext) {} + +// ExitSingleInterfaceStmt is called when production singleInterfaceStmt is exited. +func (s *BasenevaListener) ExitSingleInterfaceStmt(ctx *SingleInterfaceStmtContext) {} + +// EnterGroupInterfaceStmt is called when production groupInterfaceStmt is entered. +func (s *BasenevaListener) EnterGroupInterfaceStmt(ctx *GroupInterfaceStmtContext) {} + +// ExitGroupInterfaceStmt is called when production groupInterfaceStmt is exited. +func (s *BasenevaListener) ExitGroupInterfaceStmt(ctx *GroupInterfaceStmtContext) {} + // EnterInterfaceDef is called when production interfaceDef is entered. func (s *BasenevaListener) EnterInterfaceDef(ctx *InterfaceDefContext) {} @@ -260,6 +278,18 @@ func (s *BasenevaListener) EnterConstStmt(ctx *ConstStmtContext) {} // ExitConstStmt is called when production constStmt is exited. func (s *BasenevaListener) ExitConstStmt(ctx *ConstStmtContext) {} +// EnterSingleConstStmt is called when production singleConstStmt is entered. +func (s *BasenevaListener) EnterSingleConstStmt(ctx *SingleConstStmtContext) {} + +// ExitSingleConstStmt is called when production singleConstStmt is exited. +func (s *BasenevaListener) ExitSingleConstStmt(ctx *SingleConstStmtContext) {} + +// EnterGroupConstStmt is called when production groupConstStmt is entered. +func (s *BasenevaListener) EnterGroupConstStmt(ctx *GroupConstStmtContext) {} + +// ExitGroupConstStmt is called when production groupConstStmt is exited. +func (s *BasenevaListener) ExitGroupConstStmt(ctx *GroupConstStmtContext) {} + // EnterConstDef is called when production constDef is entered. func (s *BasenevaListener) EnterConstDef(ctx *ConstDefContext) {} @@ -284,11 +314,11 @@ func (s *BasenevaListener) EnterNil(ctx *NilContext) {} // ExitNil is called when production nil is exited. func (s *BasenevaListener) ExitNil(ctx *NilContext) {} -// EnterArrLit is called when production arrLit is entered. -func (s *BasenevaListener) EnterArrLit(ctx *ArrLitContext) {} +// EnterListLit is called when production listLit is entered. +func (s *BasenevaListener) EnterListLit(ctx *ListLitContext) {} -// ExitArrLit is called when production arrLit is exited. -func (s *BasenevaListener) ExitArrLit(ctx *ArrLitContext) {} +// ExitListLit is called when production listLit is exited. +func (s *BasenevaListener) ExitListLit(ctx *ListLitContext) {} // EnterListItems is called when production listItems is entered. func (s *BasenevaListener) EnterListItems(ctx *ListItemsContext) {} @@ -320,6 +350,18 @@ func (s *BasenevaListener) EnterCompStmt(ctx *CompStmtContext) {} // ExitCompStmt is called when production compStmt is exited. func (s *BasenevaListener) ExitCompStmt(ctx *CompStmtContext) {} +// EnterSingleCompStmt is called when production singleCompStmt is entered. +func (s *BasenevaListener) EnterSingleCompStmt(ctx *SingleCompStmtContext) {} + +// ExitSingleCompStmt is called when production singleCompStmt is exited. +func (s *BasenevaListener) ExitSingleCompStmt(ctx *SingleCompStmtContext) {} + +// EnterGroupCompStmt is called when production groupCompStmt is entered. +func (s *BasenevaListener) EnterGroupCompStmt(ctx *GroupCompStmtContext) {} + +// ExitGroupCompStmt is called when production groupCompStmt is exited. +func (s *BasenevaListener) ExitGroupCompStmt(ctx *GroupCompStmtContext) {} + // EnterCompDef is called when production compDef is entered. func (s *BasenevaListener) EnterCompDef(ctx *CompDefContext) {} diff --git a/internal/compiler/parser/generated/neva_lexer.go b/internal/compiler/parser/generated/neva_lexer.go index df20ee11..a32ad676 100644 --- a/internal/compiler/parser/generated/neva_lexer.go +++ b/internal/compiler/parser/generated/neva_lexer.go @@ -44,133 +44,134 @@ func nevalexerLexerInit() { } staticData.LiteralNames = []string{ "", "'#'", "'('", "','", "')'", "'import'", "'{'", "'}'", "'/'", "'@'", - "'.'", "'types'", "'<'", "'>'", "'enum'", "'['", "']'", "'struct'", - "'|'", "'interfaces'", "'const'", "'true'", "'false'", "'nil'", "':'", - "'components'", "'nodes'", "'net'", "'->'", "'$'", "", "'pub'", + "'.'", "'type'", "'<'", "'>'", "'enum'", "'struct'", "'|'", "'interface'", + "'const'", "'='", "'true'", "'false'", "'nil'", "'['", "']'", "':'", + "'component'", "'nodes'", "'net'", "'->'", "'$'", "", "'pub'", } staticData.SymbolicNames = []string{ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "", "COMMENT", "PUB_KW", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "COMMENT", "PUB_KW", "IDENTIFIER", "INT", "FLOAT", "STRING", "NEWLINE", "WS", } staticData.RuleNames = []string{ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", - "T__25", "T__26", "T__27", "T__28", "COMMENT", "PUB_KW", "IDENTIFIER", + "T__25", "T__26", "T__27", "T__28", "T__29", "COMMENT", "PUB_KW", "IDENTIFIER", "LETTER", "INT", "FLOAT", "STRING", "NEWLINE", "WS", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 37, 251, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 38, 252, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, - 7, 36, 2, 37, 7, 37, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, - 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, - 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, - 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, - 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, - 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, - 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, - 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, - 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, - 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, - 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, - 29, 1, 29, 5, 29, 195, 8, 29, 10, 29, 12, 29, 198, 9, 29, 1, 30, 1, 30, - 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 5, 31, 207, 8, 31, 10, 31, 12, 31, 210, - 9, 31, 1, 32, 1, 32, 1, 33, 4, 33, 215, 8, 33, 11, 33, 12, 33, 216, 1, - 34, 5, 34, 220, 8, 34, 10, 34, 12, 34, 223, 9, 34, 1, 34, 1, 34, 4, 34, - 227, 8, 34, 11, 34, 12, 34, 228, 1, 35, 1, 35, 5, 35, 233, 8, 35, 10, 35, - 12, 35, 236, 9, 35, 1, 35, 1, 35, 1, 36, 3, 36, 241, 8, 36, 1, 36, 1, 36, - 1, 37, 4, 37, 246, 8, 37, 11, 37, 12, 37, 247, 1, 37, 1, 37, 1, 234, 0, - 38, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, - 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, - 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, - 29, 59, 30, 61, 31, 63, 32, 65, 0, 67, 33, 69, 34, 71, 35, 73, 36, 75, - 37, 1, 0, 4, 2, 0, 10, 10, 13, 13, 3, 0, 65, 90, 95, 95, 97, 122, 1, 0, - 48, 57, 2, 0, 9, 9, 32, 32, 258, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, - 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, - 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, - 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, - 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, - 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, - 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, - 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, - 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, - 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, - 0, 1, 77, 1, 0, 0, 0, 3, 79, 1, 0, 0, 0, 5, 81, 1, 0, 0, 0, 7, 83, 1, 0, - 0, 0, 9, 85, 1, 0, 0, 0, 11, 92, 1, 0, 0, 0, 13, 94, 1, 0, 0, 0, 15, 96, - 1, 0, 0, 0, 17, 98, 1, 0, 0, 0, 19, 100, 1, 0, 0, 0, 21, 102, 1, 0, 0, - 0, 23, 108, 1, 0, 0, 0, 25, 110, 1, 0, 0, 0, 27, 112, 1, 0, 0, 0, 29, 117, - 1, 0, 0, 0, 31, 119, 1, 0, 0, 0, 33, 121, 1, 0, 0, 0, 35, 128, 1, 0, 0, - 0, 37, 130, 1, 0, 0, 0, 39, 141, 1, 0, 0, 0, 41, 147, 1, 0, 0, 0, 43, 152, - 1, 0, 0, 0, 45, 158, 1, 0, 0, 0, 47, 162, 1, 0, 0, 0, 49, 164, 1, 0, 0, - 0, 51, 175, 1, 0, 0, 0, 53, 181, 1, 0, 0, 0, 55, 185, 1, 0, 0, 0, 57, 188, - 1, 0, 0, 0, 59, 190, 1, 0, 0, 0, 61, 199, 1, 0, 0, 0, 63, 203, 1, 0, 0, - 0, 65, 211, 1, 0, 0, 0, 67, 214, 1, 0, 0, 0, 69, 221, 1, 0, 0, 0, 71, 230, - 1, 0, 0, 0, 73, 240, 1, 0, 0, 0, 75, 245, 1, 0, 0, 0, 77, 78, 5, 35, 0, - 0, 78, 2, 1, 0, 0, 0, 79, 80, 5, 40, 0, 0, 80, 4, 1, 0, 0, 0, 81, 82, 5, - 44, 0, 0, 82, 6, 1, 0, 0, 0, 83, 84, 5, 41, 0, 0, 84, 8, 1, 0, 0, 0, 85, - 86, 5, 105, 0, 0, 86, 87, 5, 109, 0, 0, 87, 88, 5, 112, 0, 0, 88, 89, 5, - 111, 0, 0, 89, 90, 5, 114, 0, 0, 90, 91, 5, 116, 0, 0, 91, 10, 1, 0, 0, - 0, 92, 93, 5, 123, 0, 0, 93, 12, 1, 0, 0, 0, 94, 95, 5, 125, 0, 0, 95, - 14, 1, 0, 0, 0, 96, 97, 5, 47, 0, 0, 97, 16, 1, 0, 0, 0, 98, 99, 5, 64, - 0, 0, 99, 18, 1, 0, 0, 0, 100, 101, 5, 46, 0, 0, 101, 20, 1, 0, 0, 0, 102, - 103, 5, 116, 0, 0, 103, 104, 5, 121, 0, 0, 104, 105, 5, 112, 0, 0, 105, - 106, 5, 101, 0, 0, 106, 107, 5, 115, 0, 0, 107, 22, 1, 0, 0, 0, 108, 109, - 5, 60, 0, 0, 109, 24, 1, 0, 0, 0, 110, 111, 5, 62, 0, 0, 111, 26, 1, 0, - 0, 0, 112, 113, 5, 101, 0, 0, 113, 114, 5, 110, 0, 0, 114, 115, 5, 117, - 0, 0, 115, 116, 5, 109, 0, 0, 116, 28, 1, 0, 0, 0, 117, 118, 5, 91, 0, - 0, 118, 30, 1, 0, 0, 0, 119, 120, 5, 93, 0, 0, 120, 32, 1, 0, 0, 0, 121, - 122, 5, 115, 0, 0, 122, 123, 5, 116, 0, 0, 123, 124, 5, 114, 0, 0, 124, - 125, 5, 117, 0, 0, 125, 126, 5, 99, 0, 0, 126, 127, 5, 116, 0, 0, 127, - 34, 1, 0, 0, 0, 128, 129, 5, 124, 0, 0, 129, 36, 1, 0, 0, 0, 130, 131, - 5, 105, 0, 0, 131, 132, 5, 110, 0, 0, 132, 133, 5, 116, 0, 0, 133, 134, - 5, 101, 0, 0, 134, 135, 5, 114, 0, 0, 135, 136, 5, 102, 0, 0, 136, 137, - 5, 97, 0, 0, 137, 138, 5, 99, 0, 0, 138, 139, 5, 101, 0, 0, 139, 140, 5, - 115, 0, 0, 140, 38, 1, 0, 0, 0, 141, 142, 5, 99, 0, 0, 142, 143, 5, 111, - 0, 0, 143, 144, 5, 110, 0, 0, 144, 145, 5, 115, 0, 0, 145, 146, 5, 116, - 0, 0, 146, 40, 1, 0, 0, 0, 147, 148, 5, 116, 0, 0, 148, 149, 5, 114, 0, - 0, 149, 150, 5, 117, 0, 0, 150, 151, 5, 101, 0, 0, 151, 42, 1, 0, 0, 0, - 152, 153, 5, 102, 0, 0, 153, 154, 5, 97, 0, 0, 154, 155, 5, 108, 0, 0, - 155, 156, 5, 115, 0, 0, 156, 157, 5, 101, 0, 0, 157, 44, 1, 0, 0, 0, 158, - 159, 5, 110, 0, 0, 159, 160, 5, 105, 0, 0, 160, 161, 5, 108, 0, 0, 161, - 46, 1, 0, 0, 0, 162, 163, 5, 58, 0, 0, 163, 48, 1, 0, 0, 0, 164, 165, 5, - 99, 0, 0, 165, 166, 5, 111, 0, 0, 166, 167, 5, 109, 0, 0, 167, 168, 5, - 112, 0, 0, 168, 169, 5, 111, 0, 0, 169, 170, 5, 110, 0, 0, 170, 171, 5, - 101, 0, 0, 171, 172, 5, 110, 0, 0, 172, 173, 5, 116, 0, 0, 173, 174, 5, - 115, 0, 0, 174, 50, 1, 0, 0, 0, 175, 176, 5, 110, 0, 0, 176, 177, 5, 111, - 0, 0, 177, 178, 5, 100, 0, 0, 178, 179, 5, 101, 0, 0, 179, 180, 5, 115, - 0, 0, 180, 52, 1, 0, 0, 0, 181, 182, 5, 110, 0, 0, 182, 183, 5, 101, 0, - 0, 183, 184, 5, 116, 0, 0, 184, 54, 1, 0, 0, 0, 185, 186, 5, 45, 0, 0, - 186, 187, 5, 62, 0, 0, 187, 56, 1, 0, 0, 0, 188, 189, 5, 36, 0, 0, 189, - 58, 1, 0, 0, 0, 190, 191, 5, 47, 0, 0, 191, 192, 5, 47, 0, 0, 192, 196, - 1, 0, 0, 0, 193, 195, 8, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 198, 1, 0, - 0, 0, 196, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 60, 1, 0, 0, 0, - 198, 196, 1, 0, 0, 0, 199, 200, 5, 112, 0, 0, 200, 201, 5, 117, 0, 0, 201, - 202, 5, 98, 0, 0, 202, 62, 1, 0, 0, 0, 203, 208, 3, 65, 32, 0, 204, 207, - 3, 65, 32, 0, 205, 207, 3, 67, 33, 0, 206, 204, 1, 0, 0, 0, 206, 205, 1, - 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, - 0, 209, 64, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 7, 1, 0, 0, 212, - 66, 1, 0, 0, 0, 213, 215, 7, 2, 0, 0, 214, 213, 1, 0, 0, 0, 215, 216, 1, - 0, 0, 0, 216, 214, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 68, 1, 0, 0, - 0, 218, 220, 7, 2, 0, 0, 219, 218, 1, 0, 0, 0, 220, 223, 1, 0, 0, 0, 221, - 219, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 224, 1, 0, 0, 0, 223, 221, - 1, 0, 0, 0, 224, 226, 5, 46, 0, 0, 225, 227, 7, 2, 0, 0, 226, 225, 1, 0, - 0, 0, 227, 228, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, - 229, 70, 1, 0, 0, 0, 230, 234, 5, 39, 0, 0, 231, 233, 9, 0, 0, 0, 232, - 231, 1, 0, 0, 0, 233, 236, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 234, 232, - 1, 0, 0, 0, 235, 237, 1, 0, 0, 0, 236, 234, 1, 0, 0, 0, 237, 238, 5, 39, - 0, 0, 238, 72, 1, 0, 0, 0, 239, 241, 5, 13, 0, 0, 240, 239, 1, 0, 0, 0, - 240, 241, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 243, 5, 10, 0, 0, 243, - 74, 1, 0, 0, 0, 244, 246, 7, 3, 0, 0, 245, 244, 1, 0, 0, 0, 246, 247, 1, - 0, 0, 0, 247, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 249, 1, 0, 0, - 0, 249, 250, 6, 37, 0, 0, 250, 76, 1, 0, 0, 0, 10, 0, 196, 206, 208, 216, - 221, 228, 234, 240, 247, 1, 0, 1, 0, + 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, + 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, + 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, + 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, + 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, + 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, + 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, + 1, 22, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, + 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, + 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, + 30, 1, 30, 1, 30, 5, 30, 196, 8, 30, 10, 30, 12, 30, 199, 9, 30, 1, 31, + 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 5, 32, 208, 8, 32, 10, 32, 12, + 32, 211, 9, 32, 1, 33, 1, 33, 1, 34, 4, 34, 216, 8, 34, 11, 34, 12, 34, + 217, 1, 35, 5, 35, 221, 8, 35, 10, 35, 12, 35, 224, 9, 35, 1, 35, 1, 35, + 4, 35, 228, 8, 35, 11, 35, 12, 35, 229, 1, 36, 1, 36, 5, 36, 234, 8, 36, + 10, 36, 12, 36, 237, 9, 36, 1, 36, 1, 36, 1, 37, 3, 37, 242, 8, 37, 1, + 37, 1, 37, 1, 38, 4, 38, 247, 8, 38, 11, 38, 12, 38, 248, 1, 38, 1, 38, + 1, 235, 0, 39, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, + 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, + 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, + 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 0, 69, 34, 71, 35, + 73, 36, 75, 37, 77, 38, 1, 0, 4, 2, 0, 10, 10, 13, 13, 3, 0, 65, 90, 95, + 95, 97, 122, 1, 0, 48, 57, 2, 0, 9, 9, 32, 32, 259, 0, 1, 1, 0, 0, 0, 0, + 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, + 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, + 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, + 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, + 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, + 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, + 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, + 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, + 0, 65, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, + 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 1, 79, 1, 0, 0, 0, 3, 81, 1, 0, + 0, 0, 5, 83, 1, 0, 0, 0, 7, 85, 1, 0, 0, 0, 9, 87, 1, 0, 0, 0, 11, 94, + 1, 0, 0, 0, 13, 96, 1, 0, 0, 0, 15, 98, 1, 0, 0, 0, 17, 100, 1, 0, 0, 0, + 19, 102, 1, 0, 0, 0, 21, 104, 1, 0, 0, 0, 23, 109, 1, 0, 0, 0, 25, 111, + 1, 0, 0, 0, 27, 113, 1, 0, 0, 0, 29, 118, 1, 0, 0, 0, 31, 125, 1, 0, 0, + 0, 33, 127, 1, 0, 0, 0, 35, 137, 1, 0, 0, 0, 37, 143, 1, 0, 0, 0, 39, 145, + 1, 0, 0, 0, 41, 150, 1, 0, 0, 0, 43, 156, 1, 0, 0, 0, 45, 160, 1, 0, 0, + 0, 47, 162, 1, 0, 0, 0, 49, 164, 1, 0, 0, 0, 51, 166, 1, 0, 0, 0, 53, 176, + 1, 0, 0, 0, 55, 182, 1, 0, 0, 0, 57, 186, 1, 0, 0, 0, 59, 189, 1, 0, 0, + 0, 61, 191, 1, 0, 0, 0, 63, 200, 1, 0, 0, 0, 65, 204, 1, 0, 0, 0, 67, 212, + 1, 0, 0, 0, 69, 215, 1, 0, 0, 0, 71, 222, 1, 0, 0, 0, 73, 231, 1, 0, 0, + 0, 75, 241, 1, 0, 0, 0, 77, 246, 1, 0, 0, 0, 79, 80, 5, 35, 0, 0, 80, 2, + 1, 0, 0, 0, 81, 82, 5, 40, 0, 0, 82, 4, 1, 0, 0, 0, 83, 84, 5, 44, 0, 0, + 84, 6, 1, 0, 0, 0, 85, 86, 5, 41, 0, 0, 86, 8, 1, 0, 0, 0, 87, 88, 5, 105, + 0, 0, 88, 89, 5, 109, 0, 0, 89, 90, 5, 112, 0, 0, 90, 91, 5, 111, 0, 0, + 91, 92, 5, 114, 0, 0, 92, 93, 5, 116, 0, 0, 93, 10, 1, 0, 0, 0, 94, 95, + 5, 123, 0, 0, 95, 12, 1, 0, 0, 0, 96, 97, 5, 125, 0, 0, 97, 14, 1, 0, 0, + 0, 98, 99, 5, 47, 0, 0, 99, 16, 1, 0, 0, 0, 100, 101, 5, 64, 0, 0, 101, + 18, 1, 0, 0, 0, 102, 103, 5, 46, 0, 0, 103, 20, 1, 0, 0, 0, 104, 105, 5, + 116, 0, 0, 105, 106, 5, 121, 0, 0, 106, 107, 5, 112, 0, 0, 107, 108, 5, + 101, 0, 0, 108, 22, 1, 0, 0, 0, 109, 110, 5, 60, 0, 0, 110, 24, 1, 0, 0, + 0, 111, 112, 5, 62, 0, 0, 112, 26, 1, 0, 0, 0, 113, 114, 5, 101, 0, 0, + 114, 115, 5, 110, 0, 0, 115, 116, 5, 117, 0, 0, 116, 117, 5, 109, 0, 0, + 117, 28, 1, 0, 0, 0, 118, 119, 5, 115, 0, 0, 119, 120, 5, 116, 0, 0, 120, + 121, 5, 114, 0, 0, 121, 122, 5, 117, 0, 0, 122, 123, 5, 99, 0, 0, 123, + 124, 5, 116, 0, 0, 124, 30, 1, 0, 0, 0, 125, 126, 5, 124, 0, 0, 126, 32, + 1, 0, 0, 0, 127, 128, 5, 105, 0, 0, 128, 129, 5, 110, 0, 0, 129, 130, 5, + 116, 0, 0, 130, 131, 5, 101, 0, 0, 131, 132, 5, 114, 0, 0, 132, 133, 5, + 102, 0, 0, 133, 134, 5, 97, 0, 0, 134, 135, 5, 99, 0, 0, 135, 136, 5, 101, + 0, 0, 136, 34, 1, 0, 0, 0, 137, 138, 5, 99, 0, 0, 138, 139, 5, 111, 0, + 0, 139, 140, 5, 110, 0, 0, 140, 141, 5, 115, 0, 0, 141, 142, 5, 116, 0, + 0, 142, 36, 1, 0, 0, 0, 143, 144, 5, 61, 0, 0, 144, 38, 1, 0, 0, 0, 145, + 146, 5, 116, 0, 0, 146, 147, 5, 114, 0, 0, 147, 148, 5, 117, 0, 0, 148, + 149, 5, 101, 0, 0, 149, 40, 1, 0, 0, 0, 150, 151, 5, 102, 0, 0, 151, 152, + 5, 97, 0, 0, 152, 153, 5, 108, 0, 0, 153, 154, 5, 115, 0, 0, 154, 155, + 5, 101, 0, 0, 155, 42, 1, 0, 0, 0, 156, 157, 5, 110, 0, 0, 157, 158, 5, + 105, 0, 0, 158, 159, 5, 108, 0, 0, 159, 44, 1, 0, 0, 0, 160, 161, 5, 91, + 0, 0, 161, 46, 1, 0, 0, 0, 162, 163, 5, 93, 0, 0, 163, 48, 1, 0, 0, 0, + 164, 165, 5, 58, 0, 0, 165, 50, 1, 0, 0, 0, 166, 167, 5, 99, 0, 0, 167, + 168, 5, 111, 0, 0, 168, 169, 5, 109, 0, 0, 169, 170, 5, 112, 0, 0, 170, + 171, 5, 111, 0, 0, 171, 172, 5, 110, 0, 0, 172, 173, 5, 101, 0, 0, 173, + 174, 5, 110, 0, 0, 174, 175, 5, 116, 0, 0, 175, 52, 1, 0, 0, 0, 176, 177, + 5, 110, 0, 0, 177, 178, 5, 111, 0, 0, 178, 179, 5, 100, 0, 0, 179, 180, + 5, 101, 0, 0, 180, 181, 5, 115, 0, 0, 181, 54, 1, 0, 0, 0, 182, 183, 5, + 110, 0, 0, 183, 184, 5, 101, 0, 0, 184, 185, 5, 116, 0, 0, 185, 56, 1, + 0, 0, 0, 186, 187, 5, 45, 0, 0, 187, 188, 5, 62, 0, 0, 188, 58, 1, 0, 0, + 0, 189, 190, 5, 36, 0, 0, 190, 60, 1, 0, 0, 0, 191, 192, 5, 47, 0, 0, 192, + 193, 5, 47, 0, 0, 193, 197, 1, 0, 0, 0, 194, 196, 8, 0, 0, 0, 195, 194, + 1, 0, 0, 0, 196, 199, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, 198, 1, 0, + 0, 0, 198, 62, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 200, 201, 5, 112, 0, 0, + 201, 202, 5, 117, 0, 0, 202, 203, 5, 98, 0, 0, 203, 64, 1, 0, 0, 0, 204, + 209, 3, 67, 33, 0, 205, 208, 3, 67, 33, 0, 206, 208, 3, 69, 34, 0, 207, + 205, 1, 0, 0, 0, 207, 206, 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 207, + 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 66, 1, 0, 0, 0, 211, 209, 1, 0, + 0, 0, 212, 213, 7, 1, 0, 0, 213, 68, 1, 0, 0, 0, 214, 216, 7, 2, 0, 0, + 215, 214, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 215, 1, 0, 0, 0, 217, + 218, 1, 0, 0, 0, 218, 70, 1, 0, 0, 0, 219, 221, 7, 2, 0, 0, 220, 219, 1, + 0, 0, 0, 221, 224, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 222, 223, 1, 0, 0, + 0, 223, 225, 1, 0, 0, 0, 224, 222, 1, 0, 0, 0, 225, 227, 5, 46, 0, 0, 226, + 228, 7, 2, 0, 0, 227, 226, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 227, + 1, 0, 0, 0, 229, 230, 1, 0, 0, 0, 230, 72, 1, 0, 0, 0, 231, 235, 5, 39, + 0, 0, 232, 234, 9, 0, 0, 0, 233, 232, 1, 0, 0, 0, 234, 237, 1, 0, 0, 0, + 235, 236, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 236, 238, 1, 0, 0, 0, 237, + 235, 1, 0, 0, 0, 238, 239, 5, 39, 0, 0, 239, 74, 1, 0, 0, 0, 240, 242, + 5, 13, 0, 0, 241, 240, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 243, 1, 0, + 0, 0, 243, 244, 5, 10, 0, 0, 244, 76, 1, 0, 0, 0, 245, 247, 7, 3, 0, 0, + 246, 245, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 246, 1, 0, 0, 0, 248, + 249, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 6, 38, 0, 0, 251, 78, + 1, 0, 0, 0, 10, 0, 197, 207, 209, 217, 222, 229, 235, 241, 248, 1, 0, 1, + 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -240,12 +241,13 @@ const ( nevaLexerT__26 = 27 nevaLexerT__27 = 28 nevaLexerT__28 = 29 - nevaLexerCOMMENT = 30 - nevaLexerPUB_KW = 31 - nevaLexerIDENTIFIER = 32 - nevaLexerINT = 33 - nevaLexerFLOAT = 34 - nevaLexerSTRING = 35 - nevaLexerNEWLINE = 36 - nevaLexerWS = 37 + nevaLexerT__29 = 30 + nevaLexerCOMMENT = 31 + nevaLexerPUB_KW = 32 + nevaLexerIDENTIFIER = 33 + nevaLexerINT = 34 + nevaLexerFLOAT = 35 + nevaLexerSTRING = 36 + nevaLexerNEWLINE = 37 + nevaLexerWS = 38 ) diff --git a/internal/compiler/parser/generated/neva_listener.go b/internal/compiler/parser/generated/neva_listener.go index 344b18d8..fc51d5cc 100644 --- a/internal/compiler/parser/generated/neva_listener.go +++ b/internal/compiler/parser/generated/neva_listener.go @@ -61,6 +61,12 @@ type nevaListener interface { // EnterTypeStmt is called when entering the typeStmt production. EnterTypeStmt(c *TypeStmtContext) + // EnterSingleTypeStmt is called when entering the singleTypeStmt production. + EnterSingleTypeStmt(c *SingleTypeStmtContext) + + // EnterGroupTypeStmt is called when entering the groupTypeStmt production. + EnterGroupTypeStmt(c *GroupTypeStmtContext) + // EnterTypeDef is called when entering the typeDef production. EnterTypeDef(c *TypeDefContext) @@ -88,9 +94,6 @@ type nevaListener interface { // EnterEnumTypeExpr is called when entering the enumTypeExpr production. EnterEnumTypeExpr(c *EnumTypeExprContext) - // EnterArrTypeExpr is called when entering the arrTypeExpr production. - EnterArrTypeExpr(c *ArrTypeExprContext) - // EnterStructTypeExpr is called when entering the structTypeExpr production. EnterStructTypeExpr(c *StructTypeExprContext) @@ -109,6 +112,12 @@ type nevaListener interface { // EnterInterfaceStmt is called when entering the interfaceStmt production. EnterInterfaceStmt(c *InterfaceStmtContext) + // EnterSingleInterfaceStmt is called when entering the singleInterfaceStmt production. + EnterSingleInterfaceStmt(c *SingleInterfaceStmtContext) + + // EnterGroupInterfaceStmt is called when entering the groupInterfaceStmt production. + EnterGroupInterfaceStmt(c *GroupInterfaceStmtContext) + // EnterInterfaceDef is called when entering the interfaceDef production. EnterInterfaceDef(c *InterfaceDefContext) @@ -127,6 +136,12 @@ type nevaListener interface { // EnterConstStmt is called when entering the constStmt production. EnterConstStmt(c *ConstStmtContext) + // EnterSingleConstStmt is called when entering the singleConstStmt production. + EnterSingleConstStmt(c *SingleConstStmtContext) + + // EnterGroupConstStmt is called when entering the groupConstStmt production. + EnterGroupConstStmt(c *GroupConstStmtContext) + // EnterConstDef is called when entering the constDef production. EnterConstDef(c *ConstDefContext) @@ -139,8 +154,8 @@ type nevaListener interface { // EnterNil is called when entering the nil production. EnterNil(c *NilContext) - // EnterArrLit is called when entering the arrLit production. - EnterArrLit(c *ArrLitContext) + // EnterListLit is called when entering the listLit production. + EnterListLit(c *ListLitContext) // EnterListItems is called when entering the listItems production. EnterListItems(c *ListItemsContext) @@ -157,6 +172,12 @@ type nevaListener interface { // EnterCompStmt is called when entering the compStmt production. EnterCompStmt(c *CompStmtContext) + // EnterSingleCompStmt is called when entering the singleCompStmt production. + EnterSingleCompStmt(c *SingleCompStmtContext) + + // EnterGroupCompStmt is called when entering the groupCompStmt production. + EnterGroupCompStmt(c *GroupCompStmtContext) + // EnterCompDef is called when entering the compDef production. EnterCompDef(c *CompDefContext) @@ -271,6 +292,12 @@ type nevaListener interface { // ExitTypeStmt is called when exiting the typeStmt production. ExitTypeStmt(c *TypeStmtContext) + // ExitSingleTypeStmt is called when exiting the singleTypeStmt production. + ExitSingleTypeStmt(c *SingleTypeStmtContext) + + // ExitGroupTypeStmt is called when exiting the groupTypeStmt production. + ExitGroupTypeStmt(c *GroupTypeStmtContext) + // ExitTypeDef is called when exiting the typeDef production. ExitTypeDef(c *TypeDefContext) @@ -298,9 +325,6 @@ type nevaListener interface { // ExitEnumTypeExpr is called when exiting the enumTypeExpr production. ExitEnumTypeExpr(c *EnumTypeExprContext) - // ExitArrTypeExpr is called when exiting the arrTypeExpr production. - ExitArrTypeExpr(c *ArrTypeExprContext) - // ExitStructTypeExpr is called when exiting the structTypeExpr production. ExitStructTypeExpr(c *StructTypeExprContext) @@ -319,6 +343,12 @@ type nevaListener interface { // ExitInterfaceStmt is called when exiting the interfaceStmt production. ExitInterfaceStmt(c *InterfaceStmtContext) + // ExitSingleInterfaceStmt is called when exiting the singleInterfaceStmt production. + ExitSingleInterfaceStmt(c *SingleInterfaceStmtContext) + + // ExitGroupInterfaceStmt is called when exiting the groupInterfaceStmt production. + ExitGroupInterfaceStmt(c *GroupInterfaceStmtContext) + // ExitInterfaceDef is called when exiting the interfaceDef production. ExitInterfaceDef(c *InterfaceDefContext) @@ -337,6 +367,12 @@ type nevaListener interface { // ExitConstStmt is called when exiting the constStmt production. ExitConstStmt(c *ConstStmtContext) + // ExitSingleConstStmt is called when exiting the singleConstStmt production. + ExitSingleConstStmt(c *SingleConstStmtContext) + + // ExitGroupConstStmt is called when exiting the groupConstStmt production. + ExitGroupConstStmt(c *GroupConstStmtContext) + // ExitConstDef is called when exiting the constDef production. ExitConstDef(c *ConstDefContext) @@ -349,8 +385,8 @@ type nevaListener interface { // ExitNil is called when exiting the nil production. ExitNil(c *NilContext) - // ExitArrLit is called when exiting the arrLit production. - ExitArrLit(c *ArrLitContext) + // ExitListLit is called when exiting the listLit production. + ExitListLit(c *ListLitContext) // ExitListItems is called when exiting the listItems production. ExitListItems(c *ListItemsContext) @@ -367,6 +403,12 @@ type nevaListener interface { // ExitCompStmt is called when exiting the compStmt production. ExitCompStmt(c *CompStmtContext) + // ExitSingleCompStmt is called when exiting the singleCompStmt production. + ExitSingleCompStmt(c *SingleCompStmtContext) + + // ExitGroupCompStmt is called when exiting the groupCompStmt production. + ExitGroupCompStmt(c *GroupCompStmtContext) + // ExitCompDef is called when exiting the compDef production. ExitCompDef(c *CompDefContext) diff --git a/internal/compiler/parser/generated/neva_parser.go b/internal/compiler/parser/generated/neva_parser.go index 1437187d..a9982d7b 100644 --- a/internal/compiler/parser/generated/neva_parser.go +++ b/internal/compiler/parser/generated/neva_parser.go @@ -33,34 +33,36 @@ func nevaParserInit() { staticData := &NevaParserStaticData staticData.LiteralNames = []string{ "", "'#'", "'('", "','", "')'", "'import'", "'{'", "'}'", "'/'", "'@'", - "'.'", "'types'", "'<'", "'>'", "'enum'", "'['", "']'", "'struct'", - "'|'", "'interfaces'", "'const'", "'true'", "'false'", "'nil'", "':'", - "'components'", "'nodes'", "'net'", "'->'", "'$'", "", "'pub'", + "'.'", "'type'", "'<'", "'>'", "'enum'", "'struct'", "'|'", "'interface'", + "'const'", "'='", "'true'", "'false'", "'nil'", "'['", "']'", "':'", + "'component'", "'nodes'", "'net'", "'->'", "'$'", "", "'pub'", } staticData.SymbolicNames = []string{ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "", "COMMENT", "PUB_KW", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "COMMENT", "PUB_KW", "IDENTIFIER", "INT", "FLOAT", "STRING", "NEWLINE", "WS", } staticData.RuleNames = []string{ "prog", "stmt", "compilerDirectives", "compilerDirective", "compilerDirectivesArgs", "compiler_directive_arg", "importStmt", "importDef", "importAlias", "importPath", "importPathMod", "importPathPkg", "entityRef", "localEntityRef", - "importedEntityRef", "pkgRef", "entityName", "typeStmt", "typeDef", - "typeParams", "typeParamList", "typeParam", "typeExpr", "typeInstExpr", - "typeArgs", "typeLitExpr", "enumTypeExpr", "arrTypeExpr", "structTypeExpr", - "structFields", "structField", "unionTypeExpr", "nonUnionTypeExpr", - "interfaceStmt", "interfaceDef", "inPortsDef", "outPortsDef", "portsDef", - "portDef", "constStmt", "constDef", "constVal", "bool", "nil", "arrLit", + "importedEntityRef", "pkgRef", "entityName", "typeStmt", "singleTypeStmt", + "groupTypeStmt", "typeDef", "typeParams", "typeParamList", "typeParam", + "typeExpr", "typeInstExpr", "typeArgs", "typeLitExpr", "enumTypeExpr", + "structTypeExpr", "structFields", "structField", "unionTypeExpr", "nonUnionTypeExpr", + "interfaceStmt", "singleInterfaceStmt", "groupInterfaceStmt", "interfaceDef", + "inPortsDef", "outPortsDef", "portsDef", "portDef", "constStmt", "singleConstStmt", + "groupConstStmt", "constDef", "constVal", "bool", "nil", "listLit", "listItems", "structLit", "structValueFields", "structValueField", "compStmt", - "compDef", "compBody", "compNodesDef", "compNodesDefBody", "compNodeDef", - "nodeInst", "nodeDIArgs", "compNetDef", "connDefList", "connDef", "senderSide", - "receiverSide", "thenConnExpr", "senderConstRef", "portAddr", "portAddrNode", - "portAddrPort", "portAddrIdx", "structSelectors", "multipleReceiverSide", + "singleCompStmt", "groupCompStmt", "compDef", "compBody", "compNodesDef", + "compNodesDefBody", "compNodeDef", "nodeInst", "nodeDIArgs", "compNetDef", + "connDefList", "connDef", "senderSide", "receiverSide", "thenConnExpr", + "senderConstRef", "portAddr", "portAddrNode", "portAddrPort", "portAddrIdx", + "structSelectors", "multipleReceiverSide", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 37, 926, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 38, 973, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, @@ -73,414 +75,435 @@ func nevaParserInit() { 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, - 7, 68, 2, 69, 7, 69, 1, 0, 1, 0, 1, 0, 5, 0, 144, 8, 0, 10, 0, 12, 0, 147, - 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 156, 8, 1, 1, 2, - 1, 2, 1, 2, 4, 2, 161, 8, 2, 11, 2, 12, 2, 162, 1, 3, 1, 3, 1, 3, 3, 3, - 168, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 174, 8, 4, 10, 4, 12, 4, 177, - 9, 4, 1, 4, 1, 4, 1, 5, 4, 5, 182, 8, 5, 11, 5, 12, 5, 183, 1, 6, 1, 6, - 5, 6, 188, 8, 6, 10, 6, 12, 6, 191, 9, 6, 1, 6, 1, 6, 5, 6, 195, 8, 6, - 10, 6, 12, 6, 198, 9, 6, 1, 6, 5, 6, 201, 8, 6, 10, 6, 12, 6, 204, 9, 6, - 1, 6, 1, 6, 1, 7, 3, 7, 209, 8, 7, 1, 7, 1, 7, 5, 7, 213, 8, 7, 10, 7, - 12, 7, 216, 9, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, - 11, 1, 11, 1, 11, 5, 11, 229, 8, 11, 10, 11, 12, 11, 232, 9, 11, 1, 12, - 1, 12, 3, 12, 236, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 3, 14, 243, - 8, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 5, 17, 251, 8, 17, 10, - 17, 12, 17, 254, 9, 17, 1, 17, 1, 17, 5, 17, 258, 8, 17, 10, 17, 12, 17, - 261, 9, 17, 1, 17, 1, 17, 5, 17, 265, 8, 17, 10, 17, 12, 17, 268, 9, 17, - 5, 17, 270, 8, 17, 10, 17, 12, 17, 273, 9, 17, 1, 17, 1, 17, 1, 18, 3, - 18, 278, 8, 18, 1, 18, 1, 18, 3, 18, 282, 8, 18, 1, 18, 3, 18, 285, 8, - 18, 1, 19, 1, 19, 5, 19, 289, 8, 19, 10, 19, 12, 19, 292, 9, 19, 1, 19, - 3, 19, 295, 8, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 302, 8, 20, - 10, 20, 12, 20, 305, 9, 20, 1, 20, 1, 20, 5, 20, 309, 8, 20, 10, 20, 12, - 20, 312, 9, 20, 5, 20, 314, 8, 20, 10, 20, 12, 20, 317, 9, 20, 1, 21, 1, - 21, 3, 21, 321, 8, 21, 1, 22, 1, 22, 1, 22, 3, 22, 326, 8, 22, 1, 23, 1, - 23, 3, 23, 330, 8, 23, 1, 24, 1, 24, 5, 24, 334, 8, 24, 10, 24, 12, 24, - 337, 9, 24, 1, 24, 1, 24, 1, 24, 5, 24, 342, 8, 24, 10, 24, 12, 24, 345, - 9, 24, 1, 24, 5, 24, 348, 8, 24, 10, 24, 12, 24, 351, 9, 24, 1, 24, 5, - 24, 354, 8, 24, 10, 24, 12, 24, 357, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, - 1, 25, 3, 25, 364, 8, 25, 1, 26, 1, 26, 5, 26, 368, 8, 26, 10, 26, 12, - 26, 371, 9, 26, 1, 26, 1, 26, 5, 26, 375, 8, 26, 10, 26, 12, 26, 378, 9, - 26, 1, 26, 1, 26, 1, 26, 5, 26, 383, 8, 26, 10, 26, 12, 26, 386, 9, 26, - 1, 26, 5, 26, 389, 8, 26, 10, 26, 12, 26, 392, 9, 26, 1, 26, 5, 26, 395, - 8, 26, 10, 26, 12, 26, 398, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 5, 27, 404, - 8, 27, 10, 27, 12, 27, 407, 9, 27, 1, 27, 1, 27, 5, 27, 411, 8, 27, 10, - 27, 12, 27, 414, 9, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 5, 28, 421, - 8, 28, 10, 28, 12, 28, 424, 9, 28, 1, 28, 1, 28, 5, 28, 428, 8, 28, 10, - 28, 12, 28, 431, 9, 28, 1, 28, 3, 28, 434, 8, 28, 1, 28, 1, 28, 1, 29, - 1, 29, 4, 29, 440, 8, 29, 11, 29, 12, 29, 441, 1, 29, 5, 29, 445, 8, 29, - 10, 29, 12, 29, 448, 9, 29, 1, 30, 1, 30, 1, 30, 5, 30, 453, 8, 30, 10, - 30, 12, 30, 456, 9, 30, 1, 31, 1, 31, 5, 31, 460, 8, 31, 10, 31, 12, 31, - 463, 9, 31, 1, 31, 1, 31, 5, 31, 467, 8, 31, 10, 31, 12, 31, 470, 9, 31, - 1, 31, 4, 31, 473, 8, 31, 11, 31, 12, 31, 474, 1, 32, 1, 32, 3, 32, 479, - 8, 32, 1, 33, 1, 33, 5, 33, 483, 8, 33, 10, 33, 12, 33, 486, 9, 33, 1, - 33, 1, 33, 5, 33, 490, 8, 33, 10, 33, 12, 33, 493, 9, 33, 1, 33, 5, 33, - 496, 8, 33, 10, 33, 12, 33, 499, 9, 33, 1, 33, 1, 33, 1, 34, 3, 34, 504, - 8, 34, 1, 34, 1, 34, 3, 34, 508, 8, 34, 1, 34, 1, 34, 1, 34, 5, 34, 513, - 8, 34, 10, 34, 12, 34, 516, 9, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, - 37, 5, 37, 524, 8, 37, 10, 37, 12, 37, 527, 9, 37, 1, 37, 3, 37, 530, 8, - 37, 1, 37, 1, 37, 1, 37, 5, 37, 535, 8, 37, 10, 37, 12, 37, 538, 9, 37, - 3, 37, 540, 8, 37, 1, 37, 1, 37, 1, 38, 5, 38, 545, 8, 38, 10, 38, 12, - 38, 548, 9, 38, 1, 38, 1, 38, 1, 38, 5, 38, 553, 8, 38, 10, 38, 12, 38, - 556, 9, 38, 1, 39, 1, 39, 5, 39, 560, 8, 39, 10, 39, 12, 39, 563, 9, 39, - 1, 39, 1, 39, 5, 39, 567, 8, 39, 10, 39, 12, 39, 570, 9, 39, 1, 39, 5, - 39, 573, 8, 39, 10, 39, 12, 39, 576, 9, 39, 1, 39, 1, 39, 1, 40, 3, 40, - 581, 8, 40, 1, 40, 1, 40, 1, 40, 1, 40, 5, 40, 587, 8, 40, 10, 40, 12, - 40, 590, 9, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 3, 41, - 599, 8, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 5, 44, 607, 8, 44, - 10, 44, 12, 44, 610, 9, 44, 1, 44, 3, 44, 613, 8, 44, 1, 44, 1, 44, 1, - 45, 1, 45, 1, 45, 1, 45, 5, 45, 621, 8, 45, 10, 45, 12, 45, 624, 9, 45, - 1, 45, 1, 45, 5, 45, 628, 8, 45, 10, 45, 12, 45, 631, 9, 45, 5, 45, 633, - 8, 45, 10, 45, 12, 45, 636, 9, 45, 3, 45, 638, 8, 45, 1, 46, 1, 46, 5, - 46, 642, 8, 46, 10, 46, 12, 46, 645, 9, 46, 1, 46, 3, 46, 648, 8, 46, 1, - 46, 1, 46, 1, 47, 1, 47, 5, 47, 654, 8, 47, 10, 47, 12, 47, 657, 9, 47, - 1, 47, 5, 47, 660, 8, 47, 10, 47, 12, 47, 663, 9, 47, 1, 48, 1, 48, 1, - 48, 1, 48, 5, 48, 669, 8, 48, 10, 48, 12, 48, 672, 9, 48, 1, 49, 1, 49, - 5, 49, 676, 8, 49, 10, 49, 12, 49, 679, 9, 49, 1, 49, 1, 49, 5, 49, 683, - 8, 49, 10, 49, 12, 49, 686, 9, 49, 1, 49, 5, 49, 689, 8, 49, 10, 49, 12, - 49, 692, 9, 49, 1, 49, 1, 49, 1, 50, 3, 50, 697, 8, 50, 1, 50, 1, 50, 3, - 50, 701, 8, 50, 1, 50, 5, 50, 704, 8, 50, 10, 50, 12, 50, 707, 9, 50, 1, - 51, 1, 51, 5, 51, 711, 8, 51, 10, 51, 12, 51, 714, 9, 51, 1, 51, 1, 51, - 5, 51, 718, 8, 51, 10, 51, 12, 51, 721, 9, 51, 3, 51, 723, 8, 51, 1, 51, - 1, 51, 5, 51, 727, 8, 51, 10, 51, 12, 51, 730, 9, 51, 3, 51, 732, 8, 51, - 1, 51, 1, 51, 1, 52, 1, 52, 5, 52, 738, 8, 52, 10, 52, 12, 52, 741, 9, - 52, 1, 52, 1, 52, 1, 53, 1, 53, 5, 53, 747, 8, 53, 10, 53, 12, 53, 750, - 9, 53, 1, 53, 1, 53, 5, 53, 754, 8, 53, 10, 53, 12, 53, 757, 9, 53, 5, - 53, 759, 8, 53, 10, 53, 12, 53, 762, 9, 53, 1, 53, 1, 53, 1, 54, 3, 54, - 767, 8, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 5, 55, 774, 8, 55, 10, 55, - 12, 55, 777, 9, 55, 1, 55, 3, 55, 780, 8, 55, 1, 55, 5, 55, 783, 8, 55, - 10, 55, 12, 55, 786, 9, 55, 1, 55, 3, 55, 789, 8, 55, 1, 56, 1, 56, 1, - 57, 1, 57, 5, 57, 795, 8, 57, 10, 57, 12, 57, 798, 9, 57, 1, 57, 1, 57, - 5, 57, 802, 8, 57, 10, 57, 12, 57, 805, 9, 57, 1, 57, 3, 57, 808, 8, 57, - 1, 57, 5, 57, 811, 8, 57, 10, 57, 12, 57, 814, 9, 57, 1, 57, 1, 57, 1, - 58, 1, 58, 5, 58, 820, 8, 58, 10, 58, 12, 58, 823, 9, 58, 1, 58, 5, 58, - 826, 8, 58, 10, 58, 12, 58, 829, 9, 58, 1, 59, 1, 59, 1, 59, 1, 59, 3, - 59, 835, 8, 59, 1, 60, 1, 60, 3, 60, 839, 8, 60, 1, 60, 3, 60, 842, 8, - 60, 1, 61, 1, 61, 3, 61, 846, 8, 61, 1, 62, 1, 62, 5, 62, 850, 8, 62, 10, - 62, 12, 62, 853, 9, 62, 1, 62, 1, 62, 1, 62, 5, 62, 858, 8, 62, 10, 62, - 12, 62, 861, 9, 62, 1, 62, 5, 62, 864, 8, 62, 10, 62, 12, 62, 867, 9, 62, - 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 3, 64, 878, - 8, 64, 1, 65, 1, 65, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, - 68, 1, 68, 1, 68, 5, 68, 892, 8, 68, 10, 68, 12, 68, 895, 9, 68, 1, 69, - 1, 69, 5, 69, 899, 8, 69, 10, 69, 12, 69, 902, 9, 69, 1, 69, 1, 69, 1, - 69, 5, 69, 907, 8, 69, 10, 69, 12, 69, 910, 9, 69, 1, 69, 1, 69, 5, 69, - 914, 8, 69, 10, 69, 12, 69, 917, 9, 69, 5, 69, 919, 8, 69, 10, 69, 12, - 69, 922, 9, 69, 1, 69, 1, 69, 1, 69, 0, 0, 70, 0, 2, 4, 6, 8, 10, 12, 14, - 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, - 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, - 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, - 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 0, 2, 2, 0, 9, 9, 32, - 32, 1, 0, 21, 22, 987, 0, 145, 1, 0, 0, 0, 2, 155, 1, 0, 0, 0, 4, 160, - 1, 0, 0, 0, 6, 164, 1, 0, 0, 0, 8, 169, 1, 0, 0, 0, 10, 181, 1, 0, 0, 0, - 12, 185, 1, 0, 0, 0, 14, 208, 1, 0, 0, 0, 16, 217, 1, 0, 0, 0, 18, 219, - 1, 0, 0, 0, 20, 223, 1, 0, 0, 0, 22, 225, 1, 0, 0, 0, 24, 235, 1, 0, 0, - 0, 26, 237, 1, 0, 0, 0, 28, 239, 1, 0, 0, 0, 30, 244, 1, 0, 0, 0, 32, 246, - 1, 0, 0, 0, 34, 248, 1, 0, 0, 0, 36, 277, 1, 0, 0, 0, 38, 286, 1, 0, 0, - 0, 40, 298, 1, 0, 0, 0, 42, 318, 1, 0, 0, 0, 44, 325, 1, 0, 0, 0, 46, 327, - 1, 0, 0, 0, 48, 331, 1, 0, 0, 0, 50, 363, 1, 0, 0, 0, 52, 365, 1, 0, 0, - 0, 54, 401, 1, 0, 0, 0, 56, 418, 1, 0, 0, 0, 58, 437, 1, 0, 0, 0, 60, 449, - 1, 0, 0, 0, 62, 457, 1, 0, 0, 0, 64, 478, 1, 0, 0, 0, 66, 480, 1, 0, 0, - 0, 68, 503, 1, 0, 0, 0, 70, 517, 1, 0, 0, 0, 72, 519, 1, 0, 0, 0, 74, 521, - 1, 0, 0, 0, 76, 546, 1, 0, 0, 0, 78, 557, 1, 0, 0, 0, 80, 580, 1, 0, 0, - 0, 82, 598, 1, 0, 0, 0, 84, 600, 1, 0, 0, 0, 86, 602, 1, 0, 0, 0, 88, 604, - 1, 0, 0, 0, 90, 637, 1, 0, 0, 0, 92, 639, 1, 0, 0, 0, 94, 651, 1, 0, 0, - 0, 96, 664, 1, 0, 0, 0, 98, 673, 1, 0, 0, 0, 100, 696, 1, 0, 0, 0, 102, - 708, 1, 0, 0, 0, 104, 735, 1, 0, 0, 0, 106, 744, 1, 0, 0, 0, 108, 766, - 1, 0, 0, 0, 110, 771, 1, 0, 0, 0, 112, 790, 1, 0, 0, 0, 114, 792, 1, 0, - 0, 0, 116, 817, 1, 0, 0, 0, 118, 830, 1, 0, 0, 0, 120, 838, 1, 0, 0, 0, - 122, 845, 1, 0, 0, 0, 124, 847, 1, 0, 0, 0, 126, 870, 1, 0, 0, 0, 128, - 873, 1, 0, 0, 0, 130, 879, 1, 0, 0, 0, 132, 881, 1, 0, 0, 0, 134, 883, - 1, 0, 0, 0, 136, 887, 1, 0, 0, 0, 138, 896, 1, 0, 0, 0, 140, 144, 5, 36, - 0, 0, 141, 144, 5, 30, 0, 0, 142, 144, 3, 2, 1, 0, 143, 140, 1, 0, 0, 0, - 143, 141, 1, 0, 0, 0, 143, 142, 1, 0, 0, 0, 144, 147, 1, 0, 0, 0, 145, - 143, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 148, 1, 0, 0, 0, 147, 145, - 1, 0, 0, 0, 148, 149, 5, 0, 0, 1, 149, 1, 1, 0, 0, 0, 150, 156, 3, 12, - 6, 0, 151, 156, 3, 34, 17, 0, 152, 156, 3, 66, 33, 0, 153, 156, 3, 78, - 39, 0, 154, 156, 3, 98, 49, 0, 155, 150, 1, 0, 0, 0, 155, 151, 1, 0, 0, - 0, 155, 152, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 154, 1, 0, 0, 0, 156, - 3, 1, 0, 0, 0, 157, 158, 3, 6, 3, 0, 158, 159, 5, 36, 0, 0, 159, 161, 1, - 0, 0, 0, 160, 157, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 160, 1, 0, 0, - 0, 162, 163, 1, 0, 0, 0, 163, 5, 1, 0, 0, 0, 164, 165, 5, 1, 0, 0, 165, - 167, 5, 32, 0, 0, 166, 168, 3, 8, 4, 0, 167, 166, 1, 0, 0, 0, 167, 168, - 1, 0, 0, 0, 168, 7, 1, 0, 0, 0, 169, 170, 5, 2, 0, 0, 170, 175, 3, 10, - 5, 0, 171, 172, 5, 3, 0, 0, 172, 174, 3, 10, 5, 0, 173, 171, 1, 0, 0, 0, - 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, - 178, 1, 0, 0, 0, 177, 175, 1, 0, 0, 0, 178, 179, 5, 4, 0, 0, 179, 9, 1, - 0, 0, 0, 180, 182, 5, 32, 0, 0, 181, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, - 0, 183, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 11, 1, 0, 0, 0, 185, - 189, 5, 5, 0, 0, 186, 188, 5, 36, 0, 0, 187, 186, 1, 0, 0, 0, 188, 191, - 1, 0, 0, 0, 189, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, - 0, 0, 191, 189, 1, 0, 0, 0, 192, 196, 5, 6, 0, 0, 193, 195, 5, 36, 0, 0, - 194, 193, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 196, - 197, 1, 0, 0, 0, 197, 202, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 199, 201, - 3, 14, 7, 0, 200, 199, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, - 0, 0, 202, 203, 1, 0, 0, 0, 203, 205, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, - 205, 206, 5, 7, 0, 0, 206, 13, 1, 0, 0, 0, 207, 209, 3, 16, 8, 0, 208, - 207, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 214, - 3, 18, 9, 0, 211, 213, 5, 36, 0, 0, 212, 211, 1, 0, 0, 0, 213, 216, 1, - 0, 0, 0, 214, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 15, 1, 0, 0, - 0, 216, 214, 1, 0, 0, 0, 217, 218, 5, 32, 0, 0, 218, 17, 1, 0, 0, 0, 219, - 220, 3, 20, 10, 0, 220, 221, 5, 8, 0, 0, 221, 222, 3, 22, 11, 0, 222, 19, - 1, 0, 0, 0, 223, 224, 7, 0, 0, 0, 224, 21, 1, 0, 0, 0, 225, 230, 5, 32, - 0, 0, 226, 227, 5, 8, 0, 0, 227, 229, 5, 32, 0, 0, 228, 226, 1, 0, 0, 0, - 229, 232, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, - 23, 1, 0, 0, 0, 232, 230, 1, 0, 0, 0, 233, 236, 3, 26, 13, 0, 234, 236, - 3, 28, 14, 0, 235, 233, 1, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 25, 1, 0, - 0, 0, 237, 238, 5, 32, 0, 0, 238, 27, 1, 0, 0, 0, 239, 242, 3, 30, 15, - 0, 240, 241, 5, 10, 0, 0, 241, 243, 3, 32, 16, 0, 242, 240, 1, 0, 0, 0, - 242, 243, 1, 0, 0, 0, 243, 29, 1, 0, 0, 0, 244, 245, 5, 32, 0, 0, 245, - 31, 1, 0, 0, 0, 246, 247, 5, 32, 0, 0, 247, 33, 1, 0, 0, 0, 248, 252, 5, - 11, 0, 0, 249, 251, 5, 36, 0, 0, 250, 249, 1, 0, 0, 0, 251, 254, 1, 0, - 0, 0, 252, 250, 1, 0, 0, 0, 252, 253, 1, 0, 0, 0, 253, 255, 1, 0, 0, 0, - 254, 252, 1, 0, 0, 0, 255, 259, 5, 6, 0, 0, 256, 258, 5, 36, 0, 0, 257, - 256, 1, 0, 0, 0, 258, 261, 1, 0, 0, 0, 259, 257, 1, 0, 0, 0, 259, 260, - 1, 0, 0, 0, 260, 271, 1, 0, 0, 0, 261, 259, 1, 0, 0, 0, 262, 266, 3, 36, - 18, 0, 263, 265, 5, 36, 0, 0, 264, 263, 1, 0, 0, 0, 265, 268, 1, 0, 0, - 0, 266, 264, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, 267, 270, 1, 0, 0, 0, 268, - 266, 1, 0, 0, 0, 269, 262, 1, 0, 0, 0, 270, 273, 1, 0, 0, 0, 271, 269, - 1, 0, 0, 0, 271, 272, 1, 0, 0, 0, 272, 274, 1, 0, 0, 0, 273, 271, 1, 0, - 0, 0, 274, 275, 5, 7, 0, 0, 275, 35, 1, 0, 0, 0, 276, 278, 5, 31, 0, 0, - 277, 276, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 279, 1, 0, 0, 0, 279, - 281, 5, 32, 0, 0, 280, 282, 3, 38, 19, 0, 281, 280, 1, 0, 0, 0, 281, 282, - 1, 0, 0, 0, 282, 284, 1, 0, 0, 0, 283, 285, 3, 44, 22, 0, 284, 283, 1, - 0, 0, 0, 284, 285, 1, 0, 0, 0, 285, 37, 1, 0, 0, 0, 286, 290, 5, 12, 0, - 0, 287, 289, 5, 36, 0, 0, 288, 287, 1, 0, 0, 0, 289, 292, 1, 0, 0, 0, 290, - 288, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 294, 1, 0, 0, 0, 292, 290, - 1, 0, 0, 0, 293, 295, 3, 40, 20, 0, 294, 293, 1, 0, 0, 0, 294, 295, 1, - 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 5, 13, 0, 0, 297, 39, 1, 0, 0, - 0, 298, 315, 3, 42, 21, 0, 299, 303, 5, 3, 0, 0, 300, 302, 5, 36, 0, 0, - 301, 300, 1, 0, 0, 0, 302, 305, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 303, - 304, 1, 0, 0, 0, 304, 306, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 306, 310, - 3, 42, 21, 0, 307, 309, 5, 36, 0, 0, 308, 307, 1, 0, 0, 0, 309, 312, 1, - 0, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 314, 1, 0, 0, - 0, 312, 310, 1, 0, 0, 0, 313, 299, 1, 0, 0, 0, 314, 317, 1, 0, 0, 0, 315, - 313, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 41, 1, 0, 0, 0, 317, 315, 1, - 0, 0, 0, 318, 320, 5, 32, 0, 0, 319, 321, 3, 44, 22, 0, 320, 319, 1, 0, - 0, 0, 320, 321, 1, 0, 0, 0, 321, 43, 1, 0, 0, 0, 322, 326, 3, 46, 23, 0, - 323, 326, 3, 50, 25, 0, 324, 326, 3, 62, 31, 0, 325, 322, 1, 0, 0, 0, 325, - 323, 1, 0, 0, 0, 325, 324, 1, 0, 0, 0, 326, 45, 1, 0, 0, 0, 327, 329, 3, - 24, 12, 0, 328, 330, 3, 48, 24, 0, 329, 328, 1, 0, 0, 0, 329, 330, 1, 0, - 0, 0, 330, 47, 1, 0, 0, 0, 331, 335, 5, 12, 0, 0, 332, 334, 5, 36, 0, 0, - 333, 332, 1, 0, 0, 0, 334, 337, 1, 0, 0, 0, 335, 333, 1, 0, 0, 0, 335, - 336, 1, 0, 0, 0, 336, 338, 1, 0, 0, 0, 337, 335, 1, 0, 0, 0, 338, 349, - 3, 44, 22, 0, 339, 343, 5, 3, 0, 0, 340, 342, 5, 36, 0, 0, 341, 340, 1, - 0, 0, 0, 342, 345, 1, 0, 0, 0, 343, 341, 1, 0, 0, 0, 343, 344, 1, 0, 0, - 0, 344, 346, 1, 0, 0, 0, 345, 343, 1, 0, 0, 0, 346, 348, 3, 44, 22, 0, - 347, 339, 1, 0, 0, 0, 348, 351, 1, 0, 0, 0, 349, 347, 1, 0, 0, 0, 349, - 350, 1, 0, 0, 0, 350, 355, 1, 0, 0, 0, 351, 349, 1, 0, 0, 0, 352, 354, - 5, 36, 0, 0, 353, 352, 1, 0, 0, 0, 354, 357, 1, 0, 0, 0, 355, 353, 1, 0, - 0, 0, 355, 356, 1, 0, 0, 0, 356, 358, 1, 0, 0, 0, 357, 355, 1, 0, 0, 0, - 358, 359, 5, 13, 0, 0, 359, 49, 1, 0, 0, 0, 360, 364, 3, 52, 26, 0, 361, - 364, 3, 54, 27, 0, 362, 364, 3, 56, 28, 0, 363, 360, 1, 0, 0, 0, 363, 361, - 1, 0, 0, 0, 363, 362, 1, 0, 0, 0, 364, 51, 1, 0, 0, 0, 365, 369, 5, 14, - 0, 0, 366, 368, 5, 36, 0, 0, 367, 366, 1, 0, 0, 0, 368, 371, 1, 0, 0, 0, - 369, 367, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 372, 1, 0, 0, 0, 371, - 369, 1, 0, 0, 0, 372, 376, 5, 6, 0, 0, 373, 375, 5, 36, 0, 0, 374, 373, - 1, 0, 0, 0, 375, 378, 1, 0, 0, 0, 376, 374, 1, 0, 0, 0, 376, 377, 1, 0, - 0, 0, 377, 379, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 379, 390, 5, 32, 0, 0, - 380, 384, 5, 3, 0, 0, 381, 383, 5, 36, 0, 0, 382, 381, 1, 0, 0, 0, 383, - 386, 1, 0, 0, 0, 384, 382, 1, 0, 0, 0, 384, 385, 1, 0, 0, 0, 385, 387, - 1, 0, 0, 0, 386, 384, 1, 0, 0, 0, 387, 389, 5, 32, 0, 0, 388, 380, 1, 0, - 0, 0, 389, 392, 1, 0, 0, 0, 390, 388, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, - 391, 396, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 393, 395, 5, 36, 0, 0, 394, - 393, 1, 0, 0, 0, 395, 398, 1, 0, 0, 0, 396, 394, 1, 0, 0, 0, 396, 397, - 1, 0, 0, 0, 397, 399, 1, 0, 0, 0, 398, 396, 1, 0, 0, 0, 399, 400, 5, 7, - 0, 0, 400, 53, 1, 0, 0, 0, 401, 405, 5, 15, 0, 0, 402, 404, 5, 36, 0, 0, - 403, 402, 1, 0, 0, 0, 404, 407, 1, 0, 0, 0, 405, 403, 1, 0, 0, 0, 405, - 406, 1, 0, 0, 0, 406, 408, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 408, 412, - 5, 33, 0, 0, 409, 411, 5, 36, 0, 0, 410, 409, 1, 0, 0, 0, 411, 414, 1, - 0, 0, 0, 412, 410, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, 415, 1, 0, 0, - 0, 414, 412, 1, 0, 0, 0, 415, 416, 5, 16, 0, 0, 416, 417, 3, 44, 22, 0, - 417, 55, 1, 0, 0, 0, 418, 422, 5, 17, 0, 0, 419, 421, 5, 36, 0, 0, 420, - 419, 1, 0, 0, 0, 421, 424, 1, 0, 0, 0, 422, 420, 1, 0, 0, 0, 422, 423, - 1, 0, 0, 0, 423, 425, 1, 0, 0, 0, 424, 422, 1, 0, 0, 0, 425, 429, 5, 6, - 0, 0, 426, 428, 5, 36, 0, 0, 427, 426, 1, 0, 0, 0, 428, 431, 1, 0, 0, 0, - 429, 427, 1, 0, 0, 0, 429, 430, 1, 0, 0, 0, 430, 433, 1, 0, 0, 0, 431, - 429, 1, 0, 0, 0, 432, 434, 3, 58, 29, 0, 433, 432, 1, 0, 0, 0, 433, 434, - 1, 0, 0, 0, 434, 435, 1, 0, 0, 0, 435, 436, 5, 7, 0, 0, 436, 57, 1, 0, - 0, 0, 437, 446, 3, 60, 30, 0, 438, 440, 5, 36, 0, 0, 439, 438, 1, 0, 0, - 0, 440, 441, 1, 0, 0, 0, 441, 439, 1, 0, 0, 0, 441, 442, 1, 0, 0, 0, 442, - 443, 1, 0, 0, 0, 443, 445, 3, 60, 30, 0, 444, 439, 1, 0, 0, 0, 445, 448, - 1, 0, 0, 0, 446, 444, 1, 0, 0, 0, 446, 447, 1, 0, 0, 0, 447, 59, 1, 0, - 0, 0, 448, 446, 1, 0, 0, 0, 449, 450, 5, 32, 0, 0, 450, 454, 3, 44, 22, - 0, 451, 453, 5, 36, 0, 0, 452, 451, 1, 0, 0, 0, 453, 456, 1, 0, 0, 0, 454, - 452, 1, 0, 0, 0, 454, 455, 1, 0, 0, 0, 455, 61, 1, 0, 0, 0, 456, 454, 1, - 0, 0, 0, 457, 472, 3, 64, 32, 0, 458, 460, 5, 36, 0, 0, 459, 458, 1, 0, - 0, 0, 460, 463, 1, 0, 0, 0, 461, 459, 1, 0, 0, 0, 461, 462, 1, 0, 0, 0, - 462, 464, 1, 0, 0, 0, 463, 461, 1, 0, 0, 0, 464, 468, 5, 18, 0, 0, 465, - 467, 5, 36, 0, 0, 466, 465, 1, 0, 0, 0, 467, 470, 1, 0, 0, 0, 468, 466, - 1, 0, 0, 0, 468, 469, 1, 0, 0, 0, 469, 471, 1, 0, 0, 0, 470, 468, 1, 0, - 0, 0, 471, 473, 3, 64, 32, 0, 472, 461, 1, 0, 0, 0, 473, 474, 1, 0, 0, - 0, 474, 472, 1, 0, 0, 0, 474, 475, 1, 0, 0, 0, 475, 63, 1, 0, 0, 0, 476, - 479, 3, 46, 23, 0, 477, 479, 3, 50, 25, 0, 478, 476, 1, 0, 0, 0, 478, 477, - 1, 0, 0, 0, 479, 65, 1, 0, 0, 0, 480, 484, 5, 19, 0, 0, 481, 483, 5, 36, - 0, 0, 482, 481, 1, 0, 0, 0, 483, 486, 1, 0, 0, 0, 484, 482, 1, 0, 0, 0, - 484, 485, 1, 0, 0, 0, 485, 487, 1, 0, 0, 0, 486, 484, 1, 0, 0, 0, 487, - 491, 5, 6, 0, 0, 488, 490, 5, 36, 0, 0, 489, 488, 1, 0, 0, 0, 490, 493, - 1, 0, 0, 0, 491, 489, 1, 0, 0, 0, 491, 492, 1, 0, 0, 0, 492, 497, 1, 0, - 0, 0, 493, 491, 1, 0, 0, 0, 494, 496, 3, 68, 34, 0, 495, 494, 1, 0, 0, - 0, 496, 499, 1, 0, 0, 0, 497, 495, 1, 0, 0, 0, 497, 498, 1, 0, 0, 0, 498, - 500, 1, 0, 0, 0, 499, 497, 1, 0, 0, 0, 500, 501, 5, 7, 0, 0, 501, 67, 1, - 0, 0, 0, 502, 504, 5, 31, 0, 0, 503, 502, 1, 0, 0, 0, 503, 504, 1, 0, 0, - 0, 504, 505, 1, 0, 0, 0, 505, 507, 5, 32, 0, 0, 506, 508, 3, 38, 19, 0, - 507, 506, 1, 0, 0, 0, 507, 508, 1, 0, 0, 0, 508, 509, 1, 0, 0, 0, 509, - 510, 3, 70, 35, 0, 510, 514, 3, 72, 36, 0, 511, 513, 5, 36, 0, 0, 512, - 511, 1, 0, 0, 0, 513, 516, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 514, 515, - 1, 0, 0, 0, 515, 69, 1, 0, 0, 0, 516, 514, 1, 0, 0, 0, 517, 518, 3, 74, - 37, 0, 518, 71, 1, 0, 0, 0, 519, 520, 3, 74, 37, 0, 520, 73, 1, 0, 0, 0, - 521, 539, 5, 2, 0, 0, 522, 524, 5, 36, 0, 0, 523, 522, 1, 0, 0, 0, 524, - 527, 1, 0, 0, 0, 525, 523, 1, 0, 0, 0, 525, 526, 1, 0, 0, 0, 526, 540, - 1, 0, 0, 0, 527, 525, 1, 0, 0, 0, 528, 530, 3, 76, 38, 0, 529, 528, 1, - 0, 0, 0, 529, 530, 1, 0, 0, 0, 530, 540, 1, 0, 0, 0, 531, 536, 3, 76, 38, - 0, 532, 533, 5, 3, 0, 0, 533, 535, 3, 76, 38, 0, 534, 532, 1, 0, 0, 0, - 535, 538, 1, 0, 0, 0, 536, 534, 1, 0, 0, 0, 536, 537, 1, 0, 0, 0, 537, - 540, 1, 0, 0, 0, 538, 536, 1, 0, 0, 0, 539, 525, 1, 0, 0, 0, 539, 529, - 1, 0, 0, 0, 539, 531, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 542, 5, 4, - 0, 0, 542, 75, 1, 0, 0, 0, 543, 545, 5, 36, 0, 0, 544, 543, 1, 0, 0, 0, - 545, 548, 1, 0, 0, 0, 546, 544, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, - 549, 1, 0, 0, 0, 548, 546, 1, 0, 0, 0, 549, 550, 5, 32, 0, 0, 550, 554, - 3, 44, 22, 0, 551, 553, 5, 36, 0, 0, 552, 551, 1, 0, 0, 0, 553, 556, 1, - 0, 0, 0, 554, 552, 1, 0, 0, 0, 554, 555, 1, 0, 0, 0, 555, 77, 1, 0, 0, - 0, 556, 554, 1, 0, 0, 0, 557, 561, 5, 20, 0, 0, 558, 560, 5, 36, 0, 0, - 559, 558, 1, 0, 0, 0, 560, 563, 1, 0, 0, 0, 561, 559, 1, 0, 0, 0, 561, - 562, 1, 0, 0, 0, 562, 564, 1, 0, 0, 0, 563, 561, 1, 0, 0, 0, 564, 568, - 5, 6, 0, 0, 565, 567, 5, 36, 0, 0, 566, 565, 1, 0, 0, 0, 567, 570, 1, 0, - 0, 0, 568, 566, 1, 0, 0, 0, 568, 569, 1, 0, 0, 0, 569, 574, 1, 0, 0, 0, - 570, 568, 1, 0, 0, 0, 571, 573, 3, 80, 40, 0, 572, 571, 1, 0, 0, 0, 573, - 576, 1, 0, 0, 0, 574, 572, 1, 0, 0, 0, 574, 575, 1, 0, 0, 0, 575, 577, - 1, 0, 0, 0, 576, 574, 1, 0, 0, 0, 577, 578, 5, 7, 0, 0, 578, 79, 1, 0, - 0, 0, 579, 581, 5, 31, 0, 0, 580, 579, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, - 581, 582, 1, 0, 0, 0, 582, 583, 5, 32, 0, 0, 583, 584, 3, 44, 22, 0, 584, - 588, 3, 82, 41, 0, 585, 587, 5, 36, 0, 0, 586, 585, 1, 0, 0, 0, 587, 590, - 1, 0, 0, 0, 588, 586, 1, 0, 0, 0, 588, 589, 1, 0, 0, 0, 589, 81, 1, 0, - 0, 0, 590, 588, 1, 0, 0, 0, 591, 599, 3, 84, 42, 0, 592, 599, 5, 33, 0, - 0, 593, 599, 5, 34, 0, 0, 594, 599, 5, 35, 0, 0, 595, 599, 3, 88, 44, 0, - 596, 599, 3, 92, 46, 0, 597, 599, 3, 86, 43, 0, 598, 591, 1, 0, 0, 0, 598, - 592, 1, 0, 0, 0, 598, 593, 1, 0, 0, 0, 598, 594, 1, 0, 0, 0, 598, 595, - 1, 0, 0, 0, 598, 596, 1, 0, 0, 0, 598, 597, 1, 0, 0, 0, 599, 83, 1, 0, - 0, 0, 600, 601, 7, 1, 0, 0, 601, 85, 1, 0, 0, 0, 602, 603, 5, 23, 0, 0, - 603, 87, 1, 0, 0, 0, 604, 608, 5, 15, 0, 0, 605, 607, 5, 36, 0, 0, 606, - 605, 1, 0, 0, 0, 607, 610, 1, 0, 0, 0, 608, 606, 1, 0, 0, 0, 608, 609, - 1, 0, 0, 0, 609, 612, 1, 0, 0, 0, 610, 608, 1, 0, 0, 0, 611, 613, 3, 90, - 45, 0, 612, 611, 1, 0, 0, 0, 612, 613, 1, 0, 0, 0, 613, 614, 1, 0, 0, 0, - 614, 615, 5, 16, 0, 0, 615, 89, 1, 0, 0, 0, 616, 638, 3, 82, 41, 0, 617, - 634, 3, 82, 41, 0, 618, 622, 5, 3, 0, 0, 619, 621, 5, 36, 0, 0, 620, 619, - 1, 0, 0, 0, 621, 624, 1, 0, 0, 0, 622, 620, 1, 0, 0, 0, 622, 623, 1, 0, - 0, 0, 623, 625, 1, 0, 0, 0, 624, 622, 1, 0, 0, 0, 625, 629, 3, 82, 41, - 0, 626, 628, 5, 36, 0, 0, 627, 626, 1, 0, 0, 0, 628, 631, 1, 0, 0, 0, 629, - 627, 1, 0, 0, 0, 629, 630, 1, 0, 0, 0, 630, 633, 1, 0, 0, 0, 631, 629, - 1, 0, 0, 0, 632, 618, 1, 0, 0, 0, 633, 636, 1, 0, 0, 0, 634, 632, 1, 0, - 0, 0, 634, 635, 1, 0, 0, 0, 635, 638, 1, 0, 0, 0, 636, 634, 1, 0, 0, 0, - 637, 616, 1, 0, 0, 0, 637, 617, 1, 0, 0, 0, 638, 91, 1, 0, 0, 0, 639, 643, - 5, 6, 0, 0, 640, 642, 5, 36, 0, 0, 641, 640, 1, 0, 0, 0, 642, 645, 1, 0, - 0, 0, 643, 641, 1, 0, 0, 0, 643, 644, 1, 0, 0, 0, 644, 647, 1, 0, 0, 0, - 645, 643, 1, 0, 0, 0, 646, 648, 3, 94, 47, 0, 647, 646, 1, 0, 0, 0, 647, - 648, 1, 0, 0, 0, 648, 649, 1, 0, 0, 0, 649, 650, 5, 7, 0, 0, 650, 93, 1, - 0, 0, 0, 651, 661, 3, 96, 48, 0, 652, 654, 5, 36, 0, 0, 653, 652, 1, 0, - 0, 0, 654, 657, 1, 0, 0, 0, 655, 653, 1, 0, 0, 0, 655, 656, 1, 0, 0, 0, - 656, 658, 1, 0, 0, 0, 657, 655, 1, 0, 0, 0, 658, 660, 3, 96, 48, 0, 659, - 655, 1, 0, 0, 0, 660, 663, 1, 0, 0, 0, 661, 659, 1, 0, 0, 0, 661, 662, - 1, 0, 0, 0, 662, 95, 1, 0, 0, 0, 663, 661, 1, 0, 0, 0, 664, 665, 5, 32, - 0, 0, 665, 666, 5, 24, 0, 0, 666, 670, 3, 82, 41, 0, 667, 669, 5, 36, 0, - 0, 668, 667, 1, 0, 0, 0, 669, 672, 1, 0, 0, 0, 670, 668, 1, 0, 0, 0, 670, - 671, 1, 0, 0, 0, 671, 97, 1, 0, 0, 0, 672, 670, 1, 0, 0, 0, 673, 677, 5, - 25, 0, 0, 674, 676, 5, 36, 0, 0, 675, 674, 1, 0, 0, 0, 676, 679, 1, 0, - 0, 0, 677, 675, 1, 0, 0, 0, 677, 678, 1, 0, 0, 0, 678, 680, 1, 0, 0, 0, - 679, 677, 1, 0, 0, 0, 680, 684, 5, 6, 0, 0, 681, 683, 5, 36, 0, 0, 682, - 681, 1, 0, 0, 0, 683, 686, 1, 0, 0, 0, 684, 682, 1, 0, 0, 0, 684, 685, - 1, 0, 0, 0, 685, 690, 1, 0, 0, 0, 686, 684, 1, 0, 0, 0, 687, 689, 3, 100, - 50, 0, 688, 687, 1, 0, 0, 0, 689, 692, 1, 0, 0, 0, 690, 688, 1, 0, 0, 0, - 690, 691, 1, 0, 0, 0, 691, 693, 1, 0, 0, 0, 692, 690, 1, 0, 0, 0, 693, - 694, 5, 7, 0, 0, 694, 99, 1, 0, 0, 0, 695, 697, 3, 4, 2, 0, 696, 695, 1, - 0, 0, 0, 696, 697, 1, 0, 0, 0, 697, 698, 1, 0, 0, 0, 698, 700, 3, 68, 34, - 0, 699, 701, 3, 102, 51, 0, 700, 699, 1, 0, 0, 0, 700, 701, 1, 0, 0, 0, - 701, 705, 1, 0, 0, 0, 702, 704, 5, 36, 0, 0, 703, 702, 1, 0, 0, 0, 704, - 707, 1, 0, 0, 0, 705, 703, 1, 0, 0, 0, 705, 706, 1, 0, 0, 0, 706, 101, - 1, 0, 0, 0, 707, 705, 1, 0, 0, 0, 708, 712, 5, 6, 0, 0, 709, 711, 5, 36, - 0, 0, 710, 709, 1, 0, 0, 0, 711, 714, 1, 0, 0, 0, 712, 710, 1, 0, 0, 0, - 712, 713, 1, 0, 0, 0, 713, 722, 1, 0, 0, 0, 714, 712, 1, 0, 0, 0, 715, - 719, 3, 104, 52, 0, 716, 718, 5, 36, 0, 0, 717, 716, 1, 0, 0, 0, 718, 721, - 1, 0, 0, 0, 719, 717, 1, 0, 0, 0, 719, 720, 1, 0, 0, 0, 720, 723, 1, 0, - 0, 0, 721, 719, 1, 0, 0, 0, 722, 715, 1, 0, 0, 0, 722, 723, 1, 0, 0, 0, - 723, 731, 1, 0, 0, 0, 724, 728, 3, 114, 57, 0, 725, 727, 5, 36, 0, 0, 726, - 725, 1, 0, 0, 0, 727, 730, 1, 0, 0, 0, 728, 726, 1, 0, 0, 0, 728, 729, - 1, 0, 0, 0, 729, 732, 1, 0, 0, 0, 730, 728, 1, 0, 0, 0, 731, 724, 1, 0, - 0, 0, 731, 732, 1, 0, 0, 0, 732, 733, 1, 0, 0, 0, 733, 734, 5, 7, 0, 0, - 734, 103, 1, 0, 0, 0, 735, 739, 5, 26, 0, 0, 736, 738, 5, 36, 0, 0, 737, - 736, 1, 0, 0, 0, 738, 741, 1, 0, 0, 0, 739, 737, 1, 0, 0, 0, 739, 740, - 1, 0, 0, 0, 740, 742, 1, 0, 0, 0, 741, 739, 1, 0, 0, 0, 742, 743, 3, 106, - 53, 0, 743, 105, 1, 0, 0, 0, 744, 748, 5, 6, 0, 0, 745, 747, 5, 36, 0, - 0, 746, 745, 1, 0, 0, 0, 747, 750, 1, 0, 0, 0, 748, 746, 1, 0, 0, 0, 748, - 749, 1, 0, 0, 0, 749, 760, 1, 0, 0, 0, 750, 748, 1, 0, 0, 0, 751, 755, - 3, 108, 54, 0, 752, 754, 5, 36, 0, 0, 753, 752, 1, 0, 0, 0, 754, 757, 1, - 0, 0, 0, 755, 753, 1, 0, 0, 0, 755, 756, 1, 0, 0, 0, 756, 759, 1, 0, 0, - 0, 757, 755, 1, 0, 0, 0, 758, 751, 1, 0, 0, 0, 759, 762, 1, 0, 0, 0, 760, - 758, 1, 0, 0, 0, 760, 761, 1, 0, 0, 0, 761, 763, 1, 0, 0, 0, 762, 760, - 1, 0, 0, 0, 763, 764, 5, 7, 0, 0, 764, 107, 1, 0, 0, 0, 765, 767, 3, 4, - 2, 0, 766, 765, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 768, 1, 0, 0, 0, - 768, 769, 5, 32, 0, 0, 769, 770, 3, 110, 55, 0, 770, 109, 1, 0, 0, 0, 771, - 775, 3, 24, 12, 0, 772, 774, 5, 36, 0, 0, 773, 772, 1, 0, 0, 0, 774, 777, - 1, 0, 0, 0, 775, 773, 1, 0, 0, 0, 775, 776, 1, 0, 0, 0, 776, 779, 1, 0, - 0, 0, 777, 775, 1, 0, 0, 0, 778, 780, 3, 48, 24, 0, 779, 778, 1, 0, 0, - 0, 779, 780, 1, 0, 0, 0, 780, 784, 1, 0, 0, 0, 781, 783, 5, 36, 0, 0, 782, - 781, 1, 0, 0, 0, 783, 786, 1, 0, 0, 0, 784, 782, 1, 0, 0, 0, 784, 785, - 1, 0, 0, 0, 785, 788, 1, 0, 0, 0, 786, 784, 1, 0, 0, 0, 787, 789, 3, 112, - 56, 0, 788, 787, 1, 0, 0, 0, 788, 789, 1, 0, 0, 0, 789, 111, 1, 0, 0, 0, - 790, 791, 3, 106, 53, 0, 791, 113, 1, 0, 0, 0, 792, 796, 5, 27, 0, 0, 793, - 795, 5, 36, 0, 0, 794, 793, 1, 0, 0, 0, 795, 798, 1, 0, 0, 0, 796, 794, - 1, 0, 0, 0, 796, 797, 1, 0, 0, 0, 797, 799, 1, 0, 0, 0, 798, 796, 1, 0, - 0, 0, 799, 803, 5, 6, 0, 0, 800, 802, 5, 36, 0, 0, 801, 800, 1, 0, 0, 0, - 802, 805, 1, 0, 0, 0, 803, 801, 1, 0, 0, 0, 803, 804, 1, 0, 0, 0, 804, - 807, 1, 0, 0, 0, 805, 803, 1, 0, 0, 0, 806, 808, 3, 116, 58, 0, 807, 806, - 1, 0, 0, 0, 807, 808, 1, 0, 0, 0, 808, 812, 1, 0, 0, 0, 809, 811, 5, 36, - 0, 0, 810, 809, 1, 0, 0, 0, 811, 814, 1, 0, 0, 0, 812, 810, 1, 0, 0, 0, - 812, 813, 1, 0, 0, 0, 813, 815, 1, 0, 0, 0, 814, 812, 1, 0, 0, 0, 815, - 816, 5, 7, 0, 0, 816, 115, 1, 0, 0, 0, 817, 827, 3, 118, 59, 0, 818, 820, - 5, 36, 0, 0, 819, 818, 1, 0, 0, 0, 820, 823, 1, 0, 0, 0, 821, 819, 1, 0, - 0, 0, 821, 822, 1, 0, 0, 0, 822, 824, 1, 0, 0, 0, 823, 821, 1, 0, 0, 0, - 824, 826, 3, 118, 59, 0, 825, 821, 1, 0, 0, 0, 826, 829, 1, 0, 0, 0, 827, - 825, 1, 0, 0, 0, 827, 828, 1, 0, 0, 0, 828, 117, 1, 0, 0, 0, 829, 827, - 1, 0, 0, 0, 830, 831, 3, 120, 60, 0, 831, 834, 5, 28, 0, 0, 832, 835, 3, - 122, 61, 0, 833, 835, 3, 138, 69, 0, 834, 832, 1, 0, 0, 0, 834, 833, 1, - 0, 0, 0, 835, 119, 1, 0, 0, 0, 836, 839, 3, 128, 64, 0, 837, 839, 3, 126, - 63, 0, 838, 836, 1, 0, 0, 0, 838, 837, 1, 0, 0, 0, 839, 841, 1, 0, 0, 0, - 840, 842, 3, 136, 68, 0, 841, 840, 1, 0, 0, 0, 841, 842, 1, 0, 0, 0, 842, - 121, 1, 0, 0, 0, 843, 846, 3, 128, 64, 0, 844, 846, 3, 124, 62, 0, 845, - 843, 1, 0, 0, 0, 845, 844, 1, 0, 0, 0, 846, 123, 1, 0, 0, 0, 847, 851, - 5, 2, 0, 0, 848, 850, 5, 36, 0, 0, 849, 848, 1, 0, 0, 0, 850, 853, 1, 0, - 0, 0, 851, 849, 1, 0, 0, 0, 851, 852, 1, 0, 0, 0, 852, 854, 1, 0, 0, 0, - 853, 851, 1, 0, 0, 0, 854, 859, 3, 118, 59, 0, 855, 856, 5, 36, 0, 0, 856, - 858, 3, 118, 59, 0, 857, 855, 1, 0, 0, 0, 858, 861, 1, 0, 0, 0, 859, 857, - 1, 0, 0, 0, 859, 860, 1, 0, 0, 0, 860, 865, 1, 0, 0, 0, 861, 859, 1, 0, - 0, 0, 862, 864, 5, 36, 0, 0, 863, 862, 1, 0, 0, 0, 864, 867, 1, 0, 0, 0, - 865, 863, 1, 0, 0, 0, 865, 866, 1, 0, 0, 0, 866, 868, 1, 0, 0, 0, 867, - 865, 1, 0, 0, 0, 868, 869, 5, 4, 0, 0, 869, 125, 1, 0, 0, 0, 870, 871, - 5, 29, 0, 0, 871, 872, 3, 24, 12, 0, 872, 127, 1, 0, 0, 0, 873, 874, 3, - 130, 65, 0, 874, 875, 5, 24, 0, 0, 875, 877, 3, 132, 66, 0, 876, 878, 3, - 134, 67, 0, 877, 876, 1, 0, 0, 0, 877, 878, 1, 0, 0, 0, 878, 129, 1, 0, - 0, 0, 879, 880, 5, 32, 0, 0, 880, 131, 1, 0, 0, 0, 881, 882, 5, 32, 0, - 0, 882, 133, 1, 0, 0, 0, 883, 884, 5, 15, 0, 0, 884, 885, 5, 33, 0, 0, - 885, 886, 5, 16, 0, 0, 886, 135, 1, 0, 0, 0, 887, 888, 5, 10, 0, 0, 888, - 893, 5, 32, 0, 0, 889, 890, 5, 10, 0, 0, 890, 892, 5, 32, 0, 0, 891, 889, - 1, 0, 0, 0, 892, 895, 1, 0, 0, 0, 893, 891, 1, 0, 0, 0, 893, 894, 1, 0, - 0, 0, 894, 137, 1, 0, 0, 0, 895, 893, 1, 0, 0, 0, 896, 900, 5, 15, 0, 0, - 897, 899, 5, 36, 0, 0, 898, 897, 1, 0, 0, 0, 899, 902, 1, 0, 0, 0, 900, - 898, 1, 0, 0, 0, 900, 901, 1, 0, 0, 0, 901, 903, 1, 0, 0, 0, 902, 900, - 1, 0, 0, 0, 903, 920, 3, 122, 61, 0, 904, 908, 5, 3, 0, 0, 905, 907, 5, - 36, 0, 0, 906, 905, 1, 0, 0, 0, 907, 910, 1, 0, 0, 0, 908, 906, 1, 0, 0, - 0, 908, 909, 1, 0, 0, 0, 909, 911, 1, 0, 0, 0, 910, 908, 1, 0, 0, 0, 911, - 915, 3, 122, 61, 0, 912, 914, 5, 36, 0, 0, 913, 912, 1, 0, 0, 0, 914, 917, - 1, 0, 0, 0, 915, 913, 1, 0, 0, 0, 915, 916, 1, 0, 0, 0, 916, 919, 1, 0, - 0, 0, 917, 915, 1, 0, 0, 0, 918, 904, 1, 0, 0, 0, 919, 922, 1, 0, 0, 0, - 920, 918, 1, 0, 0, 0, 920, 921, 1, 0, 0, 0, 921, 923, 1, 0, 0, 0, 922, - 920, 1, 0, 0, 0, 923, 924, 5, 16, 0, 0, 924, 139, 1, 0, 0, 0, 120, 143, - 145, 155, 162, 167, 175, 183, 189, 196, 202, 208, 214, 230, 235, 242, 252, - 259, 266, 271, 277, 281, 284, 290, 294, 303, 310, 315, 320, 325, 329, 335, - 343, 349, 355, 363, 369, 376, 384, 390, 396, 405, 412, 422, 429, 433, 441, - 446, 454, 461, 468, 474, 478, 484, 491, 497, 503, 507, 514, 525, 529, 536, - 539, 546, 554, 561, 568, 574, 580, 588, 598, 608, 612, 622, 629, 634, 637, - 643, 647, 655, 661, 670, 677, 684, 690, 696, 700, 705, 712, 719, 722, 728, - 731, 739, 748, 755, 760, 766, 775, 779, 784, 788, 796, 803, 807, 812, 821, - 827, 834, 838, 841, 845, 851, 859, 865, 877, 893, 900, 908, 915, 920, + 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, + 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 1, 0, 1, 0, 1, 0, 5, 0, 158, + 8, 0, 10, 0, 12, 0, 161, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 1, 170, 8, 1, 1, 2, 1, 2, 1, 2, 4, 2, 175, 8, 2, 11, 2, 12, 2, 176, + 1, 3, 1, 3, 1, 3, 3, 3, 182, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 188, 8, + 4, 10, 4, 12, 4, 191, 9, 4, 1, 4, 1, 4, 1, 5, 4, 5, 196, 8, 5, 11, 5, 12, + 5, 197, 1, 6, 1, 6, 5, 6, 202, 8, 6, 10, 6, 12, 6, 205, 9, 6, 1, 6, 1, + 6, 5, 6, 209, 8, 6, 10, 6, 12, 6, 212, 9, 6, 1, 6, 5, 6, 215, 8, 6, 10, + 6, 12, 6, 218, 9, 6, 1, 6, 1, 6, 1, 7, 3, 7, 223, 8, 7, 1, 7, 1, 7, 5, + 7, 227, 8, 7, 10, 7, 12, 7, 230, 9, 7, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, + 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 5, 11, 243, 8, 11, 10, 11, 12, 11, + 246, 9, 11, 1, 12, 1, 12, 3, 12, 250, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, + 1, 14, 3, 14, 257, 8, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 3, + 17, 265, 8, 17, 1, 18, 3, 18, 268, 8, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, + 19, 5, 19, 275, 8, 19, 10, 19, 12, 19, 278, 9, 19, 1, 19, 1, 19, 5, 19, + 282, 8, 19, 10, 19, 12, 19, 285, 9, 19, 1, 19, 3, 19, 288, 8, 19, 1, 19, + 1, 19, 5, 19, 292, 8, 19, 10, 19, 12, 19, 295, 9, 19, 5, 19, 297, 8, 19, + 10, 19, 12, 19, 300, 9, 19, 1, 19, 1, 19, 1, 20, 1, 20, 3, 20, 306, 8, + 20, 1, 20, 3, 20, 309, 8, 20, 1, 21, 1, 21, 5, 21, 313, 8, 21, 10, 21, + 12, 21, 316, 9, 21, 1, 21, 3, 21, 319, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, + 1, 22, 5, 22, 326, 8, 22, 10, 22, 12, 22, 329, 9, 22, 1, 22, 1, 22, 5, + 22, 333, 8, 22, 10, 22, 12, 22, 336, 9, 22, 5, 22, 338, 8, 22, 10, 22, + 12, 22, 341, 9, 22, 1, 23, 1, 23, 3, 23, 345, 8, 23, 1, 24, 1, 24, 1, 24, + 3, 24, 350, 8, 24, 1, 25, 1, 25, 3, 25, 354, 8, 25, 1, 26, 1, 26, 5, 26, + 358, 8, 26, 10, 26, 12, 26, 361, 9, 26, 1, 26, 1, 26, 1, 26, 5, 26, 366, + 8, 26, 10, 26, 12, 26, 369, 9, 26, 1, 26, 5, 26, 372, 8, 26, 10, 26, 12, + 26, 375, 9, 26, 1, 26, 5, 26, 378, 8, 26, 10, 26, 12, 26, 381, 9, 26, 1, + 26, 1, 26, 1, 27, 1, 27, 3, 27, 387, 8, 27, 1, 28, 1, 28, 5, 28, 391, 8, + 28, 10, 28, 12, 28, 394, 9, 28, 1, 28, 1, 28, 5, 28, 398, 8, 28, 10, 28, + 12, 28, 401, 9, 28, 1, 28, 1, 28, 1, 28, 5, 28, 406, 8, 28, 10, 28, 12, + 28, 409, 9, 28, 1, 28, 5, 28, 412, 8, 28, 10, 28, 12, 28, 415, 9, 28, 1, + 28, 5, 28, 418, 8, 28, 10, 28, 12, 28, 421, 9, 28, 1, 28, 1, 28, 1, 29, + 1, 29, 5, 29, 427, 8, 29, 10, 29, 12, 29, 430, 9, 29, 1, 29, 1, 29, 5, + 29, 434, 8, 29, 10, 29, 12, 29, 437, 9, 29, 1, 29, 3, 29, 440, 8, 29, 1, + 29, 1, 29, 1, 30, 1, 30, 4, 30, 446, 8, 30, 11, 30, 12, 30, 447, 1, 30, + 5, 30, 451, 8, 30, 10, 30, 12, 30, 454, 9, 30, 1, 31, 1, 31, 1, 31, 5, + 31, 459, 8, 31, 10, 31, 12, 31, 462, 9, 31, 1, 32, 1, 32, 5, 32, 466, 8, + 32, 10, 32, 12, 32, 469, 9, 32, 1, 32, 1, 32, 5, 32, 473, 8, 32, 10, 32, + 12, 32, 476, 9, 32, 1, 32, 4, 32, 479, 8, 32, 11, 32, 12, 32, 480, 1, 33, + 1, 33, 3, 33, 485, 8, 33, 1, 34, 1, 34, 3, 34, 489, 8, 34, 1, 35, 3, 35, + 492, 8, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 5, 36, 499, 8, 36, 10, 36, + 12, 36, 502, 9, 36, 1, 36, 1, 36, 5, 36, 506, 8, 36, 10, 36, 12, 36, 509, + 9, 36, 1, 36, 3, 36, 512, 8, 36, 1, 36, 5, 36, 515, 8, 36, 10, 36, 12, + 36, 518, 9, 36, 1, 36, 1, 36, 1, 37, 1, 37, 3, 37, 524, 8, 37, 1, 37, 1, + 37, 1, 37, 5, 37, 529, 8, 37, 10, 37, 12, 37, 532, 9, 37, 1, 38, 1, 38, + 1, 39, 1, 39, 1, 40, 1, 40, 5, 40, 540, 8, 40, 10, 40, 12, 40, 543, 9, + 40, 1, 40, 3, 40, 546, 8, 40, 1, 40, 1, 40, 1, 40, 5, 40, 551, 8, 40, 10, + 40, 12, 40, 554, 9, 40, 3, 40, 556, 8, 40, 1, 40, 1, 40, 1, 41, 5, 41, + 561, 8, 41, 10, 41, 12, 41, 564, 9, 41, 1, 41, 1, 41, 1, 41, 5, 41, 569, + 8, 41, 10, 41, 12, 41, 572, 9, 41, 1, 42, 1, 42, 3, 42, 576, 8, 42, 1, + 43, 3, 43, 579, 8, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 5, 44, 586, 8, + 44, 10, 44, 12, 44, 589, 9, 44, 1, 44, 1, 44, 5, 44, 593, 8, 44, 10, 44, + 12, 44, 596, 9, 44, 1, 44, 3, 44, 599, 8, 44, 1, 44, 5, 44, 602, 8, 44, + 10, 44, 12, 44, 605, 9, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, + 45, 5, 45, 614, 8, 45, 10, 45, 12, 45, 617, 9, 45, 1, 46, 1, 46, 1, 46, + 1, 46, 1, 46, 1, 46, 1, 46, 3, 46, 626, 8, 46, 1, 47, 1, 47, 1, 48, 1, + 48, 1, 49, 1, 49, 5, 49, 634, 8, 49, 10, 49, 12, 49, 637, 9, 49, 1, 49, + 3, 49, 640, 8, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 5, 50, 648, + 8, 50, 10, 50, 12, 50, 651, 9, 50, 1, 50, 1, 50, 5, 50, 655, 8, 50, 10, + 50, 12, 50, 658, 9, 50, 5, 50, 660, 8, 50, 10, 50, 12, 50, 663, 9, 50, + 3, 50, 665, 8, 50, 1, 51, 1, 51, 5, 51, 669, 8, 51, 10, 51, 12, 51, 672, + 9, 51, 1, 51, 3, 51, 675, 8, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 5, + 52, 682, 8, 52, 10, 52, 12, 52, 685, 9, 52, 1, 52, 5, 52, 688, 8, 52, 10, + 52, 12, 52, 691, 9, 52, 1, 52, 3, 52, 694, 8, 52, 1, 53, 1, 53, 1, 53, + 1, 53, 5, 53, 700, 8, 53, 10, 53, 12, 53, 703, 9, 53, 1, 54, 1, 54, 3, + 54, 707, 8, 54, 1, 55, 3, 55, 710, 8, 55, 1, 55, 3, 55, 713, 8, 55, 1, + 55, 1, 55, 1, 55, 1, 56, 1, 56, 5, 56, 720, 8, 56, 10, 56, 12, 56, 723, + 9, 56, 1, 56, 1, 56, 5, 56, 727, 8, 56, 10, 56, 12, 56, 730, 9, 56, 1, + 56, 3, 56, 733, 8, 56, 1, 56, 3, 56, 736, 8, 56, 1, 56, 5, 56, 739, 8, + 56, 10, 56, 12, 56, 742, 9, 56, 1, 56, 1, 56, 1, 57, 1, 57, 3, 57, 748, + 8, 57, 1, 57, 5, 57, 751, 8, 57, 10, 57, 12, 57, 754, 9, 57, 1, 58, 1, + 58, 5, 58, 758, 8, 58, 10, 58, 12, 58, 761, 9, 58, 1, 58, 1, 58, 5, 58, + 765, 8, 58, 10, 58, 12, 58, 768, 9, 58, 3, 58, 770, 8, 58, 1, 58, 1, 58, + 5, 58, 774, 8, 58, 10, 58, 12, 58, 777, 9, 58, 3, 58, 779, 8, 58, 1, 58, + 1, 58, 1, 59, 1, 59, 5, 59, 785, 8, 59, 10, 59, 12, 59, 788, 9, 59, 1, + 59, 1, 59, 1, 60, 1, 60, 5, 60, 794, 8, 60, 10, 60, 12, 60, 797, 9, 60, + 1, 60, 1, 60, 5, 60, 801, 8, 60, 10, 60, 12, 60, 804, 9, 60, 5, 60, 806, + 8, 60, 10, 60, 12, 60, 809, 9, 60, 1, 60, 1, 60, 1, 61, 3, 61, 814, 8, + 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 5, 62, 821, 8, 62, 10, 62, 12, 62, + 824, 9, 62, 1, 62, 3, 62, 827, 8, 62, 1, 62, 5, 62, 830, 8, 62, 10, 62, + 12, 62, 833, 9, 62, 1, 62, 3, 62, 836, 8, 62, 1, 63, 1, 63, 1, 64, 1, 64, + 5, 64, 842, 8, 64, 10, 64, 12, 64, 845, 9, 64, 1, 64, 1, 64, 5, 64, 849, + 8, 64, 10, 64, 12, 64, 852, 9, 64, 1, 64, 3, 64, 855, 8, 64, 1, 64, 5, + 64, 858, 8, 64, 10, 64, 12, 64, 861, 9, 64, 1, 64, 1, 64, 1, 65, 1, 65, + 5, 65, 867, 8, 65, 10, 65, 12, 65, 870, 9, 65, 1, 65, 5, 65, 873, 8, 65, + 10, 65, 12, 65, 876, 9, 65, 1, 66, 1, 66, 1, 66, 1, 66, 3, 66, 882, 8, + 66, 1, 67, 1, 67, 3, 67, 886, 8, 67, 1, 67, 3, 67, 889, 8, 67, 1, 68, 1, + 68, 3, 68, 893, 8, 68, 1, 69, 1, 69, 5, 69, 897, 8, 69, 10, 69, 12, 69, + 900, 9, 69, 1, 69, 1, 69, 1, 69, 5, 69, 905, 8, 69, 10, 69, 12, 69, 908, + 9, 69, 1, 69, 5, 69, 911, 8, 69, 10, 69, 12, 69, 914, 9, 69, 1, 69, 1, + 69, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 3, 71, 925, 8, 71, + 1, 72, 1, 72, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, + 75, 1, 75, 5, 75, 939, 8, 75, 10, 75, 12, 75, 942, 9, 75, 1, 76, 1, 76, + 5, 76, 946, 8, 76, 10, 76, 12, 76, 949, 9, 76, 1, 76, 1, 76, 1, 76, 5, + 76, 954, 8, 76, 10, 76, 12, 76, 957, 9, 76, 1, 76, 1, 76, 5, 76, 961, 8, + 76, 10, 76, 12, 76, 964, 9, 76, 5, 76, 966, 8, 76, 10, 76, 12, 76, 969, + 9, 76, 1, 76, 1, 76, 1, 76, 0, 0, 77, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, + 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, + 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, + 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, + 152, 0, 2, 2, 0, 9, 9, 33, 33, 1, 0, 20, 21, 1035, 0, 159, 1, 0, 0, 0, + 2, 169, 1, 0, 0, 0, 4, 174, 1, 0, 0, 0, 6, 178, 1, 0, 0, 0, 8, 183, 1, + 0, 0, 0, 10, 195, 1, 0, 0, 0, 12, 199, 1, 0, 0, 0, 14, 222, 1, 0, 0, 0, + 16, 231, 1, 0, 0, 0, 18, 233, 1, 0, 0, 0, 20, 237, 1, 0, 0, 0, 22, 239, + 1, 0, 0, 0, 24, 249, 1, 0, 0, 0, 26, 251, 1, 0, 0, 0, 28, 253, 1, 0, 0, + 0, 30, 258, 1, 0, 0, 0, 32, 260, 1, 0, 0, 0, 34, 264, 1, 0, 0, 0, 36, 267, + 1, 0, 0, 0, 38, 272, 1, 0, 0, 0, 40, 303, 1, 0, 0, 0, 42, 310, 1, 0, 0, + 0, 44, 322, 1, 0, 0, 0, 46, 342, 1, 0, 0, 0, 48, 349, 1, 0, 0, 0, 50, 351, + 1, 0, 0, 0, 52, 355, 1, 0, 0, 0, 54, 386, 1, 0, 0, 0, 56, 388, 1, 0, 0, + 0, 58, 424, 1, 0, 0, 0, 60, 443, 1, 0, 0, 0, 62, 455, 1, 0, 0, 0, 64, 463, + 1, 0, 0, 0, 66, 484, 1, 0, 0, 0, 68, 488, 1, 0, 0, 0, 70, 491, 1, 0, 0, + 0, 72, 496, 1, 0, 0, 0, 74, 521, 1, 0, 0, 0, 76, 533, 1, 0, 0, 0, 78, 535, + 1, 0, 0, 0, 80, 537, 1, 0, 0, 0, 82, 562, 1, 0, 0, 0, 84, 575, 1, 0, 0, + 0, 86, 578, 1, 0, 0, 0, 88, 583, 1, 0, 0, 0, 90, 608, 1, 0, 0, 0, 92, 625, + 1, 0, 0, 0, 94, 627, 1, 0, 0, 0, 96, 629, 1, 0, 0, 0, 98, 631, 1, 0, 0, + 0, 100, 664, 1, 0, 0, 0, 102, 666, 1, 0, 0, 0, 104, 678, 1, 0, 0, 0, 106, + 695, 1, 0, 0, 0, 108, 706, 1, 0, 0, 0, 110, 709, 1, 0, 0, 0, 112, 717, + 1, 0, 0, 0, 114, 745, 1, 0, 0, 0, 116, 755, 1, 0, 0, 0, 118, 782, 1, 0, + 0, 0, 120, 791, 1, 0, 0, 0, 122, 813, 1, 0, 0, 0, 124, 818, 1, 0, 0, 0, + 126, 837, 1, 0, 0, 0, 128, 839, 1, 0, 0, 0, 130, 864, 1, 0, 0, 0, 132, + 877, 1, 0, 0, 0, 134, 885, 1, 0, 0, 0, 136, 892, 1, 0, 0, 0, 138, 894, + 1, 0, 0, 0, 140, 917, 1, 0, 0, 0, 142, 920, 1, 0, 0, 0, 144, 926, 1, 0, + 0, 0, 146, 928, 1, 0, 0, 0, 148, 930, 1, 0, 0, 0, 150, 934, 1, 0, 0, 0, + 152, 943, 1, 0, 0, 0, 154, 158, 5, 37, 0, 0, 155, 158, 5, 31, 0, 0, 156, + 158, 3, 2, 1, 0, 157, 154, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 156, + 1, 0, 0, 0, 158, 161, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 159, 160, 1, 0, + 0, 0, 160, 162, 1, 0, 0, 0, 161, 159, 1, 0, 0, 0, 162, 163, 5, 0, 0, 1, + 163, 1, 1, 0, 0, 0, 164, 170, 3, 12, 6, 0, 165, 170, 3, 34, 17, 0, 166, + 170, 3, 68, 34, 0, 167, 170, 3, 84, 42, 0, 168, 170, 3, 108, 54, 0, 169, + 164, 1, 0, 0, 0, 169, 165, 1, 0, 0, 0, 169, 166, 1, 0, 0, 0, 169, 167, + 1, 0, 0, 0, 169, 168, 1, 0, 0, 0, 170, 3, 1, 0, 0, 0, 171, 172, 3, 6, 3, + 0, 172, 173, 5, 37, 0, 0, 173, 175, 1, 0, 0, 0, 174, 171, 1, 0, 0, 0, 175, + 176, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 5, 1, + 0, 0, 0, 178, 179, 5, 1, 0, 0, 179, 181, 5, 33, 0, 0, 180, 182, 3, 8, 4, + 0, 181, 180, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 7, 1, 0, 0, 0, 183, + 184, 5, 2, 0, 0, 184, 189, 3, 10, 5, 0, 185, 186, 5, 3, 0, 0, 186, 188, + 3, 10, 5, 0, 187, 185, 1, 0, 0, 0, 188, 191, 1, 0, 0, 0, 189, 187, 1, 0, + 0, 0, 189, 190, 1, 0, 0, 0, 190, 192, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, + 192, 193, 5, 4, 0, 0, 193, 9, 1, 0, 0, 0, 194, 196, 5, 33, 0, 0, 195, 194, + 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, 198, 1, 0, + 0, 0, 198, 11, 1, 0, 0, 0, 199, 203, 5, 5, 0, 0, 200, 202, 5, 37, 0, 0, + 201, 200, 1, 0, 0, 0, 202, 205, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 203, + 204, 1, 0, 0, 0, 204, 206, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 206, 210, + 5, 6, 0, 0, 207, 209, 5, 37, 0, 0, 208, 207, 1, 0, 0, 0, 209, 212, 1, 0, + 0, 0, 210, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 216, 1, 0, 0, 0, + 212, 210, 1, 0, 0, 0, 213, 215, 3, 14, 7, 0, 214, 213, 1, 0, 0, 0, 215, + 218, 1, 0, 0, 0, 216, 214, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 219, + 1, 0, 0, 0, 218, 216, 1, 0, 0, 0, 219, 220, 5, 7, 0, 0, 220, 13, 1, 0, + 0, 0, 221, 223, 3, 16, 8, 0, 222, 221, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, + 223, 224, 1, 0, 0, 0, 224, 228, 3, 18, 9, 0, 225, 227, 5, 37, 0, 0, 226, + 225, 1, 0, 0, 0, 227, 230, 1, 0, 0, 0, 228, 226, 1, 0, 0, 0, 228, 229, + 1, 0, 0, 0, 229, 15, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 231, 232, 5, 33, + 0, 0, 232, 17, 1, 0, 0, 0, 233, 234, 3, 20, 10, 0, 234, 235, 5, 8, 0, 0, + 235, 236, 3, 22, 11, 0, 236, 19, 1, 0, 0, 0, 237, 238, 7, 0, 0, 0, 238, + 21, 1, 0, 0, 0, 239, 244, 5, 33, 0, 0, 240, 241, 5, 8, 0, 0, 241, 243, + 5, 33, 0, 0, 242, 240, 1, 0, 0, 0, 243, 246, 1, 0, 0, 0, 244, 242, 1, 0, + 0, 0, 244, 245, 1, 0, 0, 0, 245, 23, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, + 247, 250, 3, 26, 13, 0, 248, 250, 3, 28, 14, 0, 249, 247, 1, 0, 0, 0, 249, + 248, 1, 0, 0, 0, 250, 25, 1, 0, 0, 0, 251, 252, 5, 33, 0, 0, 252, 27, 1, + 0, 0, 0, 253, 256, 3, 30, 15, 0, 254, 255, 5, 10, 0, 0, 255, 257, 3, 32, + 16, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, 257, 29, 1, 0, 0, 0, + 258, 259, 5, 33, 0, 0, 259, 31, 1, 0, 0, 0, 260, 261, 5, 33, 0, 0, 261, + 33, 1, 0, 0, 0, 262, 265, 3, 36, 18, 0, 263, 265, 3, 38, 19, 0, 264, 262, + 1, 0, 0, 0, 264, 263, 1, 0, 0, 0, 265, 35, 1, 0, 0, 0, 266, 268, 5, 32, + 0, 0, 267, 266, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, 268, 269, 1, 0, 0, 0, + 269, 270, 5, 11, 0, 0, 270, 271, 3, 40, 20, 0, 271, 37, 1, 0, 0, 0, 272, + 276, 5, 11, 0, 0, 273, 275, 5, 37, 0, 0, 274, 273, 1, 0, 0, 0, 275, 278, + 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 279, 1, 0, + 0, 0, 278, 276, 1, 0, 0, 0, 279, 283, 5, 6, 0, 0, 280, 282, 5, 37, 0, 0, + 281, 280, 1, 0, 0, 0, 282, 285, 1, 0, 0, 0, 283, 281, 1, 0, 0, 0, 283, + 284, 1, 0, 0, 0, 284, 298, 1, 0, 0, 0, 285, 283, 1, 0, 0, 0, 286, 288, + 5, 32, 0, 0, 287, 286, 1, 0, 0, 0, 287, 288, 1, 0, 0, 0, 288, 289, 1, 0, + 0, 0, 289, 293, 3, 40, 20, 0, 290, 292, 5, 37, 0, 0, 291, 290, 1, 0, 0, + 0, 292, 295, 1, 0, 0, 0, 293, 291, 1, 0, 0, 0, 293, 294, 1, 0, 0, 0, 294, + 297, 1, 0, 0, 0, 295, 293, 1, 0, 0, 0, 296, 287, 1, 0, 0, 0, 297, 300, + 1, 0, 0, 0, 298, 296, 1, 0, 0, 0, 298, 299, 1, 0, 0, 0, 299, 301, 1, 0, + 0, 0, 300, 298, 1, 0, 0, 0, 301, 302, 5, 7, 0, 0, 302, 39, 1, 0, 0, 0, + 303, 305, 5, 33, 0, 0, 304, 306, 3, 42, 21, 0, 305, 304, 1, 0, 0, 0, 305, + 306, 1, 0, 0, 0, 306, 308, 1, 0, 0, 0, 307, 309, 3, 48, 24, 0, 308, 307, + 1, 0, 0, 0, 308, 309, 1, 0, 0, 0, 309, 41, 1, 0, 0, 0, 310, 314, 5, 12, + 0, 0, 311, 313, 5, 37, 0, 0, 312, 311, 1, 0, 0, 0, 313, 316, 1, 0, 0, 0, + 314, 312, 1, 0, 0, 0, 314, 315, 1, 0, 0, 0, 315, 318, 1, 0, 0, 0, 316, + 314, 1, 0, 0, 0, 317, 319, 3, 44, 22, 0, 318, 317, 1, 0, 0, 0, 318, 319, + 1, 0, 0, 0, 319, 320, 1, 0, 0, 0, 320, 321, 5, 13, 0, 0, 321, 43, 1, 0, + 0, 0, 322, 339, 3, 46, 23, 0, 323, 327, 5, 3, 0, 0, 324, 326, 5, 37, 0, + 0, 325, 324, 1, 0, 0, 0, 326, 329, 1, 0, 0, 0, 327, 325, 1, 0, 0, 0, 327, + 328, 1, 0, 0, 0, 328, 330, 1, 0, 0, 0, 329, 327, 1, 0, 0, 0, 330, 334, + 3, 46, 23, 0, 331, 333, 5, 37, 0, 0, 332, 331, 1, 0, 0, 0, 333, 336, 1, + 0, 0, 0, 334, 332, 1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 338, 1, 0, 0, + 0, 336, 334, 1, 0, 0, 0, 337, 323, 1, 0, 0, 0, 338, 341, 1, 0, 0, 0, 339, + 337, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 45, 1, 0, 0, 0, 341, 339, 1, + 0, 0, 0, 342, 344, 5, 33, 0, 0, 343, 345, 3, 48, 24, 0, 344, 343, 1, 0, + 0, 0, 344, 345, 1, 0, 0, 0, 345, 47, 1, 0, 0, 0, 346, 350, 3, 50, 25, 0, + 347, 350, 3, 54, 27, 0, 348, 350, 3, 64, 32, 0, 349, 346, 1, 0, 0, 0, 349, + 347, 1, 0, 0, 0, 349, 348, 1, 0, 0, 0, 350, 49, 1, 0, 0, 0, 351, 353, 3, + 24, 12, 0, 352, 354, 3, 52, 26, 0, 353, 352, 1, 0, 0, 0, 353, 354, 1, 0, + 0, 0, 354, 51, 1, 0, 0, 0, 355, 359, 5, 12, 0, 0, 356, 358, 5, 37, 0, 0, + 357, 356, 1, 0, 0, 0, 358, 361, 1, 0, 0, 0, 359, 357, 1, 0, 0, 0, 359, + 360, 1, 0, 0, 0, 360, 362, 1, 0, 0, 0, 361, 359, 1, 0, 0, 0, 362, 373, + 3, 48, 24, 0, 363, 367, 5, 3, 0, 0, 364, 366, 5, 37, 0, 0, 365, 364, 1, + 0, 0, 0, 366, 369, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, + 0, 368, 370, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, 370, 372, 3, 48, 24, 0, + 371, 363, 1, 0, 0, 0, 372, 375, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, + 374, 1, 0, 0, 0, 374, 379, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0, 376, 378, + 5, 37, 0, 0, 377, 376, 1, 0, 0, 0, 378, 381, 1, 0, 0, 0, 379, 377, 1, 0, + 0, 0, 379, 380, 1, 0, 0, 0, 380, 382, 1, 0, 0, 0, 381, 379, 1, 0, 0, 0, + 382, 383, 5, 13, 0, 0, 383, 53, 1, 0, 0, 0, 384, 387, 3, 56, 28, 0, 385, + 387, 3, 58, 29, 0, 386, 384, 1, 0, 0, 0, 386, 385, 1, 0, 0, 0, 387, 55, + 1, 0, 0, 0, 388, 392, 5, 14, 0, 0, 389, 391, 5, 37, 0, 0, 390, 389, 1, + 0, 0, 0, 391, 394, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 392, 393, 1, 0, 0, + 0, 393, 395, 1, 0, 0, 0, 394, 392, 1, 0, 0, 0, 395, 399, 5, 6, 0, 0, 396, + 398, 5, 37, 0, 0, 397, 396, 1, 0, 0, 0, 398, 401, 1, 0, 0, 0, 399, 397, + 1, 0, 0, 0, 399, 400, 1, 0, 0, 0, 400, 402, 1, 0, 0, 0, 401, 399, 1, 0, + 0, 0, 402, 413, 5, 33, 0, 0, 403, 407, 5, 3, 0, 0, 404, 406, 5, 37, 0, + 0, 405, 404, 1, 0, 0, 0, 406, 409, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 407, + 408, 1, 0, 0, 0, 408, 410, 1, 0, 0, 0, 409, 407, 1, 0, 0, 0, 410, 412, + 5, 33, 0, 0, 411, 403, 1, 0, 0, 0, 412, 415, 1, 0, 0, 0, 413, 411, 1, 0, + 0, 0, 413, 414, 1, 0, 0, 0, 414, 419, 1, 0, 0, 0, 415, 413, 1, 0, 0, 0, + 416, 418, 5, 37, 0, 0, 417, 416, 1, 0, 0, 0, 418, 421, 1, 0, 0, 0, 419, + 417, 1, 0, 0, 0, 419, 420, 1, 0, 0, 0, 420, 422, 1, 0, 0, 0, 421, 419, + 1, 0, 0, 0, 422, 423, 5, 7, 0, 0, 423, 57, 1, 0, 0, 0, 424, 428, 5, 15, + 0, 0, 425, 427, 5, 37, 0, 0, 426, 425, 1, 0, 0, 0, 427, 430, 1, 0, 0, 0, + 428, 426, 1, 0, 0, 0, 428, 429, 1, 0, 0, 0, 429, 431, 1, 0, 0, 0, 430, + 428, 1, 0, 0, 0, 431, 435, 5, 6, 0, 0, 432, 434, 5, 37, 0, 0, 433, 432, + 1, 0, 0, 0, 434, 437, 1, 0, 0, 0, 435, 433, 1, 0, 0, 0, 435, 436, 1, 0, + 0, 0, 436, 439, 1, 0, 0, 0, 437, 435, 1, 0, 0, 0, 438, 440, 3, 60, 30, + 0, 439, 438, 1, 0, 0, 0, 439, 440, 1, 0, 0, 0, 440, 441, 1, 0, 0, 0, 441, + 442, 5, 7, 0, 0, 442, 59, 1, 0, 0, 0, 443, 452, 3, 62, 31, 0, 444, 446, + 5, 37, 0, 0, 445, 444, 1, 0, 0, 0, 446, 447, 1, 0, 0, 0, 447, 445, 1, 0, + 0, 0, 447, 448, 1, 0, 0, 0, 448, 449, 1, 0, 0, 0, 449, 451, 3, 62, 31, + 0, 450, 445, 1, 0, 0, 0, 451, 454, 1, 0, 0, 0, 452, 450, 1, 0, 0, 0, 452, + 453, 1, 0, 0, 0, 453, 61, 1, 0, 0, 0, 454, 452, 1, 0, 0, 0, 455, 456, 5, + 33, 0, 0, 456, 460, 3, 48, 24, 0, 457, 459, 5, 37, 0, 0, 458, 457, 1, 0, + 0, 0, 459, 462, 1, 0, 0, 0, 460, 458, 1, 0, 0, 0, 460, 461, 1, 0, 0, 0, + 461, 63, 1, 0, 0, 0, 462, 460, 1, 0, 0, 0, 463, 478, 3, 66, 33, 0, 464, + 466, 5, 37, 0, 0, 465, 464, 1, 0, 0, 0, 466, 469, 1, 0, 0, 0, 467, 465, + 1, 0, 0, 0, 467, 468, 1, 0, 0, 0, 468, 470, 1, 0, 0, 0, 469, 467, 1, 0, + 0, 0, 470, 474, 5, 16, 0, 0, 471, 473, 5, 37, 0, 0, 472, 471, 1, 0, 0, + 0, 473, 476, 1, 0, 0, 0, 474, 472, 1, 0, 0, 0, 474, 475, 1, 0, 0, 0, 475, + 477, 1, 0, 0, 0, 476, 474, 1, 0, 0, 0, 477, 479, 3, 66, 33, 0, 478, 467, + 1, 0, 0, 0, 479, 480, 1, 0, 0, 0, 480, 478, 1, 0, 0, 0, 480, 481, 1, 0, + 0, 0, 481, 65, 1, 0, 0, 0, 482, 485, 3, 50, 25, 0, 483, 485, 3, 54, 27, + 0, 484, 482, 1, 0, 0, 0, 484, 483, 1, 0, 0, 0, 485, 67, 1, 0, 0, 0, 486, + 489, 3, 70, 35, 0, 487, 489, 3, 72, 36, 0, 488, 486, 1, 0, 0, 0, 488, 487, + 1, 0, 0, 0, 489, 69, 1, 0, 0, 0, 490, 492, 5, 32, 0, 0, 491, 490, 1, 0, + 0, 0, 491, 492, 1, 0, 0, 0, 492, 493, 1, 0, 0, 0, 493, 494, 5, 17, 0, 0, + 494, 495, 3, 74, 37, 0, 495, 71, 1, 0, 0, 0, 496, 500, 5, 17, 0, 0, 497, + 499, 5, 37, 0, 0, 498, 497, 1, 0, 0, 0, 499, 502, 1, 0, 0, 0, 500, 498, + 1, 0, 0, 0, 500, 501, 1, 0, 0, 0, 501, 503, 1, 0, 0, 0, 502, 500, 1, 0, + 0, 0, 503, 507, 5, 6, 0, 0, 504, 506, 5, 37, 0, 0, 505, 504, 1, 0, 0, 0, + 506, 509, 1, 0, 0, 0, 507, 505, 1, 0, 0, 0, 507, 508, 1, 0, 0, 0, 508, + 516, 1, 0, 0, 0, 509, 507, 1, 0, 0, 0, 510, 512, 5, 32, 0, 0, 511, 510, + 1, 0, 0, 0, 511, 512, 1, 0, 0, 0, 512, 513, 1, 0, 0, 0, 513, 515, 3, 74, + 37, 0, 514, 511, 1, 0, 0, 0, 515, 518, 1, 0, 0, 0, 516, 514, 1, 0, 0, 0, + 516, 517, 1, 0, 0, 0, 517, 519, 1, 0, 0, 0, 518, 516, 1, 0, 0, 0, 519, + 520, 5, 7, 0, 0, 520, 73, 1, 0, 0, 0, 521, 523, 5, 33, 0, 0, 522, 524, + 3, 42, 21, 0, 523, 522, 1, 0, 0, 0, 523, 524, 1, 0, 0, 0, 524, 525, 1, + 0, 0, 0, 525, 526, 3, 76, 38, 0, 526, 530, 3, 78, 39, 0, 527, 529, 5, 37, + 0, 0, 528, 527, 1, 0, 0, 0, 529, 532, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, + 530, 531, 1, 0, 0, 0, 531, 75, 1, 0, 0, 0, 532, 530, 1, 0, 0, 0, 533, 534, + 3, 80, 40, 0, 534, 77, 1, 0, 0, 0, 535, 536, 3, 80, 40, 0, 536, 79, 1, + 0, 0, 0, 537, 555, 5, 2, 0, 0, 538, 540, 5, 37, 0, 0, 539, 538, 1, 0, 0, + 0, 540, 543, 1, 0, 0, 0, 541, 539, 1, 0, 0, 0, 541, 542, 1, 0, 0, 0, 542, + 556, 1, 0, 0, 0, 543, 541, 1, 0, 0, 0, 544, 546, 3, 82, 41, 0, 545, 544, + 1, 0, 0, 0, 545, 546, 1, 0, 0, 0, 546, 556, 1, 0, 0, 0, 547, 552, 3, 82, + 41, 0, 548, 549, 5, 3, 0, 0, 549, 551, 3, 82, 41, 0, 550, 548, 1, 0, 0, + 0, 551, 554, 1, 0, 0, 0, 552, 550, 1, 0, 0, 0, 552, 553, 1, 0, 0, 0, 553, + 556, 1, 0, 0, 0, 554, 552, 1, 0, 0, 0, 555, 541, 1, 0, 0, 0, 555, 545, + 1, 0, 0, 0, 555, 547, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 558, 5, 4, + 0, 0, 558, 81, 1, 0, 0, 0, 559, 561, 5, 37, 0, 0, 560, 559, 1, 0, 0, 0, + 561, 564, 1, 0, 0, 0, 562, 560, 1, 0, 0, 0, 562, 563, 1, 0, 0, 0, 563, + 565, 1, 0, 0, 0, 564, 562, 1, 0, 0, 0, 565, 566, 5, 33, 0, 0, 566, 570, + 3, 48, 24, 0, 567, 569, 5, 37, 0, 0, 568, 567, 1, 0, 0, 0, 569, 572, 1, + 0, 0, 0, 570, 568, 1, 0, 0, 0, 570, 571, 1, 0, 0, 0, 571, 83, 1, 0, 0, + 0, 572, 570, 1, 0, 0, 0, 573, 576, 3, 86, 43, 0, 574, 576, 3, 88, 44, 0, + 575, 573, 1, 0, 0, 0, 575, 574, 1, 0, 0, 0, 576, 85, 1, 0, 0, 0, 577, 579, + 5, 32, 0, 0, 578, 577, 1, 0, 0, 0, 578, 579, 1, 0, 0, 0, 579, 580, 1, 0, + 0, 0, 580, 581, 5, 18, 0, 0, 581, 582, 3, 90, 45, 0, 582, 87, 1, 0, 0, + 0, 583, 587, 5, 18, 0, 0, 584, 586, 5, 37, 0, 0, 585, 584, 1, 0, 0, 0, + 586, 589, 1, 0, 0, 0, 587, 585, 1, 0, 0, 0, 587, 588, 1, 0, 0, 0, 588, + 590, 1, 0, 0, 0, 589, 587, 1, 0, 0, 0, 590, 594, 5, 6, 0, 0, 591, 593, + 5, 37, 0, 0, 592, 591, 1, 0, 0, 0, 593, 596, 1, 0, 0, 0, 594, 592, 1, 0, + 0, 0, 594, 595, 1, 0, 0, 0, 595, 603, 1, 0, 0, 0, 596, 594, 1, 0, 0, 0, + 597, 599, 5, 32, 0, 0, 598, 597, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, 599, + 600, 1, 0, 0, 0, 600, 602, 3, 90, 45, 0, 601, 598, 1, 0, 0, 0, 602, 605, + 1, 0, 0, 0, 603, 601, 1, 0, 0, 0, 603, 604, 1, 0, 0, 0, 604, 606, 1, 0, + 0, 0, 605, 603, 1, 0, 0, 0, 606, 607, 5, 7, 0, 0, 607, 89, 1, 0, 0, 0, + 608, 609, 5, 33, 0, 0, 609, 610, 5, 19, 0, 0, 610, 611, 3, 48, 24, 0, 611, + 615, 3, 92, 46, 0, 612, 614, 5, 37, 0, 0, 613, 612, 1, 0, 0, 0, 614, 617, + 1, 0, 0, 0, 615, 613, 1, 0, 0, 0, 615, 616, 1, 0, 0, 0, 616, 91, 1, 0, + 0, 0, 617, 615, 1, 0, 0, 0, 618, 626, 3, 96, 48, 0, 619, 626, 3, 94, 47, + 0, 620, 626, 5, 34, 0, 0, 621, 626, 5, 35, 0, 0, 622, 626, 5, 36, 0, 0, + 623, 626, 3, 98, 49, 0, 624, 626, 3, 102, 51, 0, 625, 618, 1, 0, 0, 0, + 625, 619, 1, 0, 0, 0, 625, 620, 1, 0, 0, 0, 625, 621, 1, 0, 0, 0, 625, + 622, 1, 0, 0, 0, 625, 623, 1, 0, 0, 0, 625, 624, 1, 0, 0, 0, 626, 93, 1, + 0, 0, 0, 627, 628, 7, 1, 0, 0, 628, 95, 1, 0, 0, 0, 629, 630, 5, 22, 0, + 0, 630, 97, 1, 0, 0, 0, 631, 635, 5, 23, 0, 0, 632, 634, 5, 37, 0, 0, 633, + 632, 1, 0, 0, 0, 634, 637, 1, 0, 0, 0, 635, 633, 1, 0, 0, 0, 635, 636, + 1, 0, 0, 0, 636, 639, 1, 0, 0, 0, 637, 635, 1, 0, 0, 0, 638, 640, 3, 100, + 50, 0, 639, 638, 1, 0, 0, 0, 639, 640, 1, 0, 0, 0, 640, 641, 1, 0, 0, 0, + 641, 642, 5, 24, 0, 0, 642, 99, 1, 0, 0, 0, 643, 665, 3, 92, 46, 0, 644, + 661, 3, 92, 46, 0, 645, 649, 5, 3, 0, 0, 646, 648, 5, 37, 0, 0, 647, 646, + 1, 0, 0, 0, 648, 651, 1, 0, 0, 0, 649, 647, 1, 0, 0, 0, 649, 650, 1, 0, + 0, 0, 650, 652, 1, 0, 0, 0, 651, 649, 1, 0, 0, 0, 652, 656, 3, 92, 46, + 0, 653, 655, 5, 37, 0, 0, 654, 653, 1, 0, 0, 0, 655, 658, 1, 0, 0, 0, 656, + 654, 1, 0, 0, 0, 656, 657, 1, 0, 0, 0, 657, 660, 1, 0, 0, 0, 658, 656, + 1, 0, 0, 0, 659, 645, 1, 0, 0, 0, 660, 663, 1, 0, 0, 0, 661, 659, 1, 0, + 0, 0, 661, 662, 1, 0, 0, 0, 662, 665, 1, 0, 0, 0, 663, 661, 1, 0, 0, 0, + 664, 643, 1, 0, 0, 0, 664, 644, 1, 0, 0, 0, 665, 101, 1, 0, 0, 0, 666, + 670, 5, 6, 0, 0, 667, 669, 5, 37, 0, 0, 668, 667, 1, 0, 0, 0, 669, 672, + 1, 0, 0, 0, 670, 668, 1, 0, 0, 0, 670, 671, 1, 0, 0, 0, 671, 674, 1, 0, + 0, 0, 672, 670, 1, 0, 0, 0, 673, 675, 3, 104, 52, 0, 674, 673, 1, 0, 0, + 0, 674, 675, 1, 0, 0, 0, 675, 676, 1, 0, 0, 0, 676, 677, 5, 7, 0, 0, 677, + 103, 1, 0, 0, 0, 678, 689, 3, 106, 53, 0, 679, 683, 5, 3, 0, 0, 680, 682, + 5, 37, 0, 0, 681, 680, 1, 0, 0, 0, 682, 685, 1, 0, 0, 0, 683, 681, 1, 0, + 0, 0, 683, 684, 1, 0, 0, 0, 684, 686, 1, 0, 0, 0, 685, 683, 1, 0, 0, 0, + 686, 688, 3, 106, 53, 0, 687, 679, 1, 0, 0, 0, 688, 691, 1, 0, 0, 0, 689, + 687, 1, 0, 0, 0, 689, 690, 1, 0, 0, 0, 690, 693, 1, 0, 0, 0, 691, 689, + 1, 0, 0, 0, 692, 694, 5, 3, 0, 0, 693, 692, 1, 0, 0, 0, 693, 694, 1, 0, + 0, 0, 694, 105, 1, 0, 0, 0, 695, 696, 5, 33, 0, 0, 696, 697, 5, 25, 0, + 0, 697, 701, 3, 92, 46, 0, 698, 700, 5, 37, 0, 0, 699, 698, 1, 0, 0, 0, + 700, 703, 1, 0, 0, 0, 701, 699, 1, 0, 0, 0, 701, 702, 1, 0, 0, 0, 702, + 107, 1, 0, 0, 0, 703, 701, 1, 0, 0, 0, 704, 707, 3, 110, 55, 0, 705, 707, + 3, 112, 56, 0, 706, 704, 1, 0, 0, 0, 706, 705, 1, 0, 0, 0, 707, 109, 1, + 0, 0, 0, 708, 710, 3, 4, 2, 0, 709, 708, 1, 0, 0, 0, 709, 710, 1, 0, 0, + 0, 710, 712, 1, 0, 0, 0, 711, 713, 5, 32, 0, 0, 712, 711, 1, 0, 0, 0, 712, + 713, 1, 0, 0, 0, 713, 714, 1, 0, 0, 0, 714, 715, 5, 26, 0, 0, 715, 716, + 3, 114, 57, 0, 716, 111, 1, 0, 0, 0, 717, 721, 5, 26, 0, 0, 718, 720, 5, + 37, 0, 0, 719, 718, 1, 0, 0, 0, 720, 723, 1, 0, 0, 0, 721, 719, 1, 0, 0, + 0, 721, 722, 1, 0, 0, 0, 722, 724, 1, 0, 0, 0, 723, 721, 1, 0, 0, 0, 724, + 728, 5, 6, 0, 0, 725, 727, 5, 37, 0, 0, 726, 725, 1, 0, 0, 0, 727, 730, + 1, 0, 0, 0, 728, 726, 1, 0, 0, 0, 728, 729, 1, 0, 0, 0, 729, 740, 1, 0, + 0, 0, 730, 728, 1, 0, 0, 0, 731, 733, 3, 4, 2, 0, 732, 731, 1, 0, 0, 0, + 732, 733, 1, 0, 0, 0, 733, 735, 1, 0, 0, 0, 734, 736, 5, 32, 0, 0, 735, + 734, 1, 0, 0, 0, 735, 736, 1, 0, 0, 0, 736, 737, 1, 0, 0, 0, 737, 739, + 3, 114, 57, 0, 738, 732, 1, 0, 0, 0, 739, 742, 1, 0, 0, 0, 740, 738, 1, + 0, 0, 0, 740, 741, 1, 0, 0, 0, 741, 743, 1, 0, 0, 0, 742, 740, 1, 0, 0, + 0, 743, 744, 5, 7, 0, 0, 744, 113, 1, 0, 0, 0, 745, 747, 3, 74, 37, 0, + 746, 748, 3, 116, 58, 0, 747, 746, 1, 0, 0, 0, 747, 748, 1, 0, 0, 0, 748, + 752, 1, 0, 0, 0, 749, 751, 5, 37, 0, 0, 750, 749, 1, 0, 0, 0, 751, 754, + 1, 0, 0, 0, 752, 750, 1, 0, 0, 0, 752, 753, 1, 0, 0, 0, 753, 115, 1, 0, + 0, 0, 754, 752, 1, 0, 0, 0, 755, 759, 5, 6, 0, 0, 756, 758, 5, 37, 0, 0, + 757, 756, 1, 0, 0, 0, 758, 761, 1, 0, 0, 0, 759, 757, 1, 0, 0, 0, 759, + 760, 1, 0, 0, 0, 760, 769, 1, 0, 0, 0, 761, 759, 1, 0, 0, 0, 762, 766, + 3, 118, 59, 0, 763, 765, 5, 37, 0, 0, 764, 763, 1, 0, 0, 0, 765, 768, 1, + 0, 0, 0, 766, 764, 1, 0, 0, 0, 766, 767, 1, 0, 0, 0, 767, 770, 1, 0, 0, + 0, 768, 766, 1, 0, 0, 0, 769, 762, 1, 0, 0, 0, 769, 770, 1, 0, 0, 0, 770, + 778, 1, 0, 0, 0, 771, 775, 3, 128, 64, 0, 772, 774, 5, 37, 0, 0, 773, 772, + 1, 0, 0, 0, 774, 777, 1, 0, 0, 0, 775, 773, 1, 0, 0, 0, 775, 776, 1, 0, + 0, 0, 776, 779, 1, 0, 0, 0, 777, 775, 1, 0, 0, 0, 778, 771, 1, 0, 0, 0, + 778, 779, 1, 0, 0, 0, 779, 780, 1, 0, 0, 0, 780, 781, 5, 7, 0, 0, 781, + 117, 1, 0, 0, 0, 782, 786, 5, 27, 0, 0, 783, 785, 5, 37, 0, 0, 784, 783, + 1, 0, 0, 0, 785, 788, 1, 0, 0, 0, 786, 784, 1, 0, 0, 0, 786, 787, 1, 0, + 0, 0, 787, 789, 1, 0, 0, 0, 788, 786, 1, 0, 0, 0, 789, 790, 3, 120, 60, + 0, 790, 119, 1, 0, 0, 0, 791, 795, 5, 6, 0, 0, 792, 794, 5, 37, 0, 0, 793, + 792, 1, 0, 0, 0, 794, 797, 1, 0, 0, 0, 795, 793, 1, 0, 0, 0, 795, 796, + 1, 0, 0, 0, 796, 807, 1, 0, 0, 0, 797, 795, 1, 0, 0, 0, 798, 802, 3, 122, + 61, 0, 799, 801, 5, 37, 0, 0, 800, 799, 1, 0, 0, 0, 801, 804, 1, 0, 0, + 0, 802, 800, 1, 0, 0, 0, 802, 803, 1, 0, 0, 0, 803, 806, 1, 0, 0, 0, 804, + 802, 1, 0, 0, 0, 805, 798, 1, 0, 0, 0, 806, 809, 1, 0, 0, 0, 807, 805, + 1, 0, 0, 0, 807, 808, 1, 0, 0, 0, 808, 810, 1, 0, 0, 0, 809, 807, 1, 0, + 0, 0, 810, 811, 5, 7, 0, 0, 811, 121, 1, 0, 0, 0, 812, 814, 3, 4, 2, 0, + 813, 812, 1, 0, 0, 0, 813, 814, 1, 0, 0, 0, 814, 815, 1, 0, 0, 0, 815, + 816, 5, 33, 0, 0, 816, 817, 3, 124, 62, 0, 817, 123, 1, 0, 0, 0, 818, 822, + 3, 24, 12, 0, 819, 821, 5, 37, 0, 0, 820, 819, 1, 0, 0, 0, 821, 824, 1, + 0, 0, 0, 822, 820, 1, 0, 0, 0, 822, 823, 1, 0, 0, 0, 823, 826, 1, 0, 0, + 0, 824, 822, 1, 0, 0, 0, 825, 827, 3, 52, 26, 0, 826, 825, 1, 0, 0, 0, + 826, 827, 1, 0, 0, 0, 827, 831, 1, 0, 0, 0, 828, 830, 5, 37, 0, 0, 829, + 828, 1, 0, 0, 0, 830, 833, 1, 0, 0, 0, 831, 829, 1, 0, 0, 0, 831, 832, + 1, 0, 0, 0, 832, 835, 1, 0, 0, 0, 833, 831, 1, 0, 0, 0, 834, 836, 3, 126, + 63, 0, 835, 834, 1, 0, 0, 0, 835, 836, 1, 0, 0, 0, 836, 125, 1, 0, 0, 0, + 837, 838, 3, 120, 60, 0, 838, 127, 1, 0, 0, 0, 839, 843, 5, 28, 0, 0, 840, + 842, 5, 37, 0, 0, 841, 840, 1, 0, 0, 0, 842, 845, 1, 0, 0, 0, 843, 841, + 1, 0, 0, 0, 843, 844, 1, 0, 0, 0, 844, 846, 1, 0, 0, 0, 845, 843, 1, 0, + 0, 0, 846, 850, 5, 6, 0, 0, 847, 849, 5, 37, 0, 0, 848, 847, 1, 0, 0, 0, + 849, 852, 1, 0, 0, 0, 850, 848, 1, 0, 0, 0, 850, 851, 1, 0, 0, 0, 851, + 854, 1, 0, 0, 0, 852, 850, 1, 0, 0, 0, 853, 855, 3, 130, 65, 0, 854, 853, + 1, 0, 0, 0, 854, 855, 1, 0, 0, 0, 855, 859, 1, 0, 0, 0, 856, 858, 5, 37, + 0, 0, 857, 856, 1, 0, 0, 0, 858, 861, 1, 0, 0, 0, 859, 857, 1, 0, 0, 0, + 859, 860, 1, 0, 0, 0, 860, 862, 1, 0, 0, 0, 861, 859, 1, 0, 0, 0, 862, + 863, 5, 7, 0, 0, 863, 129, 1, 0, 0, 0, 864, 874, 3, 132, 66, 0, 865, 867, + 5, 37, 0, 0, 866, 865, 1, 0, 0, 0, 867, 870, 1, 0, 0, 0, 868, 866, 1, 0, + 0, 0, 868, 869, 1, 0, 0, 0, 869, 871, 1, 0, 0, 0, 870, 868, 1, 0, 0, 0, + 871, 873, 3, 132, 66, 0, 872, 868, 1, 0, 0, 0, 873, 876, 1, 0, 0, 0, 874, + 872, 1, 0, 0, 0, 874, 875, 1, 0, 0, 0, 875, 131, 1, 0, 0, 0, 876, 874, + 1, 0, 0, 0, 877, 878, 3, 134, 67, 0, 878, 881, 5, 29, 0, 0, 879, 882, 3, + 136, 68, 0, 880, 882, 3, 152, 76, 0, 881, 879, 1, 0, 0, 0, 881, 880, 1, + 0, 0, 0, 882, 133, 1, 0, 0, 0, 883, 886, 3, 142, 71, 0, 884, 886, 3, 140, + 70, 0, 885, 883, 1, 0, 0, 0, 885, 884, 1, 0, 0, 0, 886, 888, 1, 0, 0, 0, + 887, 889, 3, 150, 75, 0, 888, 887, 1, 0, 0, 0, 888, 889, 1, 0, 0, 0, 889, + 135, 1, 0, 0, 0, 890, 893, 3, 142, 71, 0, 891, 893, 3, 138, 69, 0, 892, + 890, 1, 0, 0, 0, 892, 891, 1, 0, 0, 0, 893, 137, 1, 0, 0, 0, 894, 898, + 5, 2, 0, 0, 895, 897, 5, 37, 0, 0, 896, 895, 1, 0, 0, 0, 897, 900, 1, 0, + 0, 0, 898, 896, 1, 0, 0, 0, 898, 899, 1, 0, 0, 0, 899, 901, 1, 0, 0, 0, + 900, 898, 1, 0, 0, 0, 901, 906, 3, 132, 66, 0, 902, 903, 5, 37, 0, 0, 903, + 905, 3, 132, 66, 0, 904, 902, 1, 0, 0, 0, 905, 908, 1, 0, 0, 0, 906, 904, + 1, 0, 0, 0, 906, 907, 1, 0, 0, 0, 907, 912, 1, 0, 0, 0, 908, 906, 1, 0, + 0, 0, 909, 911, 5, 37, 0, 0, 910, 909, 1, 0, 0, 0, 911, 914, 1, 0, 0, 0, + 912, 910, 1, 0, 0, 0, 912, 913, 1, 0, 0, 0, 913, 915, 1, 0, 0, 0, 914, + 912, 1, 0, 0, 0, 915, 916, 5, 4, 0, 0, 916, 139, 1, 0, 0, 0, 917, 918, + 5, 30, 0, 0, 918, 919, 3, 24, 12, 0, 919, 141, 1, 0, 0, 0, 920, 921, 3, + 144, 72, 0, 921, 922, 5, 25, 0, 0, 922, 924, 3, 146, 73, 0, 923, 925, 3, + 148, 74, 0, 924, 923, 1, 0, 0, 0, 924, 925, 1, 0, 0, 0, 925, 143, 1, 0, + 0, 0, 926, 927, 5, 33, 0, 0, 927, 145, 1, 0, 0, 0, 928, 929, 5, 33, 0, + 0, 929, 147, 1, 0, 0, 0, 930, 931, 5, 23, 0, 0, 931, 932, 5, 34, 0, 0, + 932, 933, 5, 24, 0, 0, 933, 149, 1, 0, 0, 0, 934, 935, 5, 10, 0, 0, 935, + 940, 5, 33, 0, 0, 936, 937, 5, 10, 0, 0, 937, 939, 5, 33, 0, 0, 938, 936, + 1, 0, 0, 0, 939, 942, 1, 0, 0, 0, 940, 938, 1, 0, 0, 0, 940, 941, 1, 0, + 0, 0, 941, 151, 1, 0, 0, 0, 942, 940, 1, 0, 0, 0, 943, 947, 5, 23, 0, 0, + 944, 946, 5, 37, 0, 0, 945, 944, 1, 0, 0, 0, 946, 949, 1, 0, 0, 0, 947, + 945, 1, 0, 0, 0, 947, 948, 1, 0, 0, 0, 948, 950, 1, 0, 0, 0, 949, 947, + 1, 0, 0, 0, 950, 967, 3, 136, 68, 0, 951, 955, 5, 3, 0, 0, 952, 954, 5, + 37, 0, 0, 953, 952, 1, 0, 0, 0, 954, 957, 1, 0, 0, 0, 955, 953, 1, 0, 0, + 0, 955, 956, 1, 0, 0, 0, 956, 958, 1, 0, 0, 0, 957, 955, 1, 0, 0, 0, 958, + 962, 3, 136, 68, 0, 959, 961, 5, 37, 0, 0, 960, 959, 1, 0, 0, 0, 961, 964, + 1, 0, 0, 0, 962, 960, 1, 0, 0, 0, 962, 963, 1, 0, 0, 0, 963, 966, 1, 0, + 0, 0, 964, 962, 1, 0, 0, 0, 965, 951, 1, 0, 0, 0, 966, 969, 1, 0, 0, 0, + 967, 965, 1, 0, 0, 0, 967, 968, 1, 0, 0, 0, 968, 970, 1, 0, 0, 0, 969, + 967, 1, 0, 0, 0, 970, 971, 5, 24, 0, 0, 971, 153, 1, 0, 0, 0, 129, 157, + 159, 169, 176, 181, 189, 197, 203, 210, 216, 222, 228, 244, 249, 256, 264, + 267, 276, 283, 287, 293, 298, 305, 308, 314, 318, 327, 334, 339, 344, 349, + 353, 359, 367, 373, 379, 386, 392, 399, 407, 413, 419, 428, 435, 439, 447, + 452, 460, 467, 474, 480, 484, 488, 491, 500, 507, 511, 516, 523, 530, 541, + 545, 552, 555, 562, 570, 575, 578, 587, 594, 598, 603, 615, 625, 635, 639, + 649, 656, 661, 664, 670, 674, 683, 689, 693, 701, 706, 709, 712, 721, 728, + 732, 735, 740, 747, 752, 759, 766, 769, 775, 778, 786, 795, 802, 807, 813, + 822, 826, 831, 835, 843, 850, 854, 859, 868, 874, 881, 885, 888, 892, 898, + 906, 912, 924, 940, 947, 955, 962, 967, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -548,14 +571,15 @@ const ( nevaParserT__26 = 27 nevaParserT__27 = 28 nevaParserT__28 = 29 - nevaParserCOMMENT = 30 - nevaParserPUB_KW = 31 - nevaParserIDENTIFIER = 32 - nevaParserINT = 33 - nevaParserFLOAT = 34 - nevaParserSTRING = 35 - nevaParserNEWLINE = 36 - nevaParserWS = 37 + nevaParserT__29 = 30 + nevaParserCOMMENT = 31 + nevaParserPUB_KW = 32 + nevaParserIDENTIFIER = 33 + nevaParserINT = 34 + nevaParserFLOAT = 35 + nevaParserSTRING = 36 + nevaParserNEWLINE = 37 + nevaParserWS = 38 ) // nevaParser rules. @@ -578,58 +602,65 @@ const ( nevaParserRULE_pkgRef = 15 nevaParserRULE_entityName = 16 nevaParserRULE_typeStmt = 17 - nevaParserRULE_typeDef = 18 - nevaParserRULE_typeParams = 19 - nevaParserRULE_typeParamList = 20 - nevaParserRULE_typeParam = 21 - nevaParserRULE_typeExpr = 22 - nevaParserRULE_typeInstExpr = 23 - nevaParserRULE_typeArgs = 24 - nevaParserRULE_typeLitExpr = 25 - nevaParserRULE_enumTypeExpr = 26 - nevaParserRULE_arrTypeExpr = 27 - nevaParserRULE_structTypeExpr = 28 - nevaParserRULE_structFields = 29 - nevaParserRULE_structField = 30 - nevaParserRULE_unionTypeExpr = 31 - nevaParserRULE_nonUnionTypeExpr = 32 - nevaParserRULE_interfaceStmt = 33 - nevaParserRULE_interfaceDef = 34 - nevaParserRULE_inPortsDef = 35 - nevaParserRULE_outPortsDef = 36 - nevaParserRULE_portsDef = 37 - nevaParserRULE_portDef = 38 - nevaParserRULE_constStmt = 39 - nevaParserRULE_constDef = 40 - nevaParserRULE_constVal = 41 - nevaParserRULE_bool = 42 - nevaParserRULE_nil = 43 - nevaParserRULE_arrLit = 44 - nevaParserRULE_listItems = 45 - nevaParserRULE_structLit = 46 - nevaParserRULE_structValueFields = 47 - nevaParserRULE_structValueField = 48 - nevaParserRULE_compStmt = 49 - nevaParserRULE_compDef = 50 - nevaParserRULE_compBody = 51 - nevaParserRULE_compNodesDef = 52 - nevaParserRULE_compNodesDefBody = 53 - nevaParserRULE_compNodeDef = 54 - nevaParserRULE_nodeInst = 55 - nevaParserRULE_nodeDIArgs = 56 - nevaParserRULE_compNetDef = 57 - nevaParserRULE_connDefList = 58 - nevaParserRULE_connDef = 59 - nevaParserRULE_senderSide = 60 - nevaParserRULE_receiverSide = 61 - nevaParserRULE_thenConnExpr = 62 - nevaParserRULE_senderConstRef = 63 - nevaParserRULE_portAddr = 64 - nevaParserRULE_portAddrNode = 65 - nevaParserRULE_portAddrPort = 66 - nevaParserRULE_portAddrIdx = 67 - nevaParserRULE_structSelectors = 68 - nevaParserRULE_multipleReceiverSide = 69 + nevaParserRULE_singleTypeStmt = 18 + nevaParserRULE_groupTypeStmt = 19 + nevaParserRULE_typeDef = 20 + nevaParserRULE_typeParams = 21 + nevaParserRULE_typeParamList = 22 + nevaParserRULE_typeParam = 23 + nevaParserRULE_typeExpr = 24 + nevaParserRULE_typeInstExpr = 25 + nevaParserRULE_typeArgs = 26 + nevaParserRULE_typeLitExpr = 27 + nevaParserRULE_enumTypeExpr = 28 + nevaParserRULE_structTypeExpr = 29 + nevaParserRULE_structFields = 30 + nevaParserRULE_structField = 31 + nevaParserRULE_unionTypeExpr = 32 + nevaParserRULE_nonUnionTypeExpr = 33 + nevaParserRULE_interfaceStmt = 34 + nevaParserRULE_singleInterfaceStmt = 35 + nevaParserRULE_groupInterfaceStmt = 36 + nevaParserRULE_interfaceDef = 37 + nevaParserRULE_inPortsDef = 38 + nevaParserRULE_outPortsDef = 39 + nevaParserRULE_portsDef = 40 + nevaParserRULE_portDef = 41 + nevaParserRULE_constStmt = 42 + nevaParserRULE_singleConstStmt = 43 + nevaParserRULE_groupConstStmt = 44 + nevaParserRULE_constDef = 45 + nevaParserRULE_constVal = 46 + nevaParserRULE_bool = 47 + nevaParserRULE_nil = 48 + nevaParserRULE_listLit = 49 + nevaParserRULE_listItems = 50 + nevaParserRULE_structLit = 51 + nevaParserRULE_structValueFields = 52 + nevaParserRULE_structValueField = 53 + nevaParserRULE_compStmt = 54 + nevaParserRULE_singleCompStmt = 55 + nevaParserRULE_groupCompStmt = 56 + nevaParserRULE_compDef = 57 + nevaParserRULE_compBody = 58 + nevaParserRULE_compNodesDef = 59 + nevaParserRULE_compNodesDefBody = 60 + nevaParserRULE_compNodeDef = 61 + nevaParserRULE_nodeInst = 62 + nevaParserRULE_nodeDIArgs = 63 + nevaParserRULE_compNetDef = 64 + nevaParserRULE_connDefList = 65 + nevaParserRULE_connDef = 66 + nevaParserRULE_senderSide = 67 + nevaParserRULE_receiverSide = 68 + nevaParserRULE_thenConnExpr = 69 + nevaParserRULE_senderConstRef = 70 + nevaParserRULE_portAddr = 71 + nevaParserRULE_portAddrNode = 72 + nevaParserRULE_portAddrPort = 73 + nevaParserRULE_portAddrIdx = 74 + nevaParserRULE_structSelectors = 75 + nevaParserRULE_multipleReceiverSide = 76 ) // IProgContext is an interface to support dynamic dispatch. @@ -771,15 +802,15 @@ func (p *nevaParser) Prog() (localctx IProgContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(145) + p.SetState(159) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&69828347936) != 0 { - p.SetState(143) + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&143948908578) != 0 { + p.SetState(157) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -788,7 +819,7 @@ func (p *nevaParser) Prog() (localctx IProgContext) { switch p.GetTokenStream().LA(1) { case nevaParserNEWLINE: { - p.SetState(140) + p.SetState(154) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -798,7 +829,7 @@ func (p *nevaParser) Prog() (localctx IProgContext) { case nevaParserCOMMENT: { - p.SetState(141) + p.SetState(155) p.Match(nevaParserCOMMENT) if p.HasError() { // Recognition error - abort rule @@ -806,9 +837,9 @@ func (p *nevaParser) Prog() (localctx IProgContext) { } } - case nevaParserT__4, nevaParserT__10, nevaParserT__18, nevaParserT__19, nevaParserT__24: + case nevaParserT__0, nevaParserT__4, nevaParserT__10, nevaParserT__16, nevaParserT__17, nevaParserT__25, nevaParserPUB_KW: { - p.SetState(142) + p.SetState(156) p.Stmt() } @@ -817,7 +848,7 @@ func (p *nevaParser) Prog() (localctx IProgContext) { goto errorExit } - p.SetState(147) + p.SetState(161) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -825,7 +856,7 @@ func (p *nevaParser) Prog() (localctx IProgContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(148) + p.SetState(162) p.Match(nevaParserEOF) if p.HasError() { // Recognition error - abort rule @@ -999,50 +1030,49 @@ func (s *StmtContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) Stmt() (localctx IStmtContext) { localctx = NewStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 2, nevaParserRULE_stmt) - p.SetState(155) + p.SetState(169) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetTokenStream().LA(1) { - case nevaParserT__4: + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 2, p.GetParserRuleContext()) { + case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(150) + p.SetState(164) p.ImportStmt() } - case nevaParserT__10: + case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(151) + p.SetState(165) p.TypeStmt() } - case nevaParserT__18: + case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(152) + p.SetState(166) p.InterfaceStmt() } - case nevaParserT__19: + case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(153) + p.SetState(167) p.ConstStmt() } - case nevaParserT__24: + case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(154) + p.SetState(168) p.CompStmt() } - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + case antlr.ATNInvalidAltNumber: goto errorExit } @@ -1183,7 +1213,7 @@ func (p *nevaParser) CompilerDirectives() (localctx ICompilerDirectivesContext) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(160) + p.SetState(174) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1192,11 +1222,11 @@ func (p *nevaParser) CompilerDirectives() (localctx ICompilerDirectivesContext) for ok := true; ok; ok = _la == nevaParserT__0 { { - p.SetState(157) + p.SetState(171) p.CompilerDirective() } { - p.SetState(158) + p.SetState(172) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -1204,7 +1234,7 @@ func (p *nevaParser) CompilerDirectives() (localctx ICompilerDirectivesContext) } } - p.SetState(162) + p.SetState(176) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1319,7 +1349,7 @@ func (p *nevaParser) CompilerDirective() (localctx ICompilerDirectiveContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(164) + p.SetState(178) p.Match(nevaParserT__0) if p.HasError() { // Recognition error - abort rule @@ -1327,14 +1357,14 @@ func (p *nevaParser) CompilerDirective() (localctx ICompilerDirectiveContext) { } } { - p.SetState(165) + p.SetState(179) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(167) + p.SetState(181) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1343,7 +1373,7 @@ func (p *nevaParser) CompilerDirective() (localctx ICompilerDirectiveContext) { if _la == nevaParserT__1 { { - p.SetState(166) + p.SetState(180) p.CompilerDirectivesArgs() } @@ -1477,7 +1507,7 @@ func (p *nevaParser) CompilerDirectivesArgs() (localctx ICompilerDirectivesArgsC p.EnterOuterAlt(localctx, 1) { - p.SetState(169) + p.SetState(183) p.Match(nevaParserT__1) if p.HasError() { // Recognition error - abort rule @@ -1485,10 +1515,10 @@ func (p *nevaParser) CompilerDirectivesArgs() (localctx ICompilerDirectivesArgsC } } { - p.SetState(170) + p.SetState(184) p.Compiler_directive_arg() } - p.SetState(175) + p.SetState(189) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1497,7 +1527,7 @@ func (p *nevaParser) CompilerDirectivesArgs() (localctx ICompilerDirectivesArgsC for _la == nevaParserT__2 { { - p.SetState(171) + p.SetState(185) p.Match(nevaParserT__2) if p.HasError() { // Recognition error - abort rule @@ -1505,11 +1535,11 @@ func (p *nevaParser) CompilerDirectivesArgs() (localctx ICompilerDirectivesArgsC } } { - p.SetState(172) + p.SetState(186) p.Compiler_directive_arg() } - p.SetState(177) + p.SetState(191) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1517,7 +1547,7 @@ func (p *nevaParser) CompilerDirectivesArgs() (localctx ICompilerDirectivesArgsC _la = p.GetTokenStream().LA(1) } { - p.SetState(178) + p.SetState(192) p.Match(nevaParserT__3) if p.HasError() { // Recognition error - abort rule @@ -1619,7 +1649,7 @@ func (p *nevaParser) Compiler_directive_arg() (localctx ICompiler_directive_argC var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(181) + p.SetState(195) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1628,7 +1658,7 @@ func (p *nevaParser) Compiler_directive_arg() (localctx ICompiler_directive_argC for ok := true; ok; ok = _la == nevaParserIDENTIFIER { { - p.SetState(180) + p.SetState(194) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -1636,7 +1666,7 @@ func (p *nevaParser) Compiler_directive_arg() (localctx ICompiler_directive_argC } } - p.SetState(183) + p.SetState(197) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1782,14 +1812,14 @@ func (p *nevaParser) ImportStmt() (localctx IImportStmtContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(185) + p.SetState(199) p.Match(nevaParserT__4) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(189) + p.SetState(203) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1798,7 +1828,7 @@ func (p *nevaParser) ImportStmt() (localctx IImportStmtContext) { for _la == nevaParserNEWLINE { { - p.SetState(186) + p.SetState(200) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -1806,7 +1836,7 @@ func (p *nevaParser) ImportStmt() (localctx IImportStmtContext) { } } - p.SetState(191) + p.SetState(205) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1814,14 +1844,14 @@ func (p *nevaParser) ImportStmt() (localctx IImportStmtContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(192) + p.SetState(206) p.Match(nevaParserT__5) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(196) + p.SetState(210) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1830,7 +1860,7 @@ func (p *nevaParser) ImportStmt() (localctx IImportStmtContext) { for _la == nevaParserNEWLINE { { - p.SetState(193) + p.SetState(207) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -1838,14 +1868,14 @@ func (p *nevaParser) ImportStmt() (localctx IImportStmtContext) { } } - p.SetState(198) + p.SetState(212) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(202) + p.SetState(216) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1854,11 +1884,11 @@ func (p *nevaParser) ImportStmt() (localctx IImportStmtContext) { for _la == nevaParserT__8 || _la == nevaParserIDENTIFIER { { - p.SetState(199) + p.SetState(213) p.ImportDef() } - p.SetState(204) + p.SetState(218) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1866,7 +1896,7 @@ func (p *nevaParser) ImportStmt() (localctx IImportStmtContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(205) + p.SetState(219) p.Match(nevaParserT__6) if p.HasError() { // Recognition error - abort rule @@ -2002,12 +2032,12 @@ func (p *nevaParser) ImportDef() (localctx IImportDefContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(208) + p.SetState(222) p.GetErrorHandler().Sync(p) if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 10, p.GetParserRuleContext()) == 1 { { - p.SetState(207) + p.SetState(221) p.ImportAlias() } @@ -2015,10 +2045,10 @@ func (p *nevaParser) ImportDef() (localctx IImportDefContext) { goto errorExit } { - p.SetState(210) + p.SetState(224) p.ImportPath() } - p.SetState(214) + p.SetState(228) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2027,7 +2057,7 @@ func (p *nevaParser) ImportDef() (localctx IImportDefContext) { for _la == nevaParserNEWLINE { { - p.SetState(211) + p.SetState(225) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -2035,7 +2065,7 @@ func (p *nevaParser) ImportDef() (localctx IImportDefContext) { } } - p.SetState(216) + p.SetState(230) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2131,7 +2161,7 @@ func (p *nevaParser) ImportAlias() (localctx IImportAliasContext) { p.EnterRule(localctx, 16, nevaParserRULE_importAlias) p.EnterOuterAlt(localctx, 1) { - p.SetState(217) + p.SetState(231) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -2256,11 +2286,11 @@ func (p *nevaParser) ImportPath() (localctx IImportPathContext) { p.EnterRule(localctx, 18, nevaParserRULE_importPath) p.EnterOuterAlt(localctx, 1) { - p.SetState(219) + p.SetState(233) p.ImportPathMod() } { - p.SetState(220) + p.SetState(234) p.Match(nevaParserT__7) if p.HasError() { // Recognition error - abort rule @@ -2268,7 +2298,7 @@ func (p *nevaParser) ImportPath() (localctx IImportPathContext) { } } { - p.SetState(221) + p.SetState(235) p.ImportPathPkg() } @@ -2362,7 +2392,7 @@ func (p *nevaParser) ImportPathMod() (localctx IImportPathModContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(223) + p.SetState(237) _la = p.GetTokenStream().LA(1) if !(_la == nevaParserT__8 || _la == nevaParserIDENTIFIER) { @@ -2468,14 +2498,14 @@ func (p *nevaParser) ImportPathPkg() (localctx IImportPathPkgContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(225) + p.SetState(239) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(230) + p.SetState(244) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2484,7 +2514,7 @@ func (p *nevaParser) ImportPathPkg() (localctx IImportPathPkgContext) { for _la == nevaParserT__7 { { - p.SetState(226) + p.SetState(240) p.Match(nevaParserT__7) if p.HasError() { // Recognition error - abort rule @@ -2492,7 +2522,7 @@ func (p *nevaParser) ImportPathPkg() (localctx IImportPathPkgContext) { } } { - p.SetState(227) + p.SetState(241) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -2500,7 +2530,7 @@ func (p *nevaParser) ImportPathPkg() (localctx IImportPathPkgContext) { } } - p.SetState(232) + p.SetState(246) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2623,7 +2653,7 @@ func (s *EntityRefContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) EntityRef() (localctx IEntityRefContext) { localctx = NewEntityRefContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 24, nevaParserRULE_entityRef) - p.SetState(235) + p.SetState(249) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2633,14 +2663,14 @@ func (p *nevaParser) EntityRef() (localctx IEntityRefContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(233) + p.SetState(247) p.LocalEntityRef() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(234) + p.SetState(248) p.ImportedEntityRef() } @@ -2736,7 +2766,7 @@ func (p *nevaParser) LocalEntityRef() (localctx ILocalEntityRefContext) { p.EnterRule(localctx, 26, nevaParserRULE_localEntityRef) p.EnterOuterAlt(localctx, 1) { - p.SetState(237) + p.SetState(251) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -2861,15 +2891,15 @@ func (p *nevaParser) ImportedEntityRef() (localctx IImportedEntityRefContext) { p.EnterRule(localctx, 28, nevaParserRULE_importedEntityRef) p.EnterOuterAlt(localctx, 1) { - p.SetState(239) + p.SetState(253) p.PkgRef() } - p.SetState(242) + p.SetState(256) p.GetErrorHandler().Sync(p) if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) == 1 { { - p.SetState(240) + p.SetState(254) p.Match(nevaParserT__9) if p.HasError() { // Recognition error - abort rule @@ -2877,7 +2907,7 @@ func (p *nevaParser) ImportedEntityRef() (localctx IImportedEntityRefContext) { } } { - p.SetState(241) + p.SetState(255) p.EntityName() } @@ -2973,7 +3003,7 @@ func (p *nevaParser) PkgRef() (localctx IPkgRefContext) { p.EnterRule(localctx, 30, nevaParserRULE_pkgRef) p.EnterOuterAlt(localctx, 1) { - p.SetState(244) + p.SetState(258) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -3069,7 +3099,7 @@ func (p *nevaParser) EntityName() (localctx IEntityNameContext) { p.EnterRule(localctx, 32, nevaParserRULE_entityName) p.EnterOuterAlt(localctx, 1) { - p.SetState(246) + p.SetState(260) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -3098,10 +3128,8 @@ type ITypeStmtContext interface { GetParser() antlr.Parser // Getter signatures - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode - AllTypeDef() []ITypeDefContext - TypeDef(i int) ITypeDefContext + SingleTypeStmt() ISingleTypeStmtContext + GroupTypeStmt() IGroupTypeStmtContext // IsTypeStmtContext differentiates from other interfaces. IsTypeStmtContext() @@ -3139,45 +3167,28 @@ func NewTypeStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, inv func (s *TypeStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *TypeStmtContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} - -func (s *TypeStmtContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) -} - -func (s *TypeStmtContext) AllTypeDef() []ITypeDefContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(ITypeDefContext); ok { - len++ +func (s *TypeStmtContext) SingleTypeStmt() ISingleTypeStmtContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISingleTypeStmtContext); ok { + t = ctx.(antlr.RuleContext) + break } } - tst := make([]ITypeDefContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(ITypeDefContext); ok { - tst[i] = t.(ITypeDefContext) - i++ - } + if t == nil { + return nil } - return tst + return t.(ISingleTypeStmtContext) } -func (s *TypeStmtContext) TypeDef(i int) ITypeDefContext { +func (s *TypeStmtContext) GroupTypeStmt() IGroupTypeStmtContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeDefContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(IGroupTypeStmtContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -3185,7 +3196,7 @@ func (s *TypeStmtContext) TypeDef(i int) ITypeDefContext { return nil } - return t.(ITypeDefContext) + return t.(IGroupTypeStmtContext) } func (s *TypeStmtContext) GetRuleContext() antlr.RuleContext { @@ -3211,125 +3222,30 @@ func (s *TypeStmtContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) TypeStmt() (localctx ITypeStmtContext) { localctx = NewTypeStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, nevaParserRULE_typeStmt) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(248) - p.Match(nevaParserT__10) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(252) + p.SetState(264) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserNEWLINE { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) { - p.SetState(249) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(254) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(255) - p.Match(nevaParserT__5) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + p.SetState(262) + p.SingleTypeStmt() } - } - p.SetState(259) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserNEWLINE { + case 2: + p.EnterOuterAlt(localctx, 2) { - p.SetState(256) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(263) + p.GroupTypeStmt() } - p.SetState(261) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - p.SetState(271) - p.GetErrorHandler().Sync(p) - if p.HasError() { + case antlr.ATNInvalidAltNumber: goto errorExit } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserPUB_KW || _la == nevaParserIDENTIFIER { - { - p.SetState(262) - p.TypeDef() - } - p.SetState(266) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(263) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(268) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - - p.SetState(273) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(274) - p.Match(nevaParserT__6) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } errorExit: if p.HasError() { @@ -3344,67 +3260,57 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITypeDefContext is an interface to support dynamic dispatch. -type ITypeDefContext interface { +// ISingleTypeStmtContext is an interface to support dynamic dispatch. +type ISingleTypeStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode + TypeDef() ITypeDefContext PUB_KW() antlr.TerminalNode - TypeParams() ITypeParamsContext - TypeExpr() ITypeExprContext - // IsTypeDefContext differentiates from other interfaces. - IsTypeDefContext() + // IsSingleTypeStmtContext differentiates from other interfaces. + IsSingleTypeStmtContext() } -type TypeDefContext struct { +type SingleTypeStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyTypeDefContext() *TypeDefContext { - var p = new(TypeDefContext) +func NewEmptySingleTypeStmtContext() *SingleTypeStmtContext { + var p = new(SingleTypeStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeDef + p.RuleIndex = nevaParserRULE_singleTypeStmt return p } -func InitEmptyTypeDefContext(p *TypeDefContext) { +func InitEmptySingleTypeStmtContext(p *SingleTypeStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeDef + p.RuleIndex = nevaParserRULE_singleTypeStmt } -func (*TypeDefContext) IsTypeDefContext() {} +func (*SingleTypeStmtContext) IsSingleTypeStmtContext() {} -func NewTypeDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeDefContext { - var p = new(TypeDefContext) +func NewSingleTypeStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SingleTypeStmtContext { + var p = new(SingleTypeStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_typeDef + p.RuleIndex = nevaParserRULE_singleTypeStmt return p } -func (s *TypeDefContext) GetParser() antlr.Parser { return s.parser } - -func (s *TypeDefContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(nevaParserIDENTIFIER, 0) -} - -func (s *TypeDefContext) PUB_KW() antlr.TerminalNode { - return s.GetToken(nevaParserPUB_KW, 0) -} +func (s *SingleTypeStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *TypeDefContext) TypeParams() ITypeParamsContext { +func (s *SingleTypeStmtContext) TypeDef() ITypeDefContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeParamsContext); ok { + if _, ok := ctx.(ITypeDefContext); ok { t = ctx.(antlr.RuleContext) break } @@ -3414,52 +3320,40 @@ func (s *TypeDefContext) TypeParams() ITypeParamsContext { return nil } - return t.(ITypeParamsContext) + return t.(ITypeDefContext) } -func (s *TypeDefContext) TypeExpr() ITypeExprContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeExprContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(ITypeExprContext) +func (s *SingleTypeStmtContext) PUB_KW() antlr.TerminalNode { + return s.GetToken(nevaParserPUB_KW, 0) } -func (s *TypeDefContext) GetRuleContext() antlr.RuleContext { +func (s *SingleTypeStmtContext) GetRuleContext() antlr.RuleContext { return s } -func (s *TypeDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *SingleTypeStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeDefContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *SingleTypeStmtContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterTypeDef(s) + listenerT.EnterSingleTypeStmt(s) } } -func (s *TypeDefContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *SingleTypeStmtContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitTypeDef(s) + listenerT.ExitSingleTypeStmt(s) } } -func (p *nevaParser) TypeDef() (localctx ITypeDefContext) { - localctx = NewTypeDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 36, nevaParserRULE_typeDef) +func (p *nevaParser) SingleTypeStmt() (localctx ISingleTypeStmtContext) { + localctx = NewSingleTypeStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 36, nevaParserRULE_singleTypeStmt) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(277) + p.SetState(267) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3468,7 +3362,7 @@ func (p *nevaParser) TypeDef() (localctx ITypeDefContext) { if _la == nevaParserPUB_KW { { - p.SetState(276) + p.SetState(266) p.Match(nevaParserPUB_KW) if p.HasError() { // Recognition error - abort rule @@ -3478,55 +3372,33 @@ func (p *nevaParser) TypeDef() (localctx ITypeDefContext) { } { - p.SetState(279) - p.Match(nevaParserIDENTIFIER) + p.SetState(269) + p.Match(nevaParserT__10) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(281) - p.GetErrorHandler().Sync(p) + { + p.SetState(270) + p.TypeDef() + } + +errorExit: if p.HasError() { - goto errorExit + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) } - _la = p.GetTokenStream().LA(1) + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} - if _la == nevaParserT__11 { - { - p.SetState(280) - p.TypeParams() - } - - } - p.SetState(284) - p.GetErrorHandler().Sync(p) - - if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 21, p.GetParserRuleContext()) == 1 { - { - p.SetState(283) - p.TypeExpr() - } - - } else if p.HasError() { // JIM - goto errorExit - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} - -// ITypeParamsContext is an interface to support dynamic dispatch. -type ITypeParamsContext interface { +// IGroupTypeStmtContext is an interface to support dynamic dispatch. +type IGroupTypeStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -3535,58 +3407,86 @@ type ITypeParamsContext interface { // Getter signatures AllNEWLINE() []antlr.TerminalNode NEWLINE(i int) antlr.TerminalNode - TypeParamList() ITypeParamListContext + AllTypeDef() []ITypeDefContext + TypeDef(i int) ITypeDefContext + AllPUB_KW() []antlr.TerminalNode + PUB_KW(i int) antlr.TerminalNode - // IsTypeParamsContext differentiates from other interfaces. - IsTypeParamsContext() + // IsGroupTypeStmtContext differentiates from other interfaces. + IsGroupTypeStmtContext() } -type TypeParamsContext struct { +type GroupTypeStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyTypeParamsContext() *TypeParamsContext { - var p = new(TypeParamsContext) +func NewEmptyGroupTypeStmtContext() *GroupTypeStmtContext { + var p = new(GroupTypeStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeParams + p.RuleIndex = nevaParserRULE_groupTypeStmt return p } -func InitEmptyTypeParamsContext(p *TypeParamsContext) { +func InitEmptyGroupTypeStmtContext(p *GroupTypeStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeParams + p.RuleIndex = nevaParserRULE_groupTypeStmt } -func (*TypeParamsContext) IsTypeParamsContext() {} +func (*GroupTypeStmtContext) IsGroupTypeStmtContext() {} -func NewTypeParamsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeParamsContext { - var p = new(TypeParamsContext) +func NewGroupTypeStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupTypeStmtContext { + var p = new(GroupTypeStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_typeParams + p.RuleIndex = nevaParserRULE_groupTypeStmt return p } -func (s *TypeParamsContext) GetParser() antlr.Parser { return s.parser } +func (s *GroupTypeStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *TypeParamsContext) AllNEWLINE() []antlr.TerminalNode { +func (s *GroupTypeStmtContext) AllNEWLINE() []antlr.TerminalNode { return s.GetTokens(nevaParserNEWLINE) } -func (s *TypeParamsContext) NEWLINE(i int) antlr.TerminalNode { +func (s *GroupTypeStmtContext) NEWLINE(i int) antlr.TerminalNode { return s.GetToken(nevaParserNEWLINE, i) } -func (s *TypeParamsContext) TypeParamList() ITypeParamListContext { +func (s *GroupTypeStmtContext) AllTypeDef() []ITypeDefContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ITypeDefContext); ok { + len++ + } + } + + tst := make([]ITypeDefContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ITypeDefContext); ok { + tst[i] = t.(ITypeDefContext) + i++ + } + } + + return tst +} + +func (s *GroupTypeStmtContext) TypeDef(i int) ITypeDefContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeParamListContext); ok { - t = ctx.(antlr.RuleContext) - break + if _, ok := ctx.(ITypeDefContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -3594,44 +3494,52 @@ func (s *TypeParamsContext) TypeParamList() ITypeParamListContext { return nil } - return t.(ITypeParamListContext) + return t.(ITypeDefContext) } -func (s *TypeParamsContext) GetRuleContext() antlr.RuleContext { +func (s *GroupTypeStmtContext) AllPUB_KW() []antlr.TerminalNode { + return s.GetTokens(nevaParserPUB_KW) +} + +func (s *GroupTypeStmtContext) PUB_KW(i int) antlr.TerminalNode { + return s.GetToken(nevaParserPUB_KW, i) +} + +func (s *GroupTypeStmtContext) GetRuleContext() antlr.RuleContext { return s } -func (s *TypeParamsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *GroupTypeStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeParamsContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *GroupTypeStmtContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterTypeParams(s) + listenerT.EnterGroupTypeStmt(s) } } -func (s *TypeParamsContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *GroupTypeStmtContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitTypeParams(s) + listenerT.ExitGroupTypeStmt(s) } } -func (p *nevaParser) TypeParams() (localctx ITypeParamsContext) { - localctx = NewTypeParamsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 38, nevaParserRULE_typeParams) +func (p *nevaParser) GroupTypeStmt() (localctx IGroupTypeStmtContext) { + localctx = NewGroupTypeStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 38, nevaParserRULE_groupTypeStmt) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(286) - p.Match(nevaParserT__11) + p.SetState(272) + p.Match(nevaParserT__10) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(290) + p.SetState(276) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3640,7 +3548,7 @@ func (p *nevaParser) TypeParams() (localctx ITypeParamsContext) { for _la == nevaParserNEWLINE { { - p.SetState(287) + p.SetState(273) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -3648,30 +3556,110 @@ func (p *nevaParser) TypeParams() (localctx ITypeParamsContext) { } } - p.SetState(292) + p.SetState(278) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(294) + { + p.SetState(279) + p.Match(nevaParserT__5) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(283) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == nevaParserIDENTIFIER { + for _la == nevaParserNEWLINE { { - p.SetState(293) - p.TypeParamList() + p.SetState(280) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(285) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(298) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserPUB_KW || _la == nevaParserIDENTIFIER { + p.SetState(287) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == nevaParserPUB_KW { + { + p.SetState(286) + p.Match(nevaParserPUB_KW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(289) + p.TypeDef() + } + p.SetState(293) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(290) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(295) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) } + p.SetState(300) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) } { - p.SetState(296) - p.Match(nevaParserT__12) + p.SetState(301) + p.Match(nevaParserT__6) if p.HasError() { // Recognition error - abort rule goto errorExit @@ -3691,86 +3679,80 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITypeParamListContext is an interface to support dynamic dispatch. -type ITypeParamListContext interface { +// ITypeDefContext is an interface to support dynamic dispatch. +type ITypeDefContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AllTypeParam() []ITypeParamContext - TypeParam(i int) ITypeParamContext - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode + IDENTIFIER() antlr.TerminalNode + TypeParams() ITypeParamsContext + TypeExpr() ITypeExprContext - // IsTypeParamListContext differentiates from other interfaces. - IsTypeParamListContext() + // IsTypeDefContext differentiates from other interfaces. + IsTypeDefContext() } -type TypeParamListContext struct { +type TypeDefContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyTypeParamListContext() *TypeParamListContext { - var p = new(TypeParamListContext) +func NewEmptyTypeDefContext() *TypeDefContext { + var p = new(TypeDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeParamList + p.RuleIndex = nevaParserRULE_typeDef return p } -func InitEmptyTypeParamListContext(p *TypeParamListContext) { +func InitEmptyTypeDefContext(p *TypeDefContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeParamList + p.RuleIndex = nevaParserRULE_typeDef } -func (*TypeParamListContext) IsTypeParamListContext() {} +func (*TypeDefContext) IsTypeDefContext() {} -func NewTypeParamListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeParamListContext { - var p = new(TypeParamListContext) +func NewTypeDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeDefContext { + var p = new(TypeDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_typeParamList + p.RuleIndex = nevaParserRULE_typeDef return p } -func (s *TypeParamListContext) GetParser() antlr.Parser { return s.parser } +func (s *TypeDefContext) GetParser() antlr.Parser { return s.parser } -func (s *TypeParamListContext) AllTypeParam() []ITypeParamContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(ITypeParamContext); ok { - len++ +func (s *TypeDefContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(nevaParserIDENTIFIER, 0) +} + +func (s *TypeDefContext) TypeParams() ITypeParamsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeParamsContext); ok { + t = ctx.(antlr.RuleContext) + break } } - tst := make([]ITypeParamContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(ITypeParamContext); ok { - tst[i] = t.(ITypeParamContext) - i++ - } + if t == nil { + return nil } - return tst + return t.(ITypeParamsContext) } -func (s *TypeParamListContext) TypeParam(i int) ITypeParamContext { +func (s *TypeDefContext) TypeExpr() ITypeExprContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeParamContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(ITypeExprContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -3778,122 +3760,68 @@ func (s *TypeParamListContext) TypeParam(i int) ITypeParamContext { return nil } - return t.(ITypeParamContext) + return t.(ITypeExprContext) } -func (s *TypeParamListContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) +func (s *TypeDefContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *TypeParamListContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) -} - -func (s *TypeParamListContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *TypeParamListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *TypeDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeParamListContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *TypeDefContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterTypeParamList(s) + listenerT.EnterTypeDef(s) } } -func (s *TypeParamListContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TypeDefContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitTypeParamList(s) + listenerT.ExitTypeDef(s) } } -func (p *nevaParser) TypeParamList() (localctx ITypeParamListContext) { - localctx = NewTypeParamListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 40, nevaParserRULE_typeParamList) +func (p *nevaParser) TypeDef() (localctx ITypeDefContext) { + localctx = NewTypeDefContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 40, nevaParserRULE_typeDef) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(298) - p.TypeParam() + p.SetState(303) + p.Match(nevaParserIDENTIFIER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - p.SetState(315) + p.SetState(305) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for _la == nevaParserT__2 { + if _la == nevaParserT__11 { { - p.SetState(299) - p.Match(nevaParserT__2) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(303) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + p.SetState(304) + p.TypeParams() } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserNEWLINE { - { - p.SetState(300) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } + } + p.SetState(308) + p.GetErrorHandler().Sync(p) - p.SetState(305) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) == 1 { { - p.SetState(306) - p.TypeParam() - } - p.SetState(310) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(307) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(312) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) + p.SetState(307) + p.TypeExpr() } - p.SetState(317) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) + } else if p.HasError() { // JIM + goto errorExit } errorExit: @@ -3909,61 +3837,66 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITypeParamContext is an interface to support dynamic dispatch. -type ITypeParamContext interface { +// ITypeParamsContext is an interface to support dynamic dispatch. +type ITypeParamsContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode - TypeExpr() ITypeExprContext + AllNEWLINE() []antlr.TerminalNode + NEWLINE(i int) antlr.TerminalNode + TypeParamList() ITypeParamListContext - // IsTypeParamContext differentiates from other interfaces. - IsTypeParamContext() + // IsTypeParamsContext differentiates from other interfaces. + IsTypeParamsContext() } -type TypeParamContext struct { +type TypeParamsContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyTypeParamContext() *TypeParamContext { - var p = new(TypeParamContext) +func NewEmptyTypeParamsContext() *TypeParamsContext { + var p = new(TypeParamsContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeParam + p.RuleIndex = nevaParserRULE_typeParams return p } -func InitEmptyTypeParamContext(p *TypeParamContext) { +func InitEmptyTypeParamsContext(p *TypeParamsContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeParam + p.RuleIndex = nevaParserRULE_typeParams } -func (*TypeParamContext) IsTypeParamContext() {} +func (*TypeParamsContext) IsTypeParamsContext() {} -func NewTypeParamContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeParamContext { - var p = new(TypeParamContext) +func NewTypeParamsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeParamsContext { + var p = new(TypeParamsContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_typeParam + p.RuleIndex = nevaParserRULE_typeParams return p } -func (s *TypeParamContext) GetParser() antlr.Parser { return s.parser } +func (s *TypeParamsContext) GetParser() antlr.Parser { return s.parser } -func (s *TypeParamContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(nevaParserIDENTIFIER, 0) +func (s *TypeParamsContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) } -func (s *TypeParamContext) TypeExpr() ITypeExprContext { +func (s *TypeParamsContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *TypeParamsContext) TypeParamList() ITypeParamListContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeExprContext); ok { + if _, ok := ctx.(ITypeParamListContext); ok { t = ctx.(antlr.RuleContext) break } @@ -3973,57 +3906,89 @@ func (s *TypeParamContext) TypeExpr() ITypeExprContext { return nil } - return t.(ITypeExprContext) + return t.(ITypeParamListContext) } -func (s *TypeParamContext) GetRuleContext() antlr.RuleContext { +func (s *TypeParamsContext) GetRuleContext() antlr.RuleContext { return s } -func (s *TypeParamContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *TypeParamsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeParamContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *TypeParamsContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterTypeParam(s) + listenerT.EnterTypeParams(s) } } -func (s *TypeParamContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TypeParamsContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitTypeParam(s) + listenerT.ExitTypeParams(s) } } -func (p *nevaParser) TypeParam() (localctx ITypeParamContext) { - localctx = NewTypeParamContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 42, nevaParserRULE_typeParam) +func (p *nevaParser) TypeParams() (localctx ITypeParamsContext) { + localctx = NewTypeParamsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 42, nevaParserRULE_typeParams) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(318) - p.Match(nevaParserIDENTIFIER) + p.SetState(310) + p.Match(nevaParserT__11) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(320) + p.SetState(314) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&4295147520) != 0 { + for _la == nevaParserNEWLINE { { - p.SetState(319) - p.TypeExpr() + p.SetState(311) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(316) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(318) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == nevaParserIDENTIFIER { + { + p.SetState(317) + p.TypeParamList() } } + { + p.SetState(320) + p.Match(nevaParserT__12) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } errorExit: if p.HasError() { @@ -4038,155 +4003,209 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITypeExprContext is an interface to support dynamic dispatch. -type ITypeExprContext interface { +// ITypeParamListContext is an interface to support dynamic dispatch. +type ITypeParamListContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - TypeInstExpr() ITypeInstExprContext - TypeLitExpr() ITypeLitExprContext - UnionTypeExpr() IUnionTypeExprContext + AllTypeParam() []ITypeParamContext + TypeParam(i int) ITypeParamContext + AllNEWLINE() []antlr.TerminalNode + NEWLINE(i int) antlr.TerminalNode - // IsTypeExprContext differentiates from other interfaces. - IsTypeExprContext() + // IsTypeParamListContext differentiates from other interfaces. + IsTypeParamListContext() } -type TypeExprContext struct { +type TypeParamListContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyTypeExprContext() *TypeExprContext { - var p = new(TypeExprContext) +func NewEmptyTypeParamListContext() *TypeParamListContext { + var p = new(TypeParamListContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeExpr + p.RuleIndex = nevaParserRULE_typeParamList return p } -func InitEmptyTypeExprContext(p *TypeExprContext) { +func InitEmptyTypeParamListContext(p *TypeParamListContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeExpr + p.RuleIndex = nevaParserRULE_typeParamList } -func (*TypeExprContext) IsTypeExprContext() {} +func (*TypeParamListContext) IsTypeParamListContext() {} -func NewTypeExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeExprContext { - var p = new(TypeExprContext) +func NewTypeParamListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeParamListContext { + var p = new(TypeParamListContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_typeExpr + p.RuleIndex = nevaParserRULE_typeParamList return p } -func (s *TypeExprContext) GetParser() antlr.Parser { return s.parser } +func (s *TypeParamListContext) GetParser() antlr.Parser { return s.parser } -func (s *TypeExprContext) TypeInstExpr() ITypeInstExprContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeInstExprContext); ok { - t = ctx.(antlr.RuleContext) - break +func (s *TypeParamListContext) AllTypeParam() []ITypeParamContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ITypeParamContext); ok { + len++ } } - if t == nil { - return nil + tst := make([]ITypeParamContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ITypeParamContext); ok { + tst[i] = t.(ITypeParamContext) + i++ + } } - return t.(ITypeInstExprContext) + return tst } -func (s *TypeExprContext) TypeLitExpr() ITypeLitExprContext { +func (s *TypeParamListContext) TypeParam(i int) ITypeParamContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeLitExprContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } + if _, ok := ctx.(ITypeParamContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil } - return t.(ITypeLitExprContext) + return t.(ITypeParamContext) } -func (s *TypeExprContext) UnionTypeExpr() IUnionTypeExprContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IUnionTypeExprContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } +func (s *TypeParamListContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} - return t.(IUnionTypeExprContext) +func (s *TypeParamListContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) } -func (s *TypeExprContext) GetRuleContext() antlr.RuleContext { +func (s *TypeParamListContext) GetRuleContext() antlr.RuleContext { return s } -func (s *TypeExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *TypeParamListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeExprContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *TypeParamListContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterTypeExpr(s) + listenerT.EnterTypeParamList(s) } } -func (s *TypeExprContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TypeParamListContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitTypeExpr(s) + listenerT.ExitTypeParamList(s) } } -func (p *nevaParser) TypeExpr() (localctx ITypeExprContext) { - localctx = NewTypeExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 44, nevaParserRULE_typeExpr) - p.SetState(325) +func (p *nevaParser) TypeParamList() (localctx ITypeParamListContext) { + localctx = NewTypeParamListContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 44, nevaParserRULE_typeParamList) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(322) + p.TypeParam() + } + p.SetState(339) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } + _la = p.GetTokenStream().LA(1) - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext()) { - case 1: - p.EnterOuterAlt(localctx, 1) + for _la == nevaParserT__2 { { - p.SetState(322) - p.TypeInstExpr() + p.SetState(323) + p.Match(nevaParserT__2) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(327) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit } + _la = p.GetTokenStream().LA(1) - case 2: - p.EnterOuterAlt(localctx, 2) + for _la == nevaParserNEWLINE { + { + p.SetState(324) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(329) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } { - p.SetState(323) - p.TypeLitExpr() + p.SetState(330) + p.TypeParam() + } + p.SetState(334) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit } + _la = p.GetTokenStream().LA(1) - case 3: - p.EnterOuterAlt(localctx, 3) - { - p.SetState(324) - p.UnionTypeExpr() + for _la == nevaParserNEWLINE { + { + p.SetState(331) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(336) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) } - case antlr.ATNInvalidAltNumber: - goto errorExit + p.SetState(341) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) } errorExit: @@ -4202,73 +4221,61 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITypeInstExprContext is an interface to support dynamic dispatch. -type ITypeInstExprContext interface { +// ITypeParamContext is an interface to support dynamic dispatch. +type ITypeParamContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - EntityRef() IEntityRefContext - TypeArgs() ITypeArgsContext + IDENTIFIER() antlr.TerminalNode + TypeExpr() ITypeExprContext - // IsTypeInstExprContext differentiates from other interfaces. - IsTypeInstExprContext() + // IsTypeParamContext differentiates from other interfaces. + IsTypeParamContext() } -type TypeInstExprContext struct { +type TypeParamContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyTypeInstExprContext() *TypeInstExprContext { - var p = new(TypeInstExprContext) +func NewEmptyTypeParamContext() *TypeParamContext { + var p = new(TypeParamContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeInstExpr + p.RuleIndex = nevaParserRULE_typeParam return p } -func InitEmptyTypeInstExprContext(p *TypeInstExprContext) { +func InitEmptyTypeParamContext(p *TypeParamContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeInstExpr + p.RuleIndex = nevaParserRULE_typeParam } -func (*TypeInstExprContext) IsTypeInstExprContext() {} +func (*TypeParamContext) IsTypeParamContext() {} -func NewTypeInstExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeInstExprContext { - var p = new(TypeInstExprContext) +func NewTypeParamContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeParamContext { + var p = new(TypeParamContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_typeInstExpr + p.RuleIndex = nevaParserRULE_typeParam return p } -func (s *TypeInstExprContext) GetParser() antlr.Parser { return s.parser } - -func (s *TypeInstExprContext) EntityRef() IEntityRefContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IEntityRefContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } +func (s *TypeParamContext) GetParser() antlr.Parser { return s.parser } - return t.(IEntityRefContext) +func (s *TypeParamContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(nevaParserIDENTIFIER, 0) } -func (s *TypeInstExprContext) TypeArgs() ITypeArgsContext { +func (s *TypeParamContext) TypeExpr() ITypeExprContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeArgsContext); ok { + if _, ok := ctx.(ITypeExprContext); ok { t = ctx.(antlr.RuleContext) break } @@ -4278,50 +4285,54 @@ func (s *TypeInstExprContext) TypeArgs() ITypeArgsContext { return nil } - return t.(ITypeArgsContext) + return t.(ITypeExprContext) } -func (s *TypeInstExprContext) GetRuleContext() antlr.RuleContext { +func (s *TypeParamContext) GetRuleContext() antlr.RuleContext { return s } -func (s *TypeInstExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *TypeParamContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeInstExprContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *TypeParamContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterTypeInstExpr(s) + listenerT.EnterTypeParam(s) } } -func (s *TypeInstExprContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TypeParamContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitTypeInstExpr(s) + listenerT.ExitTypeParam(s) } } -func (p *nevaParser) TypeInstExpr() (localctx ITypeInstExprContext) { - localctx = NewTypeInstExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 46, nevaParserRULE_typeInstExpr) +func (p *nevaParser) TypeParam() (localctx ITypeParamContext) { + localctx = NewTypeParamContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 46, nevaParserRULE_typeParam) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(327) - p.EntityRef() + p.SetState(342) + p.Match(nevaParserIDENTIFIER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - p.SetState(329) + p.SetState(344) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == nevaParserT__11 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&8589983744) != 0 { { - p.SetState(328) - p.TypeArgs() + p.SetState(343) + p.TypeExpr() } } @@ -4339,86 +4350,76 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITypeArgsContext is an interface to support dynamic dispatch. -type ITypeArgsContext interface { +// ITypeExprContext is an interface to support dynamic dispatch. +type ITypeExprContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AllTypeExpr() []ITypeExprContext - TypeExpr(i int) ITypeExprContext - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode + TypeInstExpr() ITypeInstExprContext + TypeLitExpr() ITypeLitExprContext + UnionTypeExpr() IUnionTypeExprContext - // IsTypeArgsContext differentiates from other interfaces. - IsTypeArgsContext() + // IsTypeExprContext differentiates from other interfaces. + IsTypeExprContext() } -type TypeArgsContext struct { +type TypeExprContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyTypeArgsContext() *TypeArgsContext { - var p = new(TypeArgsContext) +func NewEmptyTypeExprContext() *TypeExprContext { + var p = new(TypeExprContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeArgs + p.RuleIndex = nevaParserRULE_typeExpr return p } -func InitEmptyTypeArgsContext(p *TypeArgsContext) { +func InitEmptyTypeExprContext(p *TypeExprContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeArgs + p.RuleIndex = nevaParserRULE_typeExpr } -func (*TypeArgsContext) IsTypeArgsContext() {} +func (*TypeExprContext) IsTypeExprContext() {} -func NewTypeArgsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeArgsContext { - var p = new(TypeArgsContext) +func NewTypeExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeExprContext { + var p = new(TypeExprContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_typeArgs + p.RuleIndex = nevaParserRULE_typeExpr return p } -func (s *TypeArgsContext) GetParser() antlr.Parser { return s.parser } +func (s *TypeExprContext) GetParser() antlr.Parser { return s.parser } -func (s *TypeArgsContext) AllTypeExpr() []ITypeExprContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(ITypeExprContext); ok { - len++ +func (s *TypeExprContext) TypeInstExpr() ITypeInstExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeInstExprContext); ok { + t = ctx.(antlr.RuleContext) + break } } - tst := make([]ITypeExprContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(ITypeExprContext); ok { - tst[i] = t.(ITypeExprContext) - i++ - } - } + if t == nil { + return nil + } - return tst + return t.(ITypeInstExprContext) } -func (s *TypeArgsContext) TypeExpr(i int) ITypeExprContext { +func (s *TypeExprContext) TypeLitExpr() ITypeLitExprContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeExprContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(ITypeLitExprContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -4426,162 +4427,78 @@ func (s *TypeArgsContext) TypeExpr(i int) ITypeExprContext { return nil } - return t.(ITypeExprContext) + return t.(ITypeLitExprContext) } -func (s *TypeArgsContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} +func (s *TypeExprContext) UnionTypeExpr() IUnionTypeExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IUnionTypeExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func (s *TypeArgsContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) + if t == nil { + return nil + } + + return t.(IUnionTypeExprContext) } -func (s *TypeArgsContext) GetRuleContext() antlr.RuleContext { +func (s *TypeExprContext) GetRuleContext() antlr.RuleContext { return s } -func (s *TypeArgsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *TypeExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeArgsContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *TypeExprContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterTypeArgs(s) + listenerT.EnterTypeExpr(s) } } -func (s *TypeArgsContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TypeExprContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitTypeArgs(s) + listenerT.ExitTypeExpr(s) } } -func (p *nevaParser) TypeArgs() (localctx ITypeArgsContext) { - localctx = NewTypeArgsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 48, nevaParserRULE_typeArgs) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(331) - p.Match(nevaParserT__11) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(335) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(332) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(337) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(338) - p.TypeExpr() - } +func (p *nevaParser) TypeExpr() (localctx ITypeExprContext) { + localctx = NewTypeExprContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 48, nevaParserRULE_typeExpr) p.SetState(349) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserT__2 { - { - p.SetState(339) - p.Match(nevaParserT__2) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(343) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(340) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(345) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 30, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) { p.SetState(346) - p.TypeExpr() + p.TypeInstExpr() } - p.SetState(351) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(347) + p.TypeLitExpr() } - _la = p.GetTokenStream().LA(1) - } - p.SetState(355) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserNEWLINE { + case 3: + p.EnterOuterAlt(localctx, 3) { - p.SetState(352) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(348) + p.UnionTypeExpr() } - p.SetState(357) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(358) - p.Match(nevaParserT__12) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + case antlr.ATNInvalidAltNumber: + goto errorExit } errorExit: @@ -4597,74 +4514,57 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITypeLitExprContext is an interface to support dynamic dispatch. -type ITypeLitExprContext interface { +// ITypeInstExprContext is an interface to support dynamic dispatch. +type ITypeInstExprContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - EnumTypeExpr() IEnumTypeExprContext - ArrTypeExpr() IArrTypeExprContext - StructTypeExpr() IStructTypeExprContext + EntityRef() IEntityRefContext + TypeArgs() ITypeArgsContext - // IsTypeLitExprContext differentiates from other interfaces. - IsTypeLitExprContext() + // IsTypeInstExprContext differentiates from other interfaces. + IsTypeInstExprContext() } -type TypeLitExprContext struct { +type TypeInstExprContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyTypeLitExprContext() *TypeLitExprContext { - var p = new(TypeLitExprContext) +func NewEmptyTypeInstExprContext() *TypeInstExprContext { + var p = new(TypeInstExprContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeLitExpr + p.RuleIndex = nevaParserRULE_typeInstExpr return p } -func InitEmptyTypeLitExprContext(p *TypeLitExprContext) { +func InitEmptyTypeInstExprContext(p *TypeInstExprContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_typeLitExpr + p.RuleIndex = nevaParserRULE_typeInstExpr } -func (*TypeLitExprContext) IsTypeLitExprContext() {} +func (*TypeInstExprContext) IsTypeInstExprContext() {} -func NewTypeLitExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeLitExprContext { - var p = new(TypeLitExprContext) +func NewTypeInstExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeInstExprContext { + var p = new(TypeInstExprContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_typeLitExpr + p.RuleIndex = nevaParserRULE_typeInstExpr return p } -func (s *TypeLitExprContext) GetParser() antlr.Parser { return s.parser } - -func (s *TypeLitExprContext) EnumTypeExpr() IEnumTypeExprContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IEnumTypeExprContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IEnumTypeExprContext) -} +func (s *TypeInstExprContext) GetParser() antlr.Parser { return s.parser } -func (s *TypeLitExprContext) ArrTypeExpr() IArrTypeExprContext { +func (s *TypeInstExprContext) EntityRef() IEntityRefContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArrTypeExprContext); ok { + if _, ok := ctx.(IEntityRefContext); ok { t = ctx.(antlr.RuleContext) break } @@ -4674,13 +4574,13 @@ func (s *TypeLitExprContext) ArrTypeExpr() IArrTypeExprContext { return nil } - return t.(IArrTypeExprContext) + return t.(IEntityRefContext) } -func (s *TypeLitExprContext) StructTypeExpr() IStructTypeExprContext { +func (s *TypeInstExprContext) TypeArgs() ITypeArgsContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStructTypeExprContext); ok { + if _, ok := ctx.(ITypeArgsContext); ok { t = ctx.(antlr.RuleContext) break } @@ -4690,64 +4590,53 @@ func (s *TypeLitExprContext) StructTypeExpr() IStructTypeExprContext { return nil } - return t.(IStructTypeExprContext) + return t.(ITypeArgsContext) } -func (s *TypeLitExprContext) GetRuleContext() antlr.RuleContext { +func (s *TypeInstExprContext) GetRuleContext() antlr.RuleContext { return s } -func (s *TypeLitExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *TypeInstExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *TypeLitExprContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *TypeInstExprContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterTypeLitExpr(s) + listenerT.EnterTypeInstExpr(s) } } -func (s *TypeLitExprContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TypeInstExprContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitTypeLitExpr(s) + listenerT.ExitTypeInstExpr(s) } } -func (p *nevaParser) TypeLitExpr() (localctx ITypeLitExprContext) { - localctx = NewTypeLitExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 50, nevaParserRULE_typeLitExpr) - p.SetState(363) +func (p *nevaParser) TypeInstExpr() (localctx ITypeInstExprContext) { + localctx = NewTypeInstExprContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 50, nevaParserRULE_typeInstExpr) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(351) + p.EntityRef() + } + p.SetState(353) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } + _la = p.GetTokenStream().LA(1) - switch p.GetTokenStream().LA(1) { - case nevaParserT__13: - p.EnterOuterAlt(localctx, 1) + if _la == nevaParserT__11 { { - p.SetState(360) - p.EnumTypeExpr() + p.SetState(352) + p.TypeArgs() } - case nevaParserT__14: - p.EnterOuterAlt(localctx, 2) - { - p.SetState(361) - p.ArrTypeExpr() - } - - case nevaParserT__16: - p.EnterOuterAlt(localctx, 3) - { - p.SetState(362) - p.StructTypeExpr() - } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } + } errorExit: if p.HasError() { @@ -4762,138 +4651,139 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IEnumTypeExprContext is an interface to support dynamic dispatch. -type IEnumTypeExprContext interface { +// ITypeArgsContext is an interface to support dynamic dispatch. +type ITypeArgsContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AllIDENTIFIER() []antlr.TerminalNode - IDENTIFIER(i int) antlr.TerminalNode + AllTypeExpr() []ITypeExprContext + TypeExpr(i int) ITypeExprContext AllNEWLINE() []antlr.TerminalNode NEWLINE(i int) antlr.TerminalNode - // IsEnumTypeExprContext differentiates from other interfaces. - IsEnumTypeExprContext() + // IsTypeArgsContext differentiates from other interfaces. + IsTypeArgsContext() } -type EnumTypeExprContext struct { +type TypeArgsContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyEnumTypeExprContext() *EnumTypeExprContext { - var p = new(EnumTypeExprContext) +func NewEmptyTypeArgsContext() *TypeArgsContext { + var p = new(TypeArgsContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_enumTypeExpr + p.RuleIndex = nevaParserRULE_typeArgs return p } -func InitEmptyEnumTypeExprContext(p *EnumTypeExprContext) { +func InitEmptyTypeArgsContext(p *TypeArgsContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_enumTypeExpr + p.RuleIndex = nevaParserRULE_typeArgs } -func (*EnumTypeExprContext) IsEnumTypeExprContext() {} +func (*TypeArgsContext) IsTypeArgsContext() {} -func NewEnumTypeExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EnumTypeExprContext { - var p = new(EnumTypeExprContext) +func NewTypeArgsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeArgsContext { + var p = new(TypeArgsContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_enumTypeExpr + p.RuleIndex = nevaParserRULE_typeArgs return p } -func (s *EnumTypeExprContext) GetParser() antlr.Parser { return s.parser } +func (s *TypeArgsContext) GetParser() antlr.Parser { return s.parser } -func (s *EnumTypeExprContext) AllIDENTIFIER() []antlr.TerminalNode { - return s.GetTokens(nevaParserIDENTIFIER) +func (s *TypeArgsContext) AllTypeExpr() []ITypeExprContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ITypeExprContext); ok { + len++ + } + } + + tst := make([]ITypeExprContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ITypeExprContext); ok { + tst[i] = t.(ITypeExprContext) + i++ + } + } + + return tst } -func (s *EnumTypeExprContext) IDENTIFIER(i int) antlr.TerminalNode { - return s.GetToken(nevaParserIDENTIFIER, i) +func (s *TypeArgsContext) TypeExpr(i int) ITypeExprContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeExprContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(ITypeExprContext) } -func (s *EnumTypeExprContext) AllNEWLINE() []antlr.TerminalNode { +func (s *TypeArgsContext) AllNEWLINE() []antlr.TerminalNode { return s.GetTokens(nevaParserNEWLINE) } -func (s *EnumTypeExprContext) NEWLINE(i int) antlr.TerminalNode { +func (s *TypeArgsContext) NEWLINE(i int) antlr.TerminalNode { return s.GetToken(nevaParserNEWLINE, i) } -func (s *EnumTypeExprContext) GetRuleContext() antlr.RuleContext { +func (s *TypeArgsContext) GetRuleContext() antlr.RuleContext { return s } -func (s *EnumTypeExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *TypeArgsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *EnumTypeExprContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *TypeArgsContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterEnumTypeExpr(s) + listenerT.EnterTypeArgs(s) } } -func (s *EnumTypeExprContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TypeArgsContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitEnumTypeExpr(s) + listenerT.ExitTypeArgs(s) } } -func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { - localctx = NewEnumTypeExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 52, nevaParserRULE_enumTypeExpr) +func (p *nevaParser) TypeArgs() (localctx ITypeArgsContext) { + localctx = NewTypeArgsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 52, nevaParserRULE_typeArgs) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(365) - p.Match(nevaParserT__13) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(369) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(366) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(371) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(372) - p.Match(nevaParserT__5) + p.SetState(355) + p.Match(nevaParserT__11) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(376) + p.SetState(359) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4902,7 +4792,7 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { for _la == nevaParserNEWLINE { { - p.SetState(373) + p.SetState(356) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -4910,7 +4800,7 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { } } - p.SetState(378) + p.SetState(361) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4918,14 +4808,10 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(379) - p.Match(nevaParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(362) + p.TypeExpr() } - p.SetState(390) + p.SetState(373) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4934,14 +4820,14 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { for _la == nevaParserT__2 { { - p.SetState(380) + p.SetState(363) p.Match(nevaParserT__2) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(384) + p.SetState(367) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4950,7 +4836,7 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { for _la == nevaParserNEWLINE { { - p.SetState(381) + p.SetState(364) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -4958,7 +4844,7 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { } } - p.SetState(386) + p.SetState(369) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4966,22 +4852,18 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(387) - p.Match(nevaParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(370) + p.TypeExpr() } - p.SetState(392) + p.SetState(375) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(396) + p.SetState(379) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4990,7 +4872,7 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { for _la == nevaParserNEWLINE { { - p.SetState(393) + p.SetState(376) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -4998,7 +4880,7 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { } } - p.SetState(398) + p.SetState(381) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5006,8 +4888,8 @@ func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(399) - p.Match(nevaParserT__6) + p.SetState(382) + p.Match(nevaParserT__12) if p.HasError() { // Recognition error - abort rule goto errorExit @@ -5027,63 +4909,57 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IArrTypeExprContext is an interface to support dynamic dispatch. -type IArrTypeExprContext interface { +// ITypeLitExprContext is an interface to support dynamic dispatch. +type ITypeLitExprContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - INT() antlr.TerminalNode - TypeExpr() ITypeExprContext - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode + EnumTypeExpr() IEnumTypeExprContext + StructTypeExpr() IStructTypeExprContext - // IsArrTypeExprContext differentiates from other interfaces. - IsArrTypeExprContext() + // IsTypeLitExprContext differentiates from other interfaces. + IsTypeLitExprContext() } -type ArrTypeExprContext struct { +type TypeLitExprContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyArrTypeExprContext() *ArrTypeExprContext { - var p = new(ArrTypeExprContext) +func NewEmptyTypeLitExprContext() *TypeLitExprContext { + var p = new(TypeLitExprContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_arrTypeExpr + p.RuleIndex = nevaParserRULE_typeLitExpr return p } -func InitEmptyArrTypeExprContext(p *ArrTypeExprContext) { +func InitEmptyTypeLitExprContext(p *TypeLitExprContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_arrTypeExpr + p.RuleIndex = nevaParserRULE_typeLitExpr } -func (*ArrTypeExprContext) IsArrTypeExprContext() {} +func (*TypeLitExprContext) IsTypeLitExprContext() {} -func NewArrTypeExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrTypeExprContext { - var p = new(ArrTypeExprContext) +func NewTypeLitExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeLitExprContext { + var p = new(TypeLitExprContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_arrTypeExpr + p.RuleIndex = nevaParserRULE_typeLitExpr return p } -func (s *ArrTypeExprContext) GetParser() antlr.Parser { return s.parser } - -func (s *ArrTypeExprContext) INT() antlr.TerminalNode { - return s.GetToken(nevaParserINT, 0) -} +func (s *TypeLitExprContext) GetParser() antlr.Parser { return s.parser } -func (s *ArrTypeExprContext) TypeExpr() ITypeExprContext { +func (s *TypeLitExprContext) EnumTypeExpr() IEnumTypeExprContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeExprContext); ok { + if _, ok := ctx.(IEnumTypeExprContext); ok { t = ctx.(antlr.RuleContext) break } @@ -5093,101 +4969,204 @@ func (s *ArrTypeExprContext) TypeExpr() ITypeExprContext { return nil } - return t.(ITypeExprContext) + return t.(IEnumTypeExprContext) } -func (s *ArrTypeExprContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} +func (s *TypeLitExprContext) StructTypeExpr() IStructTypeExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStructTypeExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func (s *ArrTypeExprContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) + if t == nil { + return nil + } + + return t.(IStructTypeExprContext) } -func (s *ArrTypeExprContext) GetRuleContext() antlr.RuleContext { +func (s *TypeLitExprContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ArrTypeExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *TypeLitExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ArrTypeExprContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *TypeLitExprContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterArrTypeExpr(s) + listenerT.EnterTypeLitExpr(s) } } -func (s *ArrTypeExprContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TypeLitExprContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitArrTypeExpr(s) + listenerT.ExitTypeLitExpr(s) } } -func (p *nevaParser) ArrTypeExpr() (localctx IArrTypeExprContext) { - localctx = NewArrTypeExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 54, nevaParserRULE_arrTypeExpr) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(401) - p.Match(nevaParserT__14) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(405) +func (p *nevaParser) TypeLitExpr() (localctx ITypeLitExprContext) { + localctx = NewTypeLitExprContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 54, nevaParserRULE_typeLitExpr) + p.SetState(386) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserNEWLINE { + switch p.GetTokenStream().LA(1) { + case nevaParserT__13: + p.EnterOuterAlt(localctx, 1) { - p.SetState(402) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(384) + p.EnumTypeExpr() } - p.SetState(407) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(408) - p.Match(nevaParserINT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + case nevaParserT__14: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(385) + p.StructTypeExpr() } - } - p.SetState(412) - p.GetErrorHandler().Sync(p) - if p.HasError() { + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) goto errorExit } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(409) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(414) +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IEnumTypeExprContext is an interface to support dynamic dispatch. +type IEnumTypeExprContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllIDENTIFIER() []antlr.TerminalNode + IDENTIFIER(i int) antlr.TerminalNode + AllNEWLINE() []antlr.TerminalNode + NEWLINE(i int) antlr.TerminalNode + + // IsEnumTypeExprContext differentiates from other interfaces. + IsEnumTypeExprContext() +} + +type EnumTypeExprContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyEnumTypeExprContext() *EnumTypeExprContext { + var p = new(EnumTypeExprContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_enumTypeExpr + return p +} + +func InitEmptyEnumTypeExprContext(p *EnumTypeExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_enumTypeExpr +} + +func (*EnumTypeExprContext) IsEnumTypeExprContext() {} + +func NewEnumTypeExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EnumTypeExprContext { + var p = new(EnumTypeExprContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = nevaParserRULE_enumTypeExpr + + return p +} + +func (s *EnumTypeExprContext) GetParser() antlr.Parser { return s.parser } + +func (s *EnumTypeExprContext) AllIDENTIFIER() []antlr.TerminalNode { + return s.GetTokens(nevaParserIDENTIFIER) +} + +func (s *EnumTypeExprContext) IDENTIFIER(i int) antlr.TerminalNode { + return s.GetToken(nevaParserIDENTIFIER, i) +} + +func (s *EnumTypeExprContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} + +func (s *EnumTypeExprContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *EnumTypeExprContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EnumTypeExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *EnumTypeExprContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.EnterEnumTypeExpr(s) + } +} + +func (s *EnumTypeExprContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.ExitEnumTypeExpr(s) + } +} + +func (p *nevaParser) EnumTypeExpr() (localctx IEnumTypeExprContext) { + localctx = NewEnumTypeExprContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 56, nevaParserRULE_enumTypeExpr) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(388) + p.Match(nevaParserT__13) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(392) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(389) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(394) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5195,16 +5174,132 @@ func (p *nevaParser) ArrTypeExpr() (localctx IArrTypeExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(415) - p.Match(nevaParserT__15) + p.SetState(395) + p.Match(nevaParserT__5) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(399) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(396) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(401) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(402) + p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule goto errorExit } } + p.SetState(413) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserT__2 { + { + p.SetState(403) + p.Match(nevaParserT__2) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(407) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(404) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(409) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(410) + p.Match(nevaParserIDENTIFIER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(415) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(419) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(416) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(421) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } { - p.SetState(416) - p.TypeExpr() + p.SetState(422) + p.Match(nevaParserT__6) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } errorExit: @@ -5314,19 +5409,19 @@ func (s *StructTypeExprContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) StructTypeExpr() (localctx IStructTypeExprContext) { localctx = NewStructTypeExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 56, nevaParserRULE_structTypeExpr) + p.EnterRule(localctx, 58, nevaParserRULE_structTypeExpr) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(418) - p.Match(nevaParserT__16) + p.SetState(424) + p.Match(nevaParserT__14) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(422) + p.SetState(428) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5335,7 +5430,7 @@ func (p *nevaParser) StructTypeExpr() (localctx IStructTypeExprContext) { for _la == nevaParserNEWLINE { { - p.SetState(419) + p.SetState(425) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -5343,7 +5438,7 @@ func (p *nevaParser) StructTypeExpr() (localctx IStructTypeExprContext) { } } - p.SetState(424) + p.SetState(430) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5351,14 +5446,14 @@ func (p *nevaParser) StructTypeExpr() (localctx IStructTypeExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(425) + p.SetState(431) p.Match(nevaParserT__5) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(429) + p.SetState(435) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5367,7 +5462,7 @@ func (p *nevaParser) StructTypeExpr() (localctx IStructTypeExprContext) { for _la == nevaParserNEWLINE { { - p.SetState(426) + p.SetState(432) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -5375,14 +5470,14 @@ func (p *nevaParser) StructTypeExpr() (localctx IStructTypeExprContext) { } } - p.SetState(431) + p.SetState(437) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(433) + p.SetState(439) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5391,13 +5486,13 @@ func (p *nevaParser) StructTypeExpr() (localctx IStructTypeExprContext) { if _la == nevaParserIDENTIFIER { { - p.SetState(432) + p.SetState(438) p.StructFields() } } { - p.SetState(435) + p.SetState(441) p.Match(nevaParserT__6) if p.HasError() { // Recognition error - abort rule @@ -5538,15 +5633,15 @@ func (s *StructFieldsContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) StructFields() (localctx IStructFieldsContext) { localctx = NewStructFieldsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 58, nevaParserRULE_structFields) + p.EnterRule(localctx, 60, nevaParserRULE_structFields) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(437) + p.SetState(443) p.StructField() } - p.SetState(446) + p.SetState(452) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5554,7 +5649,7 @@ func (p *nevaParser) StructFields() (localctx IStructFieldsContext) { _la = p.GetTokenStream().LA(1) for _la == nevaParserNEWLINE { - p.SetState(439) + p.SetState(445) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5563,7 +5658,7 @@ func (p *nevaParser) StructFields() (localctx IStructFieldsContext) { for ok := true; ok; ok = _la == nevaParserNEWLINE { { - p.SetState(438) + p.SetState(444) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -5571,7 +5666,7 @@ func (p *nevaParser) StructFields() (localctx IStructFieldsContext) { } } - p.SetState(441) + p.SetState(447) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5579,11 +5674,11 @@ func (p *nevaParser) StructFields() (localctx IStructFieldsContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(443) + p.SetState(449) p.StructField() } - p.SetState(448) + p.SetState(454) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5703,12 +5798,12 @@ func (s *StructFieldContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) StructField() (localctx IStructFieldContext) { localctx = NewStructFieldContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 60, nevaParserRULE_structField) + p.EnterRule(localctx, 62, nevaParserRULE_structField) var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(449) + p.SetState(455) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -5716,10 +5811,10 @@ func (p *nevaParser) StructField() (localctx IStructFieldContext) { } } { - p.SetState(450) + p.SetState(456) p.TypeExpr() } - p.SetState(454) + p.SetState(460) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5731,7 +5826,7 @@ func (p *nevaParser) StructField() (localctx IStructFieldContext) { for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(451) + p.SetState(457) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -5740,7 +5835,7 @@ func (p *nevaParser) StructField() (localctx IStructFieldContext) { } } - p.SetState(456) + p.SetState(462) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5884,17 +5979,17 @@ func (s *UnionTypeExprContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) UnionTypeExpr() (localctx IUnionTypeExprContext) { localctx = NewUnionTypeExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 62, nevaParserRULE_unionTypeExpr) + p.EnterRule(localctx, 64, nevaParserRULE_unionTypeExpr) var _la int var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(457) + p.SetState(463) p.NonUnionTypeExpr() } - p.SetState(472) + p.SetState(478) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5903,7 +5998,7 @@ func (p *nevaParser) UnionTypeExpr() (localctx IUnionTypeExprContext) { for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber { switch _alt { case 1: - p.SetState(461) + p.SetState(467) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5912,7 +6007,7 @@ func (p *nevaParser) UnionTypeExpr() (localctx IUnionTypeExprContext) { for _la == nevaParserNEWLINE { { - p.SetState(458) + p.SetState(464) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -5920,7 +6015,7 @@ func (p *nevaParser) UnionTypeExpr() (localctx IUnionTypeExprContext) { } } - p.SetState(463) + p.SetState(469) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5928,14 +6023,14 @@ func (p *nevaParser) UnionTypeExpr() (localctx IUnionTypeExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(464) - p.Match(nevaParserT__17) + p.SetState(470) + p.Match(nevaParserT__15) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(468) + p.SetState(474) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5944,7 +6039,7 @@ func (p *nevaParser) UnionTypeExpr() (localctx IUnionTypeExprContext) { for _la == nevaParserNEWLINE { { - p.SetState(465) + p.SetState(471) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -5952,7 +6047,7 @@ func (p *nevaParser) UnionTypeExpr() (localctx IUnionTypeExprContext) { } } - p.SetState(470) + p.SetState(476) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -5960,7 +6055,7 @@ func (p *nevaParser) UnionTypeExpr() (localctx IUnionTypeExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(471) + p.SetState(477) p.NonUnionTypeExpr() } @@ -5969,7 +6064,7 @@ func (p *nevaParser) UnionTypeExpr() (localctx IUnionTypeExprContext) { goto errorExit } - p.SetState(474) + p.SetState(480) p.GetErrorHandler().Sync(p) _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 50, p.GetParserRuleContext()) if p.HasError() { @@ -6091,8 +6186,8 @@ func (s *NonUnionTypeExprContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) NonUnionTypeExpr() (localctx INonUnionTypeExprContext) { localctx = NewNonUnionTypeExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 64, nevaParserRULE_nonUnionTypeExpr) - p.SetState(478) + p.EnterRule(localctx, 66, nevaParserRULE_nonUnionTypeExpr) + p.SetState(484) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6102,14 +6197,14 @@ func (p *nevaParser) NonUnionTypeExpr() (localctx INonUnionTypeExprContext) { case nevaParserIDENTIFIER: p.EnterOuterAlt(localctx, 1) { - p.SetState(476) + p.SetState(482) p.TypeInstExpr() } - case nevaParserT__13, nevaParserT__14, nevaParserT__16: + case nevaParserT__13, nevaParserT__14: p.EnterOuterAlt(localctx, 2) { - p.SetState(477) + p.SetState(483) p.TypeLitExpr() } @@ -6139,10 +6234,8 @@ type IInterfaceStmtContext interface { GetParser() antlr.Parser // Getter signatures - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode - AllInterfaceDef() []IInterfaceDefContext - InterfaceDef(i int) IInterfaceDefContext + SingleInterfaceStmt() ISingleInterfaceStmtContext + GroupInterfaceStmt() IGroupInterfaceStmtContext // IsInterfaceStmtContext differentiates from other interfaces. IsInterfaceStmtContext() @@ -6180,45 +6273,28 @@ func NewInterfaceStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext func (s *InterfaceStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *InterfaceStmtContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} - -func (s *InterfaceStmtContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) -} - -func (s *InterfaceStmtContext) AllInterfaceDef() []IInterfaceDefContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IInterfaceDefContext); ok { - len++ +func (s *InterfaceStmtContext) SingleInterfaceStmt() ISingleInterfaceStmtContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISingleInterfaceStmtContext); ok { + t = ctx.(antlr.RuleContext) + break } } - tst := make([]IInterfaceDefContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IInterfaceDefContext); ok { - tst[i] = t.(IInterfaceDefContext) - i++ - } + if t == nil { + return nil } - return tst + return t.(ISingleInterfaceStmtContext) } -func (s *InterfaceStmtContext) InterfaceDef(i int) IInterfaceDefContext { +func (s *InterfaceStmtContext) GroupInterfaceStmt() IGroupInterfaceStmtContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IInterfaceDefContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(IGroupInterfaceStmtContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -6226,7 +6302,7 @@ func (s *InterfaceStmtContext) InterfaceDef(i int) IInterfaceDefContext { return nil } - return t.(IInterfaceDefContext) + return t.(IGroupInterfaceStmtContext) } func (s *InterfaceStmtContext) GetRuleContext() antlr.RuleContext { @@ -6251,102 +6327,31 @@ func (s *InterfaceStmtContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) InterfaceStmt() (localctx IInterfaceStmtContext) { localctx = NewInterfaceStmtContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 66, nevaParserRULE_interfaceStmt) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(480) - p.Match(nevaParserT__18) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(484) + p.EnterRule(localctx, 68, nevaParserRULE_interfaceStmt) + p.SetState(488) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserNEWLINE { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 52, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) { - p.SetState(481) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(486) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(487) - p.Match(nevaParserT__5) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + p.SetState(486) + p.SingleInterfaceStmt() } - } - p.SetState(491) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserNEWLINE { + case 2: + p.EnterOuterAlt(localctx, 2) { - p.SetState(488) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(487) + p.GroupInterfaceStmt() } - p.SetState(493) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - p.SetState(497) - p.GetErrorHandler().Sync(p) - if p.HasError() { + case antlr.ATNInvalidAltNumber: goto errorExit } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserPUB_KW || _la == nevaParserIDENTIFIER { - { - p.SetState(494) - p.InterfaceDef() - } - - p.SetState(499) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(500) - p.Match(nevaParserT__6) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } errorExit: if p.HasError() { @@ -6361,82 +6366,57 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IInterfaceDefContext is an interface to support dynamic dispatch. -type IInterfaceDefContext interface { +// ISingleInterfaceStmtContext is an interface to support dynamic dispatch. +type ISingleInterfaceStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode - InPortsDef() IInPortsDefContext - OutPortsDef() IOutPortsDefContext + InterfaceDef() IInterfaceDefContext PUB_KW() antlr.TerminalNode - TypeParams() ITypeParamsContext - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode - // IsInterfaceDefContext differentiates from other interfaces. - IsInterfaceDefContext() + // IsSingleInterfaceStmtContext differentiates from other interfaces. + IsSingleInterfaceStmtContext() } -type InterfaceDefContext struct { +type SingleInterfaceStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyInterfaceDefContext() *InterfaceDefContext { - var p = new(InterfaceDefContext) +func NewEmptySingleInterfaceStmtContext() *SingleInterfaceStmtContext { + var p = new(SingleInterfaceStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_interfaceDef + p.RuleIndex = nevaParserRULE_singleInterfaceStmt return p } -func InitEmptyInterfaceDefContext(p *InterfaceDefContext) { +func InitEmptySingleInterfaceStmtContext(p *SingleInterfaceStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_interfaceDef + p.RuleIndex = nevaParserRULE_singleInterfaceStmt } -func (*InterfaceDefContext) IsInterfaceDefContext() {} +func (*SingleInterfaceStmtContext) IsSingleInterfaceStmtContext() {} -func NewInterfaceDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InterfaceDefContext { - var p = new(InterfaceDefContext) +func NewSingleInterfaceStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SingleInterfaceStmtContext { + var p = new(SingleInterfaceStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_interfaceDef + p.RuleIndex = nevaParserRULE_singleInterfaceStmt return p } -func (s *InterfaceDefContext) GetParser() antlr.Parser { return s.parser } - -func (s *InterfaceDefContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(nevaParserIDENTIFIER, 0) -} - -func (s *InterfaceDefContext) InPortsDef() IInPortsDefContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IInPortsDefContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IInPortsDefContext) -} +func (s *SingleInterfaceStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *InterfaceDefContext) OutPortsDef() IOutPortsDefContext { +func (s *SingleInterfaceStmtContext) InterfaceDef() IInterfaceDefContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IOutPortsDefContext); ok { + if _, ok := ctx.(IInterfaceDefContext); ok { t = ctx.(antlr.RuleContext) break } @@ -6446,66 +6426,40 @@ func (s *InterfaceDefContext) OutPortsDef() IOutPortsDefContext { return nil } - return t.(IOutPortsDefContext) + return t.(IInterfaceDefContext) } -func (s *InterfaceDefContext) PUB_KW() antlr.TerminalNode { +func (s *SingleInterfaceStmtContext) PUB_KW() antlr.TerminalNode { return s.GetToken(nevaParserPUB_KW, 0) } -func (s *InterfaceDefContext) TypeParams() ITypeParamsContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeParamsContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(ITypeParamsContext) -} - -func (s *InterfaceDefContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} - -func (s *InterfaceDefContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) -} - -func (s *InterfaceDefContext) GetRuleContext() antlr.RuleContext { +func (s *SingleInterfaceStmtContext) GetRuleContext() antlr.RuleContext { return s } -func (s *InterfaceDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *SingleInterfaceStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *InterfaceDefContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *SingleInterfaceStmtContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterInterfaceDef(s) + listenerT.EnterSingleInterfaceStmt(s) } } -func (s *InterfaceDefContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *SingleInterfaceStmtContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitInterfaceDef(s) + listenerT.ExitSingleInterfaceStmt(s) } } -func (p *nevaParser) InterfaceDef() (localctx IInterfaceDefContext) { - localctx = NewInterfaceDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 68, nevaParserRULE_interfaceDef) +func (p *nevaParser) SingleInterfaceStmt() (localctx ISingleInterfaceStmtContext) { + localctx = NewSingleInterfaceStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 70, nevaParserRULE_singleInterfaceStmt) var _la int - var _alt int - p.EnterOuterAlt(localctx, 1) - p.SetState(503) + p.SetState(491) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6514,7 +6468,7 @@ func (p *nevaParser) InterfaceDef() (localctx IInterfaceDefContext) { if _la == nevaParserPUB_KW { { - p.SetState(502) + p.SetState(490) p.Match(nevaParserPUB_KW) if p.HasError() { // Recognition error - abort rule @@ -6524,65 +6478,16 @@ func (p *nevaParser) InterfaceDef() (localctx IInterfaceDefContext) { } { - p.SetState(505) - p.Match(nevaParserIDENTIFIER) + p.SetState(493) + p.Match(nevaParserT__16) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(507) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == nevaParserT__11 { - { - p.SetState(506) - p.TypeParams() - } - - } - { - p.SetState(509) - p.InPortsDef() - } { - p.SetState(510) - p.OutPortsDef() - } - p.SetState(514) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 57, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - { - p.SetState(511) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - p.SetState(516) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 57, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } + p.SetState(494) + p.InterfaceDef() } errorExit: @@ -6598,58 +6503,96 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IInPortsDefContext is an interface to support dynamic dispatch. -type IInPortsDefContext interface { +// IGroupInterfaceStmtContext is an interface to support dynamic dispatch. +type IGroupInterfaceStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - PortsDef() IPortsDefContext + AllNEWLINE() []antlr.TerminalNode + NEWLINE(i int) antlr.TerminalNode + AllInterfaceDef() []IInterfaceDefContext + InterfaceDef(i int) IInterfaceDefContext + AllPUB_KW() []antlr.TerminalNode + PUB_KW(i int) antlr.TerminalNode - // IsInPortsDefContext differentiates from other interfaces. - IsInPortsDefContext() + // IsGroupInterfaceStmtContext differentiates from other interfaces. + IsGroupInterfaceStmtContext() } -type InPortsDefContext struct { +type GroupInterfaceStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyInPortsDefContext() *InPortsDefContext { - var p = new(InPortsDefContext) +func NewEmptyGroupInterfaceStmtContext() *GroupInterfaceStmtContext { + var p = new(GroupInterfaceStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_inPortsDef + p.RuleIndex = nevaParserRULE_groupInterfaceStmt return p } -func InitEmptyInPortsDefContext(p *InPortsDefContext) { +func InitEmptyGroupInterfaceStmtContext(p *GroupInterfaceStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_inPortsDef + p.RuleIndex = nevaParserRULE_groupInterfaceStmt } -func (*InPortsDefContext) IsInPortsDefContext() {} +func (*GroupInterfaceStmtContext) IsGroupInterfaceStmtContext() {} -func NewInPortsDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InPortsDefContext { - var p = new(InPortsDefContext) +func NewGroupInterfaceStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupInterfaceStmtContext { + var p = new(GroupInterfaceStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_inPortsDef + p.RuleIndex = nevaParserRULE_groupInterfaceStmt return p } -func (s *InPortsDefContext) GetParser() antlr.Parser { return s.parser } +func (s *GroupInterfaceStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *InPortsDefContext) PortsDef() IPortsDefContext { +func (s *GroupInterfaceStmtContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} + +func (s *GroupInterfaceStmtContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *GroupInterfaceStmtContext) AllInterfaceDef() []IInterfaceDefContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IInterfaceDefContext); ok { + len++ + } + } + + tst := make([]IInterfaceDefContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IInterfaceDefContext); ok { + tst[i] = t.(IInterfaceDefContext) + i++ + } + } + + return tst +} + +func (s *GroupInterfaceStmtContext) InterfaceDef(i int) IInterfaceDefContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IPortsDefContext); ok { - t = ctx.(antlr.RuleContext) - break + if _, ok := ctx.(IInterfaceDefContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -6657,36 +6600,152 @@ func (s *InPortsDefContext) PortsDef() IPortsDefContext { return nil } - return t.(IPortsDefContext) + return t.(IInterfaceDefContext) } -func (s *InPortsDefContext) GetRuleContext() antlr.RuleContext { +func (s *GroupInterfaceStmtContext) AllPUB_KW() []antlr.TerminalNode { + return s.GetTokens(nevaParserPUB_KW) +} + +func (s *GroupInterfaceStmtContext) PUB_KW(i int) antlr.TerminalNode { + return s.GetToken(nevaParserPUB_KW, i) +} + +func (s *GroupInterfaceStmtContext) GetRuleContext() antlr.RuleContext { return s } -func (s *InPortsDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *GroupInterfaceStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *InPortsDefContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *GroupInterfaceStmtContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterInPortsDef(s) + listenerT.EnterGroupInterfaceStmt(s) } } -func (s *InPortsDefContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *GroupInterfaceStmtContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitInPortsDef(s) + listenerT.ExitGroupInterfaceStmt(s) } } -func (p *nevaParser) InPortsDef() (localctx IInPortsDefContext) { - localctx = NewInPortsDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 70, nevaParserRULE_inPortsDef) +func (p *nevaParser) GroupInterfaceStmt() (localctx IGroupInterfaceStmtContext) { + localctx = NewGroupInterfaceStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 72, nevaParserRULE_groupInterfaceStmt) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(517) - p.PortsDef() + p.SetState(496) + p.Match(nevaParserT__16) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(500) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(497) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(502) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(503) + p.Match(nevaParserT__5) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(507) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(504) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(509) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(516) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserPUB_KW || _la == nevaParserIDENTIFIER { + p.SetState(511) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == nevaParserPUB_KW { + { + p.SetState(510) + p.Match(nevaParserPUB_KW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(513) + p.InterfaceDef() + } + + p.SetState(518) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(519) + p.Match(nevaParserT__6) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } errorExit: @@ -6702,56 +6761,65 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IOutPortsDefContext is an interface to support dynamic dispatch. -type IOutPortsDefContext interface { +// IInterfaceDefContext is an interface to support dynamic dispatch. +type IInterfaceDefContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - PortsDef() IPortsDefContext + IDENTIFIER() antlr.TerminalNode + InPortsDef() IInPortsDefContext + OutPortsDef() IOutPortsDefContext + TypeParams() ITypeParamsContext + AllNEWLINE() []antlr.TerminalNode + NEWLINE(i int) antlr.TerminalNode - // IsOutPortsDefContext differentiates from other interfaces. - IsOutPortsDefContext() + // IsInterfaceDefContext differentiates from other interfaces. + IsInterfaceDefContext() } -type OutPortsDefContext struct { +type InterfaceDefContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyOutPortsDefContext() *OutPortsDefContext { - var p = new(OutPortsDefContext) +func NewEmptyInterfaceDefContext() *InterfaceDefContext { + var p = new(InterfaceDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_outPortsDef + p.RuleIndex = nevaParserRULE_interfaceDef return p } -func InitEmptyOutPortsDefContext(p *OutPortsDefContext) { +func InitEmptyInterfaceDefContext(p *InterfaceDefContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_outPortsDef + p.RuleIndex = nevaParserRULE_interfaceDef } -func (*OutPortsDefContext) IsOutPortsDefContext() {} +func (*InterfaceDefContext) IsInterfaceDefContext() {} -func NewOutPortsDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OutPortsDefContext { - var p = new(OutPortsDefContext) +func NewInterfaceDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InterfaceDefContext { + var p = new(InterfaceDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_outPortsDef + p.RuleIndex = nevaParserRULE_interfaceDef return p } -func (s *OutPortsDefContext) GetParser() antlr.Parser { return s.parser } +func (s *InterfaceDefContext) GetParser() antlr.Parser { return s.parser } -func (s *OutPortsDefContext) PortsDef() IPortsDefContext { +func (s *InterfaceDefContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(nevaParserIDENTIFIER, 0) +} + +func (s *InterfaceDefContext) InPortsDef() IInPortsDefContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IPortsDefContext); ok { + if _, ok := ctx.(IInPortsDefContext); ok { t = ctx.(antlr.RuleContext) break } @@ -6761,36 +6829,137 @@ func (s *OutPortsDefContext) PortsDef() IPortsDefContext { return nil } - return t.(IPortsDefContext) + return t.(IInPortsDefContext) } -func (s *OutPortsDefContext) GetRuleContext() antlr.RuleContext { +func (s *InterfaceDefContext) OutPortsDef() IOutPortsDefContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IOutPortsDefContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IOutPortsDefContext) +} + +func (s *InterfaceDefContext) TypeParams() ITypeParamsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeParamsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeParamsContext) +} + +func (s *InterfaceDefContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} + +func (s *InterfaceDefContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *InterfaceDefContext) GetRuleContext() antlr.RuleContext { return s } -func (s *OutPortsDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *InterfaceDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *OutPortsDefContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *InterfaceDefContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterOutPortsDef(s) + listenerT.EnterInterfaceDef(s) } } -func (s *OutPortsDefContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *InterfaceDefContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitOutPortsDef(s) + listenerT.ExitInterfaceDef(s) } } -func (p *nevaParser) OutPortsDef() (localctx IOutPortsDefContext) { - localctx = NewOutPortsDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 72, nevaParserRULE_outPortsDef) +func (p *nevaParser) InterfaceDef() (localctx IInterfaceDefContext) { + localctx = NewInterfaceDefContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 74, nevaParserRULE_interfaceDef) + var _la int + + var _alt int + p.EnterOuterAlt(localctx, 1) { - p.SetState(519) - p.PortsDef() + p.SetState(521) + p.Match(nevaParserIDENTIFIER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(523) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == nevaParserT__11 { + { + p.SetState(522) + p.TypeParams() + } + + } + { + p.SetState(525) + p.InPortsDef() + } + { + p.SetState(526) + p.OutPortsDef() + } + p.SetState(530) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 59, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(527) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + p.SetState(532) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 59, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } } errorExit: @@ -6806,86 +6975,58 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IPortsDefContext is an interface to support dynamic dispatch. -type IPortsDefContext interface { +// IInPortsDefContext is an interface to support dynamic dispatch. +type IInPortsDefContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AllPortDef() []IPortDefContext - PortDef(i int) IPortDefContext - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode + PortsDef() IPortsDefContext - // IsPortsDefContext differentiates from other interfaces. - IsPortsDefContext() + // IsInPortsDefContext differentiates from other interfaces. + IsInPortsDefContext() } -type PortsDefContext struct { +type InPortsDefContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyPortsDefContext() *PortsDefContext { - var p = new(PortsDefContext) +func NewEmptyInPortsDefContext() *InPortsDefContext { + var p = new(InPortsDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_portsDef + p.RuleIndex = nevaParserRULE_inPortsDef return p } -func InitEmptyPortsDefContext(p *PortsDefContext) { +func InitEmptyInPortsDefContext(p *InPortsDefContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_portsDef + p.RuleIndex = nevaParserRULE_inPortsDef } -func (*PortsDefContext) IsPortsDefContext() {} +func (*InPortsDefContext) IsInPortsDefContext() {} -func NewPortsDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PortsDefContext { - var p = new(PortsDefContext) +func NewInPortsDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InPortsDefContext { + var p = new(InPortsDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_portsDef + p.RuleIndex = nevaParserRULE_inPortsDef return p } -func (s *PortsDefContext) GetParser() antlr.Parser { return s.parser } - -func (s *PortsDefContext) AllPortDef() []IPortDefContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IPortDefContext); ok { - len++ - } - } - - tst := make([]IPortDefContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IPortDefContext); ok { - tst[i] = t.(IPortDefContext) - i++ - } - } - - return tst -} +func (s *InPortsDefContext) GetParser() antlr.Parser { return s.parser } -func (s *PortsDefContext) PortDef(i int) IPortDefContext { +func (s *InPortsDefContext) PortsDef() IPortsDefContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IPortDefContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(IPortsDefContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -6893,144 +7034,36 @@ func (s *PortsDefContext) PortDef(i int) IPortDefContext { return nil } - return t.(IPortDefContext) -} - -func (s *PortsDefContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} - -func (s *PortsDefContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) + return t.(IPortsDefContext) } -func (s *PortsDefContext) GetRuleContext() antlr.RuleContext { +func (s *InPortsDefContext) GetRuleContext() antlr.RuleContext { return s } -func (s *PortsDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *InPortsDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *PortsDefContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *InPortsDefContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterPortsDef(s) + listenerT.EnterInPortsDef(s) } } -func (s *PortsDefContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *InPortsDefContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitPortsDef(s) + listenerT.ExitInPortsDef(s) } } -func (p *nevaParser) PortsDef() (localctx IPortsDefContext) { - localctx = NewPortsDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 74, nevaParserRULE_portsDef) - var _la int - +func (p *nevaParser) InPortsDef() (localctx IInPortsDefContext) { + localctx = NewInPortsDefContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 76, nevaParserRULE_inPortsDef) p.EnterOuterAlt(localctx, 1) { - p.SetState(521) - p.Match(nevaParserT__1) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(539) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 61, p.GetParserRuleContext()) { - case 1: - p.SetState(525) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(522) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(527) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - - case 2: - p.SetState(529) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == nevaParserIDENTIFIER || _la == nevaParserNEWLINE { - { - p.SetState(528) - p.PortDef() - } - - } - - case 3: - { - p.SetState(531) - p.PortDef() - } - p.SetState(536) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserT__2 { - { - p.SetState(532) - p.Match(nevaParserT__2) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(533) - p.PortDef() - } - - p.SetState(538) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - - case antlr.ATNInvalidAltNumber: - goto errorExit - } - { - p.SetState(541) - p.Match(nevaParserT__3) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(533) + p.PortsDef() } errorExit: @@ -7046,63 +7079,56 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IPortDefContext is an interface to support dynamic dispatch. -type IPortDefContext interface { +// IOutPortsDefContext is an interface to support dynamic dispatch. +type IOutPortsDefContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode - TypeExpr() ITypeExprContext - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode + PortsDef() IPortsDefContext - // IsPortDefContext differentiates from other interfaces. - IsPortDefContext() + // IsOutPortsDefContext differentiates from other interfaces. + IsOutPortsDefContext() } -type PortDefContext struct { +type OutPortsDefContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyPortDefContext() *PortDefContext { - var p = new(PortDefContext) +func NewEmptyOutPortsDefContext() *OutPortsDefContext { + var p = new(OutPortsDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_portDef + p.RuleIndex = nevaParserRULE_outPortsDef return p } -func InitEmptyPortDefContext(p *PortDefContext) { +func InitEmptyOutPortsDefContext(p *OutPortsDefContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_portDef + p.RuleIndex = nevaParserRULE_outPortsDef } -func (*PortDefContext) IsPortDefContext() {} +func (*OutPortsDefContext) IsOutPortsDefContext() {} -func NewPortDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PortDefContext { - var p = new(PortDefContext) +func NewOutPortsDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OutPortsDefContext { + var p = new(OutPortsDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_portDef + p.RuleIndex = nevaParserRULE_outPortsDef return p } -func (s *PortDefContext) GetParser() antlr.Parser { return s.parser } - -func (s *PortDefContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(nevaParserIDENTIFIER, 0) -} +func (s *OutPortsDefContext) GetParser() antlr.Parser { return s.parser } -func (s *PortDefContext) TypeExpr() ITypeExprContext { +func (s *OutPortsDefContext) PortsDef() IPortsDefContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITypeExprContext); ok { + if _, ok := ctx.(IPortsDefContext); ok { t = ctx.(antlr.RuleContext) break } @@ -7112,102 +7138,36 @@ func (s *PortDefContext) TypeExpr() ITypeExprContext { return nil } - return t.(ITypeExprContext) -} - -func (s *PortDefContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} - -func (s *PortDefContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) + return t.(IPortsDefContext) } -func (s *PortDefContext) GetRuleContext() antlr.RuleContext { +func (s *OutPortsDefContext) GetRuleContext() antlr.RuleContext { return s } -func (s *PortDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *OutPortsDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *PortDefContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *OutPortsDefContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterPortDef(s) + listenerT.EnterOutPortsDef(s) } } -func (s *PortDefContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *OutPortsDefContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitPortDef(s) + listenerT.ExitOutPortsDef(s) } } -func (p *nevaParser) PortDef() (localctx IPortDefContext) { - localctx = NewPortDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 76, nevaParserRULE_portDef) - var _la int - +func (p *nevaParser) OutPortsDef() (localctx IOutPortsDefContext) { + localctx = NewOutPortsDefContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 78, nevaParserRULE_outPortsDef) p.EnterOuterAlt(localctx, 1) - p.SetState(546) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(543) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(548) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - { - p.SetState(549) - p.Match(nevaParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } { - p.SetState(550) - p.TypeExpr() - } - p.SetState(554) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(551) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - p.SetState(556) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) + p.SetState(535) + p.PortsDef() } errorExit: @@ -7223,77 +7183,69 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IConstStmtContext is an interface to support dynamic dispatch. -type IConstStmtContext interface { +// IPortsDefContext is an interface to support dynamic dispatch. +type IPortsDefContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures + AllPortDef() []IPortDefContext + PortDef(i int) IPortDefContext AllNEWLINE() []antlr.TerminalNode NEWLINE(i int) antlr.TerminalNode - AllConstDef() []IConstDefContext - ConstDef(i int) IConstDefContext - // IsConstStmtContext differentiates from other interfaces. - IsConstStmtContext() + // IsPortsDefContext differentiates from other interfaces. + IsPortsDefContext() } -type ConstStmtContext struct { +type PortsDefContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyConstStmtContext() *ConstStmtContext { - var p = new(ConstStmtContext) +func NewEmptyPortsDefContext() *PortsDefContext { + var p = new(PortsDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_constStmt + p.RuleIndex = nevaParserRULE_portsDef return p } -func InitEmptyConstStmtContext(p *ConstStmtContext) { +func InitEmptyPortsDefContext(p *PortsDefContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_constStmt + p.RuleIndex = nevaParserRULE_portsDef } -func (*ConstStmtContext) IsConstStmtContext() {} +func (*PortsDefContext) IsPortsDefContext() {} -func NewConstStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstStmtContext { - var p = new(ConstStmtContext) +func NewPortsDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PortsDefContext { + var p = new(PortsDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_constStmt + p.RuleIndex = nevaParserRULE_portsDef return p } -func (s *ConstStmtContext) GetParser() antlr.Parser { return s.parser } - -func (s *ConstStmtContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} - -func (s *ConstStmtContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) -} +func (s *PortsDefContext) GetParser() antlr.Parser { return s.parser } -func (s *ConstStmtContext) AllConstDef() []IConstDefContext { +func (s *PortsDefContext) AllPortDef() []IPortDefContext { children := s.GetChildren() len := 0 for _, ctx := range children { - if _, ok := ctx.(IConstDefContext); ok { + if _, ok := ctx.(IPortDefContext); ok { len++ } } - tst := make([]IConstDefContext, len) + tst := make([]IPortDefContext, len) i := 0 for _, ctx := range children { - if t, ok := ctx.(IConstDefContext); ok { - tst[i] = t.(IConstDefContext) + if t, ok := ctx.(IPortDefContext); ok { + tst[i] = t.(IPortDefContext) i++ } } @@ -7301,11 +7253,11 @@ func (s *ConstStmtContext) AllConstDef() []IConstDefContext { return tst } -func (s *ConstStmtContext) ConstDef(i int) IConstDefContext { +func (s *PortsDefContext) PortDef(i int) IPortDefContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IConstDefContext); ok { + if _, ok := ctx.(IPortDefContext); ok { if j == i { t = ctx.(antlr.RuleContext) break @@ -7318,122 +7270,140 @@ func (s *ConstStmtContext) ConstDef(i int) IConstDefContext { return nil } - return t.(IConstDefContext) + return t.(IPortDefContext) } -func (s *ConstStmtContext) GetRuleContext() antlr.RuleContext { +func (s *PortsDefContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} + +func (s *PortsDefContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *PortsDefContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ConstStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *PortsDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ConstStmtContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *PortsDefContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterConstStmt(s) + listenerT.EnterPortsDef(s) } } -func (s *ConstStmtContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *PortsDefContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitConstStmt(s) + listenerT.ExitPortsDef(s) } } -func (p *nevaParser) ConstStmt() (localctx IConstStmtContext) { - localctx = NewConstStmtContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 78, nevaParserRULE_constStmt) +func (p *nevaParser) PortsDef() (localctx IPortsDefContext) { + localctx = NewPortsDefContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 80, nevaParserRULE_portsDef) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(557) - p.Match(nevaParserT__19) + p.SetState(537) + p.Match(nevaParserT__1) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(561) + p.SetState(555) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(558) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(563) + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 63, p.GetParserRuleContext()) { + case 1: + p.SetState(541) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - } - { - p.SetState(564) - p.Match(nevaParserT__5) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(568) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserNEWLINE { - { - p.SetState(565) - p.Match(nevaParserNEWLINE) + for _la == nevaParserNEWLINE { + { + p.SetState(538) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(543) + p.GetErrorHandler().Sync(p) if p.HasError() { - // Recognition error - abort rule goto errorExit } + _la = p.GetTokenStream().LA(1) } - p.SetState(570) + case 2: + p.SetState(545) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - } - p.SetState(574) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserPUB_KW || _la == nevaParserIDENTIFIER { - { - p.SetState(571) - p.ConstDef() + if _la == nevaParserIDENTIFIER || _la == nevaParserNEWLINE { + { + p.SetState(544) + p.PortDef() + } + } - p.SetState(576) + case 3: + { + p.SetState(547) + p.PortDef() + } + p.SetState(552) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) + + for _la == nevaParserT__2 { + { + p.SetState(548) + p.Match(nevaParserT__2) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(549) + p.PortDef() + } + + p.SetState(554) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + case antlr.ATNInvalidAltNumber: + goto errorExit } { - p.SetState(577) - p.Match(nevaParserT__6) + p.SetState(557) + p.Match(nevaParserT__3) if p.HasError() { // Recognition error - abort rule goto errorExit @@ -7453,8 +7423,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IConstDefContext is an interface to support dynamic dispatch. -type IConstDefContext interface { +// IPortDefContext is an interface to support dynamic dispatch. +type IPortDefContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -7463,52 +7433,50 @@ type IConstDefContext interface { // Getter signatures IDENTIFIER() antlr.TerminalNode TypeExpr() ITypeExprContext - ConstVal() IConstValContext - PUB_KW() antlr.TerminalNode AllNEWLINE() []antlr.TerminalNode NEWLINE(i int) antlr.TerminalNode - // IsConstDefContext differentiates from other interfaces. - IsConstDefContext() + // IsPortDefContext differentiates from other interfaces. + IsPortDefContext() } -type ConstDefContext struct { +type PortDefContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyConstDefContext() *ConstDefContext { - var p = new(ConstDefContext) +func NewEmptyPortDefContext() *PortDefContext { + var p = new(PortDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_constDef + p.RuleIndex = nevaParserRULE_portDef return p } -func InitEmptyConstDefContext(p *ConstDefContext) { +func InitEmptyPortDefContext(p *PortDefContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_constDef + p.RuleIndex = nevaParserRULE_portDef } -func (*ConstDefContext) IsConstDefContext() {} +func (*PortDefContext) IsPortDefContext() {} -func NewConstDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstDefContext { - var p = new(ConstDefContext) +func NewPortDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PortDefContext { + var p = new(PortDefContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_constDef + p.RuleIndex = nevaParserRULE_portDef return p } -func (s *ConstDefContext) GetParser() antlr.Parser { return s.parser } +func (s *PortDefContext) GetParser() antlr.Parser { return s.parser } -func (s *ConstDefContext) IDENTIFIER() antlr.TerminalNode { +func (s *PortDefContext) IDENTIFIER() antlr.TerminalNode { return s.GetToken(nevaParserIDENTIFIER, 0) } -func (s *ConstDefContext) TypeExpr() ITypeExprContext { +func (s *PortDefContext) TypeExpr() ITypeExprContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(ITypeExprContext); ok { @@ -7524,80 +7492,66 @@ func (s *ConstDefContext) TypeExpr() ITypeExprContext { return t.(ITypeExprContext) } -func (s *ConstDefContext) ConstVal() IConstValContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IConstValContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IConstValContext) -} - -func (s *ConstDefContext) PUB_KW() antlr.TerminalNode { - return s.GetToken(nevaParserPUB_KW, 0) -} - -func (s *ConstDefContext) AllNEWLINE() []antlr.TerminalNode { +func (s *PortDefContext) AllNEWLINE() []antlr.TerminalNode { return s.GetTokens(nevaParserNEWLINE) } -func (s *ConstDefContext) NEWLINE(i int) antlr.TerminalNode { +func (s *PortDefContext) NEWLINE(i int) antlr.TerminalNode { return s.GetToken(nevaParserNEWLINE, i) } -func (s *ConstDefContext) GetRuleContext() antlr.RuleContext { +func (s *PortDefContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ConstDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *PortDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ConstDefContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *PortDefContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterConstDef(s) + listenerT.EnterPortDef(s) } } -func (s *ConstDefContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *PortDefContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitConstDef(s) + listenerT.ExitPortDef(s) } } -func (p *nevaParser) ConstDef() (localctx IConstDefContext) { - localctx = NewConstDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 80, nevaParserRULE_constDef) +func (p *nevaParser) PortDef() (localctx IPortDefContext) { + localctx = NewPortDefContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 82, nevaParserRULE_portDef) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(580) + p.SetState(562) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == nevaParserPUB_KW { + for _la == nevaParserNEWLINE { { - p.SetState(579) - p.Match(nevaParserPUB_KW) + p.SetState(559) + p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule goto errorExit } } + p.SetState(564) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) } { - p.SetState(582) + p.SetState(565) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -7605,14 +7559,10 @@ func (p *nevaParser) ConstDef() (localctx IConstDefContext) { } } { - p.SetState(583) + p.SetState(566) p.TypeExpr() } - { - p.SetState(584) - p.ConstVal() - } - p.SetState(588) + p.SetState(570) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -7621,7 +7571,7 @@ func (p *nevaParser) ConstDef() (localctx IConstDefContext) { for _la == nevaParserNEWLINE { { - p.SetState(585) + p.SetState(567) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -7629,7 +7579,7 @@ func (p *nevaParser) ConstDef() (localctx IConstDefContext) { } } - p.SetState(590) + p.SetState(572) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -7650,106 +7600,57 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IConstValContext is an interface to support dynamic dispatch. -type IConstValContext interface { +// IConstStmtContext is an interface to support dynamic dispatch. +type IConstStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Bool_() IBoolContext - INT() antlr.TerminalNode - FLOAT() antlr.TerminalNode - STRING() antlr.TerminalNode - ArrLit() IArrLitContext - StructLit() IStructLitContext - Nil_() INilContext + SingleConstStmt() ISingleConstStmtContext + GroupConstStmt() IGroupConstStmtContext - // IsConstValContext differentiates from other interfaces. - IsConstValContext() + // IsConstStmtContext differentiates from other interfaces. + IsConstStmtContext() } -type ConstValContext struct { +type ConstStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyConstValContext() *ConstValContext { - var p = new(ConstValContext) +func NewEmptyConstStmtContext() *ConstStmtContext { + var p = new(ConstStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_constVal + p.RuleIndex = nevaParserRULE_constStmt return p } -func InitEmptyConstValContext(p *ConstValContext) { +func InitEmptyConstStmtContext(p *ConstStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_constVal + p.RuleIndex = nevaParserRULE_constStmt } -func (*ConstValContext) IsConstValContext() {} +func (*ConstStmtContext) IsConstStmtContext() {} -func NewConstValContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstValContext { - var p = new(ConstValContext) +func NewConstStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstStmtContext { + var p = new(ConstStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_constVal + p.RuleIndex = nevaParserRULE_constStmt return p } -func (s *ConstValContext) GetParser() antlr.Parser { return s.parser } - -func (s *ConstValContext) Bool_() IBoolContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IBoolContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IBoolContext) -} - -func (s *ConstValContext) INT() antlr.TerminalNode { - return s.GetToken(nevaParserINT, 0) -} - -func (s *ConstValContext) FLOAT() antlr.TerminalNode { - return s.GetToken(nevaParserFLOAT, 0) -} - -func (s *ConstValContext) STRING() antlr.TerminalNode { - return s.GetToken(nevaParserSTRING, 0) -} - -func (s *ConstValContext) ArrLit() IArrLitContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArrLitContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IArrLitContext) -} +func (s *ConstStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *ConstValContext) StructLit() IStructLitContext { +func (s *ConstStmtContext) SingleConstStmt() ISingleConstStmtContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStructLitContext); ok { + if _, ok := ctx.(ISingleConstStmtContext); ok { t = ctx.(antlr.RuleContext) break } @@ -7759,13 +7660,13 @@ func (s *ConstValContext) StructLit() IStructLitContext { return nil } - return t.(IStructLitContext) + return t.(ISingleConstStmtContext) } -func (s *ConstValContext) Nil_() INilContext { +func (s *ConstStmtContext) GroupConstStmt() IGroupConstStmtContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(INilContext); ok { + if _, ok := ctx.(IGroupConstStmtContext); ok { t = ctx.(antlr.RuleContext) break } @@ -7775,104 +7676,56 @@ func (s *ConstValContext) Nil_() INilContext { return nil } - return t.(INilContext) + return t.(IGroupConstStmtContext) } -func (s *ConstValContext) GetRuleContext() antlr.RuleContext { +func (s *ConstStmtContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ConstValContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ConstStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ConstValContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *ConstStmtContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterConstVal(s) + listenerT.EnterConstStmt(s) } } -func (s *ConstValContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *ConstStmtContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitConstVal(s) + listenerT.ExitConstStmt(s) } } -func (p *nevaParser) ConstVal() (localctx IConstValContext) { - localctx = NewConstValContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 82, nevaParserRULE_constVal) - p.SetState(598) +func (p *nevaParser) ConstStmt() (localctx IConstStmtContext) { + localctx = NewConstStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 84, nevaParserRULE_constStmt) + p.SetState(575) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetTokenStream().LA(1) { - case nevaParserT__20, nevaParserT__21: + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 66, p.GetParserRuleContext()) { + case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(591) - p.Bool_() + p.SetState(573) + p.SingleConstStmt() } - case nevaParserINT: + case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(592) - p.Match(nevaParserINT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case nevaParserFLOAT: - p.EnterOuterAlt(localctx, 3) - { - p.SetState(593) - p.Match(nevaParserFLOAT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case nevaParserSTRING: - p.EnterOuterAlt(localctx, 4) - { - p.SetState(594) - p.Match(nevaParserSTRING) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(574) + p.GroupConstStmt() } - case nevaParserT__14: - p.EnterOuterAlt(localctx, 5) - { - p.SetState(595) - p.ArrLit() - } - - case nevaParserT__5: - p.EnterOuterAlt(localctx, 6) - { - p.SetState(596) - p.StructLit() - } - - case nevaParserT__22: - p.EnterOuterAlt(localctx, 7) - { - p.SetState(597) - p.Nil_() - } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } + case antlr.ATNInvalidAltNumber: + goto errorExit + } errorExit: if p.HasError() { @@ -7887,84 +7740,129 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IBoolContext is an interface to support dynamic dispatch. -type IBoolContext interface { +// ISingleConstStmtContext is an interface to support dynamic dispatch. +type ISingleConstStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - // IsBoolContext differentiates from other interfaces. - IsBoolContext() + + // Getter signatures + ConstDef() IConstDefContext + PUB_KW() antlr.TerminalNode + + // IsSingleConstStmtContext differentiates from other interfaces. + IsSingleConstStmtContext() } -type BoolContext struct { +type SingleConstStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyBoolContext() *BoolContext { - var p = new(BoolContext) +func NewEmptySingleConstStmtContext() *SingleConstStmtContext { + var p = new(SingleConstStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_bool + p.RuleIndex = nevaParserRULE_singleConstStmt return p } -func InitEmptyBoolContext(p *BoolContext) { +func InitEmptySingleConstStmtContext(p *SingleConstStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_bool + p.RuleIndex = nevaParserRULE_singleConstStmt } -func (*BoolContext) IsBoolContext() {} +func (*SingleConstStmtContext) IsSingleConstStmtContext() {} -func NewBoolContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BoolContext { - var p = new(BoolContext) +func NewSingleConstStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SingleConstStmtContext { + var p = new(SingleConstStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_bool + p.RuleIndex = nevaParserRULE_singleConstStmt return p } -func (s *BoolContext) GetParser() antlr.Parser { return s.parser } -func (s *BoolContext) GetRuleContext() antlr.RuleContext { +func (s *SingleConstStmtContext) GetParser() antlr.Parser { return s.parser } + +func (s *SingleConstStmtContext) ConstDef() IConstDefContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConstDefContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IConstDefContext) +} + +func (s *SingleConstStmtContext) PUB_KW() antlr.TerminalNode { + return s.GetToken(nevaParserPUB_KW, 0) +} + +func (s *SingleConstStmtContext) GetRuleContext() antlr.RuleContext { return s } -func (s *BoolContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *SingleConstStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *BoolContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *SingleConstStmtContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterBool(s) + listenerT.EnterSingleConstStmt(s) } } -func (s *BoolContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *SingleConstStmtContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitBool(s) + listenerT.ExitSingleConstStmt(s) } } -func (p *nevaParser) Bool_() (localctx IBoolContext) { - localctx = NewBoolContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 84, nevaParserRULE_bool) +func (p *nevaParser) SingleConstStmt() (localctx ISingleConstStmtContext) { + localctx = NewSingleConstStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 86, nevaParserRULE_singleConstStmt) var _la int p.EnterOuterAlt(localctx, 1) - { - p.SetState(600) - _la = p.GetTokenStream().LA(1) + p.SetState(578) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) - if !(_la == nevaParserT__20 || _la == nevaParserT__21) { - p.GetErrorHandler().RecoverInline(p) - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() + if _la == nevaParserPUB_KW { + { + p.SetState(577) + p.Match(nevaParserPUB_KW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(580) + p.Match(nevaParserT__17) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } } + { + p.SetState(581) + p.ConstDef() + } errorExit: if p.HasError() { @@ -7979,79 +7877,1258 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// INilContext is an interface to support dynamic dispatch. -type INilContext interface { +// IGroupConstStmtContext is an interface to support dynamic dispatch. +type IGroupConstStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - // IsNilContext differentiates from other interfaces. - IsNilContext() + + // Getter signatures + AllNEWLINE() []antlr.TerminalNode + NEWLINE(i int) antlr.TerminalNode + AllConstDef() []IConstDefContext + ConstDef(i int) IConstDefContext + AllPUB_KW() []antlr.TerminalNode + PUB_KW(i int) antlr.TerminalNode + + // IsGroupConstStmtContext differentiates from other interfaces. + IsGroupConstStmtContext() } -type NilContext struct { +type GroupConstStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyNilContext() *NilContext { - var p = new(NilContext) +func NewEmptyGroupConstStmtContext() *GroupConstStmtContext { + var p = new(GroupConstStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_nil + p.RuleIndex = nevaParserRULE_groupConstStmt return p } -func InitEmptyNilContext(p *NilContext) { +func InitEmptyGroupConstStmtContext(p *GroupConstStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_nil + p.RuleIndex = nevaParserRULE_groupConstStmt } -func (*NilContext) IsNilContext() {} +func (*GroupConstStmtContext) IsGroupConstStmtContext() {} -func NewNilContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NilContext { - var p = new(NilContext) +func NewGroupConstStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupConstStmtContext { + var p = new(GroupConstStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_nil + p.RuleIndex = nevaParserRULE_groupConstStmt return p } -func (s *NilContext) GetParser() antlr.Parser { return s.parser } -func (s *NilContext) GetRuleContext() antlr.RuleContext { +func (s *GroupConstStmtContext) GetParser() antlr.Parser { return s.parser } + +func (s *GroupConstStmtContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} + +func (s *GroupConstStmtContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *GroupConstStmtContext) AllConstDef() []IConstDefContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IConstDefContext); ok { + len++ + } + } + + tst := make([]IConstDefContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IConstDefContext); ok { + tst[i] = t.(IConstDefContext) + i++ + } + } + + return tst +} + +func (s *GroupConstStmtContext) ConstDef(i int) IConstDefContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConstDefContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IConstDefContext) +} + +func (s *GroupConstStmtContext) AllPUB_KW() []antlr.TerminalNode { + return s.GetTokens(nevaParserPUB_KW) +} + +func (s *GroupConstStmtContext) PUB_KW(i int) antlr.TerminalNode { + return s.GetToken(nevaParserPUB_KW, i) +} + +func (s *GroupConstStmtContext) GetRuleContext() antlr.RuleContext { return s } -func (s *NilContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *GroupConstStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *NilContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *GroupConstStmtContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterNil(s) + listenerT.EnterGroupConstStmt(s) } } -func (s *NilContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *GroupConstStmtContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitNil(s) + listenerT.ExitGroupConstStmt(s) } } -func (p *nevaParser) Nil_() (localctx INilContext) { - localctx = NewNilContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 86, nevaParserRULE_nil) +func (p *nevaParser) GroupConstStmt() (localctx IGroupConstStmtContext) { + localctx = NewGroupConstStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 88, nevaParserRULE_groupConstStmt) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(602) - p.Match(nevaParserT__22) + p.SetState(583) + p.Match(nevaParserT__17) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(587) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(584) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(589) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(590) + p.Match(nevaParserT__5) if p.HasError() { // Recognition error - abort rule goto errorExit } } + p.SetState(594) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(591) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(596) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(603) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserPUB_KW || _la == nevaParserIDENTIFIER { + p.SetState(598) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == nevaParserPUB_KW { + { + p.SetState(597) + p.Match(nevaParserPUB_KW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + { + p.SetState(600) + p.ConstDef() + } + + p.SetState(605) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(606) + p.Match(nevaParserT__6) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IConstDefContext is an interface to support dynamic dispatch. +type IConstDefContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + IDENTIFIER() antlr.TerminalNode + TypeExpr() ITypeExprContext + ConstVal() IConstValContext + AllNEWLINE() []antlr.TerminalNode + NEWLINE(i int) antlr.TerminalNode + + // IsConstDefContext differentiates from other interfaces. + IsConstDefContext() +} + +type ConstDefContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyConstDefContext() *ConstDefContext { + var p = new(ConstDefContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_constDef + return p +} + +func InitEmptyConstDefContext(p *ConstDefContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_constDef +} + +func (*ConstDefContext) IsConstDefContext() {} + +func NewConstDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstDefContext { + var p = new(ConstDefContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = nevaParserRULE_constDef + + return p +} + +func (s *ConstDefContext) GetParser() antlr.Parser { return s.parser } + +func (s *ConstDefContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(nevaParserIDENTIFIER, 0) +} + +func (s *ConstDefContext) TypeExpr() ITypeExprContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITypeExprContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITypeExprContext) +} + +func (s *ConstDefContext) ConstVal() IConstValContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConstValContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IConstValContext) +} + +func (s *ConstDefContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} + +func (s *ConstDefContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *ConstDefContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConstDefContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ConstDefContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.EnterConstDef(s) + } +} + +func (s *ConstDefContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.ExitConstDef(s) + } +} + +func (p *nevaParser) ConstDef() (localctx IConstDefContext) { + localctx = NewConstDefContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 90, nevaParserRULE_constDef) + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(608) + p.Match(nevaParserIDENTIFIER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(609) + p.Match(nevaParserT__18) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(610) + p.TypeExpr() + } + { + p.SetState(611) + p.ConstVal() + } + p.SetState(615) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 72, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(612) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + p.SetState(617) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 72, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IConstValContext is an interface to support dynamic dispatch. +type IConstValContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Nil_() INilContext + Bool_() IBoolContext + INT() antlr.TerminalNode + FLOAT() antlr.TerminalNode + STRING() antlr.TerminalNode + ListLit() IListLitContext + StructLit() IStructLitContext + + // IsConstValContext differentiates from other interfaces. + IsConstValContext() +} + +type ConstValContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyConstValContext() *ConstValContext { + var p = new(ConstValContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_constVal + return p +} + +func InitEmptyConstValContext(p *ConstValContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_constVal +} + +func (*ConstValContext) IsConstValContext() {} + +func NewConstValContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstValContext { + var p = new(ConstValContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = nevaParserRULE_constVal + + return p +} + +func (s *ConstValContext) GetParser() antlr.Parser { return s.parser } + +func (s *ConstValContext) Nil_() INilContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INilContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(INilContext) +} + +func (s *ConstValContext) Bool_() IBoolContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBoolContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IBoolContext) +} + +func (s *ConstValContext) INT() antlr.TerminalNode { + return s.GetToken(nevaParserINT, 0) +} + +func (s *ConstValContext) FLOAT() antlr.TerminalNode { + return s.GetToken(nevaParserFLOAT, 0) +} + +func (s *ConstValContext) STRING() antlr.TerminalNode { + return s.GetToken(nevaParserSTRING, 0) +} + +func (s *ConstValContext) ListLit() IListLitContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IListLitContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IListLitContext) +} + +func (s *ConstValContext) StructLit() IStructLitContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStructLitContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStructLitContext) +} + +func (s *ConstValContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConstValContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ConstValContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.EnterConstVal(s) + } +} + +func (s *ConstValContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.ExitConstVal(s) + } +} + +func (p *nevaParser) ConstVal() (localctx IConstValContext) { + localctx = NewConstValContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 92, nevaParserRULE_constVal) + p.SetState(625) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case nevaParserT__21: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(618) + p.Nil_() + } + + case nevaParserT__19, nevaParserT__20: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(619) + p.Bool_() + } + + case nevaParserINT: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(620) + p.Match(nevaParserINT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case nevaParserFLOAT: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(621) + p.Match(nevaParserFLOAT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case nevaParserSTRING: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(622) + p.Match(nevaParserSTRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case nevaParserT__22: + p.EnterOuterAlt(localctx, 6) + { + p.SetState(623) + p.ListLit() + } + + case nevaParserT__5: + p.EnterOuterAlt(localctx, 7) + { + p.SetState(624) + p.StructLit() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IBoolContext is an interface to support dynamic dispatch. +type IBoolContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsBoolContext differentiates from other interfaces. + IsBoolContext() +} + +type BoolContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBoolContext() *BoolContext { + var p = new(BoolContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_bool + return p +} + +func InitEmptyBoolContext(p *BoolContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_bool +} + +func (*BoolContext) IsBoolContext() {} + +func NewBoolContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BoolContext { + var p = new(BoolContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = nevaParserRULE_bool + + return p +} + +func (s *BoolContext) GetParser() antlr.Parser { return s.parser } +func (s *BoolContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BoolContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *BoolContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.EnterBool(s) + } +} + +func (s *BoolContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.ExitBool(s) + } +} + +func (p *nevaParser) Bool_() (localctx IBoolContext) { + localctx = NewBoolContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 94, nevaParserRULE_bool) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(627) + _la = p.GetTokenStream().LA(1) + + if !(_la == nevaParserT__19 || _la == nevaParserT__20) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// INilContext is an interface to support dynamic dispatch. +type INilContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsNilContext differentiates from other interfaces. + IsNilContext() +} + +type NilContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyNilContext() *NilContext { + var p = new(NilContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_nil + return p +} + +func InitEmptyNilContext(p *NilContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_nil +} + +func (*NilContext) IsNilContext() {} + +func NewNilContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NilContext { + var p = new(NilContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = nevaParserRULE_nil + + return p +} + +func (s *NilContext) GetParser() antlr.Parser { return s.parser } +func (s *NilContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NilContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *NilContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.EnterNil(s) + } +} + +func (s *NilContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.ExitNil(s) + } +} + +func (p *nevaParser) Nil_() (localctx INilContext) { + localctx = NewNilContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 96, nevaParserRULE_nil) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(629) + p.Match(nevaParserT__21) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IListLitContext is an interface to support dynamic dispatch. +type IListLitContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllNEWLINE() []antlr.TerminalNode + NEWLINE(i int) antlr.TerminalNode + ListItems() IListItemsContext + + // IsListLitContext differentiates from other interfaces. + IsListLitContext() +} + +type ListLitContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyListLitContext() *ListLitContext { + var p = new(ListLitContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_listLit + return p +} + +func InitEmptyListLitContext(p *ListLitContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_listLit +} + +func (*ListLitContext) IsListLitContext() {} + +func NewListLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ListLitContext { + var p = new(ListLitContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = nevaParserRULE_listLit + + return p +} + +func (s *ListLitContext) GetParser() antlr.Parser { return s.parser } + +func (s *ListLitContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} + +func (s *ListLitContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *ListLitContext) ListItems() IListItemsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IListItemsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IListItemsContext) +} + +func (s *ListLitContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ListLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ListLitContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.EnterListLit(s) + } +} + +func (s *ListLitContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.ExitListLit(s) + } +} + +func (p *nevaParser) ListLit() (localctx IListLitContext) { + localctx = NewListLitContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 98, nevaParserRULE_listLit) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(631) + p.Match(nevaParserT__22) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(635) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(632) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(637) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + p.SetState(639) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&120274812992) != 0 { + { + p.SetState(638) + p.ListItems() + } + + } + { + p.SetState(641) + p.Match(nevaParserT__23) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IListItemsContext is an interface to support dynamic dispatch. +type IListItemsContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllConstVal() []IConstValContext + ConstVal(i int) IConstValContext + AllNEWLINE() []antlr.TerminalNode + NEWLINE(i int) antlr.TerminalNode + + // IsListItemsContext differentiates from other interfaces. + IsListItemsContext() +} + +type ListItemsContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyListItemsContext() *ListItemsContext { + var p = new(ListItemsContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_listItems + return p +} + +func InitEmptyListItemsContext(p *ListItemsContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = nevaParserRULE_listItems +} + +func (*ListItemsContext) IsListItemsContext() {} + +func NewListItemsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ListItemsContext { + var p = new(ListItemsContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = nevaParserRULE_listItems + + return p +} + +func (s *ListItemsContext) GetParser() antlr.Parser { return s.parser } + +func (s *ListItemsContext) AllConstVal() []IConstValContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IConstValContext); ok { + len++ + } + } + + tst := make([]IConstValContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IConstValContext); ok { + tst[i] = t.(IConstValContext) + i++ + } + } + + return tst +} + +func (s *ListItemsContext) ConstVal(i int) IConstValContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConstValContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IConstValContext) +} + +func (s *ListItemsContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} + +func (s *ListItemsContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *ListItemsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ListItemsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ListItemsContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.EnterListItems(s) + } +} + +func (s *ListItemsContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.ExitListItems(s) + } +} + +func (p *nevaParser) ListItems() (localctx IListItemsContext) { + localctx = NewListItemsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 100, nevaParserRULE_listItems) + var _la int + + p.SetState(664) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 79, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(643) + p.ConstVal() + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(644) + p.ConstVal() + } + p.SetState(661) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserT__2 { + { + p.SetState(645) + p.Match(nevaParserT__2) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(649) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(646) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(651) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + { + p.SetState(652) + p.ConstVal() + } + p.SetState(656) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == nevaParserNEWLINE { + { + p.SetState(653) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(658) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + p.SetState(663) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + case antlr.ATNInvalidAltNumber: + goto errorExit + } errorExit: if p.HasError() { @@ -8066,8 +9143,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IArrLitContext is an interface to support dynamic dispatch. -type IArrLitContext interface { +// IStructLitContext is an interface to support dynamic dispatch. +type IStructLitContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -8076,56 +9153,56 @@ type IArrLitContext interface { // Getter signatures AllNEWLINE() []antlr.TerminalNode NEWLINE(i int) antlr.TerminalNode - ListItems() IListItemsContext + StructValueFields() IStructValueFieldsContext - // IsArrLitContext differentiates from other interfaces. - IsArrLitContext() + // IsStructLitContext differentiates from other interfaces. + IsStructLitContext() } -type ArrLitContext struct { +type StructLitContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyArrLitContext() *ArrLitContext { - var p = new(ArrLitContext) +func NewEmptyStructLitContext() *StructLitContext { + var p = new(StructLitContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_arrLit + p.RuleIndex = nevaParserRULE_structLit return p } -func InitEmptyArrLitContext(p *ArrLitContext) { +func InitEmptyStructLitContext(p *StructLitContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_arrLit + p.RuleIndex = nevaParserRULE_structLit } -func (*ArrLitContext) IsArrLitContext() {} +func (*StructLitContext) IsStructLitContext() {} -func NewArrLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrLitContext { - var p = new(ArrLitContext) +func NewStructLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StructLitContext { + var p = new(StructLitContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_arrLit + p.RuleIndex = nevaParserRULE_structLit return p } -func (s *ArrLitContext) GetParser() antlr.Parser { return s.parser } +func (s *StructLitContext) GetParser() antlr.Parser { return s.parser } -func (s *ArrLitContext) AllNEWLINE() []antlr.TerminalNode { +func (s *StructLitContext) AllNEWLINE() []antlr.TerminalNode { return s.GetTokens(nevaParserNEWLINE) } -func (s *ArrLitContext) NEWLINE(i int) antlr.TerminalNode { +func (s *StructLitContext) NEWLINE(i int) antlr.TerminalNode { return s.GetToken(nevaParserNEWLINE, i) } -func (s *ArrLitContext) ListItems() IListItemsContext { +func (s *StructLitContext) StructValueFields() IStructValueFieldsContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IListItemsContext); ok { + if _, ok := ctx.(IStructValueFieldsContext); ok { t = ctx.(antlr.RuleContext) break } @@ -8135,44 +9212,44 @@ func (s *ArrLitContext) ListItems() IListItemsContext { return nil } - return t.(IListItemsContext) + return t.(IStructValueFieldsContext) } -func (s *ArrLitContext) GetRuleContext() antlr.RuleContext { +func (s *StructLitContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ArrLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *StructLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ArrLitContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *StructLitContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterArrLit(s) + listenerT.EnterStructLit(s) } } -func (s *ArrLitContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *StructLitContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitArrLit(s) + listenerT.ExitStructLit(s) } } -func (p *nevaParser) ArrLit() (localctx IArrLitContext) { - localctx = NewArrLitContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 88, nevaParserRULE_arrLit) +func (p *nevaParser) StructLit() (localctx IStructLitContext) { + localctx = NewStructLitContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 102, nevaParserRULE_structLit) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(604) - p.Match(nevaParserT__14) + p.SetState(666) + p.Match(nevaParserT__5) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(608) + p.SetState(670) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -8181,7 +9258,7 @@ func (p *nevaParser) ArrLit() (localctx IArrLitContext) { for _la == nevaParserNEWLINE { { - p.SetState(605) + p.SetState(667) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -8189,30 +9266,30 @@ func (p *nevaParser) ArrLit() (localctx IArrLitContext) { } } - p.SetState(610) + p.SetState(672) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(612) + p.SetState(674) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&60144255040) != 0 { + if _la == nevaParserIDENTIFIER { { - p.SetState(611) - p.ListItems() + p.SetState(673) + p.StructValueFields() } } { - p.SetState(614) - p.Match(nevaParserT__15) + p.SetState(676) + p.Match(nevaParserT__6) if p.HasError() { // Recognition error - abort rule goto errorExit @@ -8232,69 +9309,69 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IListItemsContext is an interface to support dynamic dispatch. -type IListItemsContext interface { +// IStructValueFieldsContext is an interface to support dynamic dispatch. +type IStructValueFieldsContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AllConstVal() []IConstValContext - ConstVal(i int) IConstValContext + AllStructValueField() []IStructValueFieldContext + StructValueField(i int) IStructValueFieldContext AllNEWLINE() []antlr.TerminalNode NEWLINE(i int) antlr.TerminalNode - // IsListItemsContext differentiates from other interfaces. - IsListItemsContext() + // IsStructValueFieldsContext differentiates from other interfaces. + IsStructValueFieldsContext() } -type ListItemsContext struct { +type StructValueFieldsContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyListItemsContext() *ListItemsContext { - var p = new(ListItemsContext) +func NewEmptyStructValueFieldsContext() *StructValueFieldsContext { + var p = new(StructValueFieldsContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_listItems + p.RuleIndex = nevaParserRULE_structValueFields return p } -func InitEmptyListItemsContext(p *ListItemsContext) { +func InitEmptyStructValueFieldsContext(p *StructValueFieldsContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_listItems + p.RuleIndex = nevaParserRULE_structValueFields } -func (*ListItemsContext) IsListItemsContext() {} +func (*StructValueFieldsContext) IsStructValueFieldsContext() {} -func NewListItemsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ListItemsContext { - var p = new(ListItemsContext) +func NewStructValueFieldsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StructValueFieldsContext { + var p = new(StructValueFieldsContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_listItems + p.RuleIndex = nevaParserRULE_structValueFields return p } -func (s *ListItemsContext) GetParser() antlr.Parser { return s.parser } +func (s *StructValueFieldsContext) GetParser() antlr.Parser { return s.parser } -func (s *ListItemsContext) AllConstVal() []IConstValContext { +func (s *StructValueFieldsContext) AllStructValueField() []IStructValueFieldContext { children := s.GetChildren() len := 0 for _, ctx := range children { - if _, ok := ctx.(IConstValContext); ok { + if _, ok := ctx.(IStructValueFieldContext); ok { len++ } } - tst := make([]IConstValContext, len) + tst := make([]IStructValueFieldContext, len) i := 0 for _, ctx := range children { - if t, ok := ctx.(IConstValContext); ok { - tst[i] = t.(IConstValContext) + if t, ok := ctx.(IStructValueFieldContext); ok { + tst[i] = t.(IStructValueFieldContext) i++ } } @@ -8302,11 +9379,11 @@ func (s *ListItemsContext) AllConstVal() []IConstValContext { return tst } -func (s *ListItemsContext) ConstVal(i int) IConstValContext { +func (s *StructValueFieldsContext) StructValueField(i int) IStructValueFieldContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IConstValContext); ok { + if _, ok := ctx.(IStructValueFieldContext); ok { if j == i { t = ctx.(antlr.RuleContext) break @@ -8319,79 +9396,69 @@ func (s *ListItemsContext) ConstVal(i int) IConstValContext { return nil } - return t.(IConstValContext) + return t.(IStructValueFieldContext) } -func (s *ListItemsContext) AllNEWLINE() []antlr.TerminalNode { +func (s *StructValueFieldsContext) AllNEWLINE() []antlr.TerminalNode { return s.GetTokens(nevaParserNEWLINE) } -func (s *ListItemsContext) NEWLINE(i int) antlr.TerminalNode { +func (s *StructValueFieldsContext) NEWLINE(i int) antlr.TerminalNode { return s.GetToken(nevaParserNEWLINE, i) } -func (s *ListItemsContext) GetRuleContext() antlr.RuleContext { +func (s *StructValueFieldsContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ListItemsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *StructValueFieldsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ListItemsContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *StructValueFieldsContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterListItems(s) + listenerT.EnterStructValueFields(s) } } -func (s *ListItemsContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *StructValueFieldsContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitListItems(s) + listenerT.ExitStructValueFields(s) } } -func (p *nevaParser) ListItems() (localctx IListItemsContext) { - localctx = NewListItemsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 90, nevaParserRULE_listItems) +func (p *nevaParser) StructValueFields() (localctx IStructValueFieldsContext) { + localctx = NewStructValueFieldsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 104, nevaParserRULE_structValueFields) var _la int - p.SetState(637) + var _alt int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(678) + p.StructValueField() + } + p.SetState(689) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 75, p.GetParserRuleContext()) { - case 1: - p.EnterOuterAlt(localctx, 1) - { - p.SetState(616) - p.ConstVal() - } - - case 2: - p.EnterOuterAlt(localctx, 2) - { - p.SetState(617) - p.ConstVal() - } - p.SetState(634) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserT__2 { + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 83, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { { - p.SetState(618) + p.SetState(679) p.Match(nevaParserT__2) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(622) + p.SetState(683) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -8400,7 +9467,7 @@ func (p *nevaParser) ListItems() (localctx IListItemsContext) { for _la == nevaParserNEWLINE { { - p.SetState(619) + p.SetState(680) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -8408,7 +9475,7 @@ func (p *nevaParser) ListItems() (localctx IListItemsContext) { } } - p.SetState(624) + p.SetState(685) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -8416,44 +9483,38 @@ func (p *nevaParser) ListItems() (localctx IListItemsContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(625) - p.ConstVal() - } - p.SetState(629) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + p.SetState(686) + p.StructValueField() } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(626) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(631) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } + } + p.SetState(691) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 83, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + p.SetState(693) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) - p.SetState(636) - p.GetErrorHandler().Sync(p) + if _la == nevaParserT__2 { + { + p.SetState(692) + p.Match(nevaParserT__2) if p.HasError() { + // Recognition error - abort rule goto errorExit } - _la = p.GetTokenStream().LA(1) } - case antlr.ATNInvalidAltNumber: - goto errorExit } errorExit: @@ -8469,66 +9530,63 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IStructLitContext is an interface to support dynamic dispatch. -type IStructLitContext interface { +// IStructValueFieldContext is an interface to support dynamic dispatch. +type IStructValueFieldContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures + IDENTIFIER() antlr.TerminalNode + ConstVal() IConstValContext AllNEWLINE() []antlr.TerminalNode NEWLINE(i int) antlr.TerminalNode - StructValueFields() IStructValueFieldsContext - // IsStructLitContext differentiates from other interfaces. - IsStructLitContext() + // IsStructValueFieldContext differentiates from other interfaces. + IsStructValueFieldContext() } -type StructLitContext struct { +type StructValueFieldContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyStructLitContext() *StructLitContext { - var p = new(StructLitContext) +func NewEmptyStructValueFieldContext() *StructValueFieldContext { + var p = new(StructValueFieldContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_structLit + p.RuleIndex = nevaParserRULE_structValueField return p } -func InitEmptyStructLitContext(p *StructLitContext) { +func InitEmptyStructValueFieldContext(p *StructValueFieldContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_structLit + p.RuleIndex = nevaParserRULE_structValueField } -func (*StructLitContext) IsStructLitContext() {} +func (*StructValueFieldContext) IsStructValueFieldContext() {} -func NewStructLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StructLitContext { - var p = new(StructLitContext) +func NewStructValueFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StructValueFieldContext { + var p = new(StructValueFieldContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_structLit + p.RuleIndex = nevaParserRULE_structValueField return p } -func (s *StructLitContext) GetParser() antlr.Parser { return s.parser } - -func (s *StructLitContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} +func (s *StructValueFieldContext) GetParser() antlr.Parser { return s.parser } -func (s *StructLitContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) +func (s *StructValueFieldContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(nevaParserIDENTIFIER, 0) } -func (s *StructLitContext) StructValueFields() IStructValueFieldsContext { +func (s *StructValueFieldContext) ConstVal() IConstValContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStructValueFieldsContext); ok { + if _, ok := ctx.(IConstValContext); ok { t = ctx.(antlr.RuleContext) break } @@ -8538,44 +9596,64 @@ func (s *StructLitContext) StructValueFields() IStructValueFieldsContext { return nil } - return t.(IStructValueFieldsContext) + return t.(IConstValContext) } -func (s *StructLitContext) GetRuleContext() antlr.RuleContext { +func (s *StructValueFieldContext) AllNEWLINE() []antlr.TerminalNode { + return s.GetTokens(nevaParserNEWLINE) +} + +func (s *StructValueFieldContext) NEWLINE(i int) antlr.TerminalNode { + return s.GetToken(nevaParserNEWLINE, i) +} + +func (s *StructValueFieldContext) GetRuleContext() antlr.RuleContext { return s } -func (s *StructLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *StructValueFieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *StructLitContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *StructValueFieldContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterStructLit(s) + listenerT.EnterStructValueField(s) } } -func (s *StructLitContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *StructValueFieldContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitStructLit(s) + listenerT.ExitStructValueField(s) } } -func (p *nevaParser) StructLit() (localctx IStructLitContext) { - localctx = NewStructLitContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 92, nevaParserRULE_structLit) +func (p *nevaParser) StructValueField() (localctx IStructValueFieldContext) { + localctx = NewStructValueFieldContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 106, nevaParserRULE_structValueField) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(639) - p.Match(nevaParserT__5) + p.SetState(695) + p.Match(nevaParserIDENTIFIER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(696) + p.Match(nevaParserT__24) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(643) + { + p.SetState(697) + p.ConstVal() + } + p.SetState(701) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -8584,7 +9662,7 @@ func (p *nevaParser) StructLit() (localctx IStructLitContext) { for _la == nevaParserNEWLINE { { - p.SetState(640) + p.SetState(698) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -8592,35 +9670,13 @@ func (p *nevaParser) StructLit() (localctx IStructLitContext) { } } - p.SetState(645) + p.SetState(703) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(647) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == nevaParserIDENTIFIER { - { - p.SetState(646) - p.StructValueFields() - } - - } - { - p.SetState(649) - p.Match(nevaParserT__6) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } errorExit: if p.HasError() { @@ -8635,86 +9691,75 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IStructValueFieldsContext is an interface to support dynamic dispatch. -type IStructValueFieldsContext interface { +// ICompStmtContext is an interface to support dynamic dispatch. +type ICompStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AllStructValueField() []IStructValueFieldContext - StructValueField(i int) IStructValueFieldContext - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode + SingleCompStmt() ISingleCompStmtContext + GroupCompStmt() IGroupCompStmtContext - // IsStructValueFieldsContext differentiates from other interfaces. - IsStructValueFieldsContext() + // IsCompStmtContext differentiates from other interfaces. + IsCompStmtContext() } -type StructValueFieldsContext struct { +type CompStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyStructValueFieldsContext() *StructValueFieldsContext { - var p = new(StructValueFieldsContext) +func NewEmptyCompStmtContext() *CompStmtContext { + var p = new(CompStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_structValueFields + p.RuleIndex = nevaParserRULE_compStmt return p } -func InitEmptyStructValueFieldsContext(p *StructValueFieldsContext) { +func InitEmptyCompStmtContext(p *CompStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_structValueFields + p.RuleIndex = nevaParserRULE_compStmt } -func (*StructValueFieldsContext) IsStructValueFieldsContext() {} +func (*CompStmtContext) IsCompStmtContext() {} -func NewStructValueFieldsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StructValueFieldsContext { - var p = new(StructValueFieldsContext) +func NewCompStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CompStmtContext { + var p = new(CompStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_structValueFields + p.RuleIndex = nevaParserRULE_compStmt return p } -func (s *StructValueFieldsContext) GetParser() antlr.Parser { return s.parser } +func (s *CompStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *StructValueFieldsContext) AllStructValueField() []IStructValueFieldContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IStructValueFieldContext); ok { - len++ +func (s *CompStmtContext) SingleCompStmt() ISingleCompStmtContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISingleCompStmtContext); ok { + t = ctx.(antlr.RuleContext) + break } } - tst := make([]IStructValueFieldContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IStructValueFieldContext); ok { - tst[i] = t.(IStructValueFieldContext) - i++ - } + if t == nil { + return nil } - return tst + return t.(ISingleCompStmtContext) } -func (s *StructValueFieldsContext) StructValueField(i int) IStructValueFieldContext { +func (s *CompStmtContext) GroupCompStmt() IGroupCompStmtContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStructValueFieldContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(IGroupCompStmtContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -8722,90 +9767,55 @@ func (s *StructValueFieldsContext) StructValueField(i int) IStructValueFieldCont return nil } - return t.(IStructValueFieldContext) -} - -func (s *StructValueFieldsContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} - -func (s *StructValueFieldsContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) + return t.(IGroupCompStmtContext) } -func (s *StructValueFieldsContext) GetRuleContext() antlr.RuleContext { +func (s *CompStmtContext) GetRuleContext() antlr.RuleContext { return s } -func (s *StructValueFieldsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *CompStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *StructValueFieldsContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *CompStmtContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterStructValueFields(s) + listenerT.EnterCompStmt(s) } } -func (s *StructValueFieldsContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *CompStmtContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitStructValueFields(s) + listenerT.ExitCompStmt(s) } } -func (p *nevaParser) StructValueFields() (localctx IStructValueFieldsContext) { - localctx = NewStructValueFieldsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 94, nevaParserRULE_structValueFields) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(651) - p.StructValueField() - } - p.SetState(661) +func (p *nevaParser) CompStmt() (localctx ICompStmtContext) { + localctx = NewCompStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 108, nevaParserRULE_compStmt) + p.SetState(706) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) - for _la == nevaParserIDENTIFIER || _la == nevaParserNEWLINE { - p.SetState(655) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 86, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(704) + p.SingleCompStmt() } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(652) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(657) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } + case 2: + p.EnterOuterAlt(localctx, 2) { - p.SetState(658) - p.StructValueField() + p.SetState(705) + p.GroupCompStmt() } - p.SetState(663) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) + case antlr.ATNInvalidAltNumber: + goto errorExit } errorExit: @@ -8821,63 +9831,58 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IStructValueFieldContext is an interface to support dynamic dispatch. -type IStructValueFieldContext interface { +// ISingleCompStmtContext is an interface to support dynamic dispatch. +type ISingleCompStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - IDENTIFIER() antlr.TerminalNode - ConstVal() IConstValContext - AllNEWLINE() []antlr.TerminalNode - NEWLINE(i int) antlr.TerminalNode + CompDef() ICompDefContext + CompilerDirectives() ICompilerDirectivesContext + PUB_KW() antlr.TerminalNode - // IsStructValueFieldContext differentiates from other interfaces. - IsStructValueFieldContext() + // IsSingleCompStmtContext differentiates from other interfaces. + IsSingleCompStmtContext() } -type StructValueFieldContext struct { +type SingleCompStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyStructValueFieldContext() *StructValueFieldContext { - var p = new(StructValueFieldContext) +func NewEmptySingleCompStmtContext() *SingleCompStmtContext { + var p = new(SingleCompStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_structValueField + p.RuleIndex = nevaParserRULE_singleCompStmt return p } -func InitEmptyStructValueFieldContext(p *StructValueFieldContext) { +func InitEmptySingleCompStmtContext(p *SingleCompStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_structValueField + p.RuleIndex = nevaParserRULE_singleCompStmt } -func (*StructValueFieldContext) IsStructValueFieldContext() {} +func (*SingleCompStmtContext) IsSingleCompStmtContext() {} -func NewStructValueFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StructValueFieldContext { - var p = new(StructValueFieldContext) +func NewSingleCompStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SingleCompStmtContext { + var p = new(SingleCompStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_structValueField + p.RuleIndex = nevaParserRULE_singleCompStmt return p } -func (s *StructValueFieldContext) GetParser() antlr.Parser { return s.parser } - -func (s *StructValueFieldContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(nevaParserIDENTIFIER, 0) -} +func (s *SingleCompStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *StructValueFieldContext) ConstVal() IConstValContext { +func (s *SingleCompStmtContext) CompDef() ICompDefContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IConstValContext); ok { + if _, ok := ctx.(ICompDefContext); ok { t = ctx.(antlr.RuleContext) break } @@ -8887,94 +9892,99 @@ func (s *StructValueFieldContext) ConstVal() IConstValContext { return nil } - return t.(IConstValContext) -} - -func (s *StructValueFieldContext) AllNEWLINE() []antlr.TerminalNode { - return s.GetTokens(nevaParserNEWLINE) -} - -func (s *StructValueFieldContext) NEWLINE(i int) antlr.TerminalNode { - return s.GetToken(nevaParserNEWLINE, i) -} - -func (s *StructValueFieldContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *StructValueFieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) + return t.(ICompDefContext) } -func (s *StructValueFieldContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterStructValueField(s) +func (s *SingleCompStmtContext) CompilerDirectives() ICompilerDirectivesContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICompilerDirectivesContext); ok { + t = ctx.(antlr.RuleContext) + break + } } -} -func (s *StructValueFieldContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitStructValueField(s) + if t == nil { + return nil } -} -func (p *nevaParser) StructValueField() (localctx IStructValueFieldContext) { - localctx = NewStructValueFieldContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 96, nevaParserRULE_structValueField) - var _alt int + return t.(ICompilerDirectivesContext) +} - p.EnterOuterAlt(localctx, 1) - { - p.SetState(664) - p.Match(nevaParserIDENTIFIER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(665) - p.Match(nevaParserT__23) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } +func (s *SingleCompStmtContext) PUB_KW() antlr.TerminalNode { + return s.GetToken(nevaParserPUB_KW, 0) +} + +func (s *SingleCompStmtContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SingleCompStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SingleCompStmtContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.EnterSingleCompStmt(s) } - { - p.SetState(666) - p.ConstVal() +} + +func (s *SingleCompStmtContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(nevaListener); ok { + listenerT.ExitSingleCompStmt(s) } - p.SetState(670) +} + +func (p *nevaParser) SingleCompStmt() (localctx ISingleCompStmtContext) { + localctx = NewSingleCompStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 110, nevaParserRULE_singleCompStmt) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(709) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 80, p.GetParserRuleContext()) + _la = p.GetTokenStream().LA(1) + + if _la == nevaParserT__0 { + { + p.SetState(708) + p.CompilerDirectives() + } + + } + p.SetState(712) + p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - { - p.SetState(667) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } + _la = p.GetTokenStream().LA(1) + if _la == nevaParserPUB_KW { + { + p.SetState(711) + p.Match(nevaParserPUB_KW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - p.SetState(672) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 80, p.GetParserRuleContext()) + + } + { + p.SetState(714) + p.Match(nevaParserT__25) if p.HasError() { + // Recognition error - abort rule goto errorExit } } + { + p.SetState(715) + p.CompDef() + } errorExit: if p.HasError() { @@ -8989,8 +9999,8 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ICompStmtContext is an interface to support dynamic dispatch. -type ICompStmtContext interface { +// IGroupCompStmtContext is an interface to support dynamic dispatch. +type IGroupCompStmtContext interface { antlr.ParserRuleContext // GetParser returns the parser. @@ -9001,52 +10011,56 @@ type ICompStmtContext interface { NEWLINE(i int) antlr.TerminalNode AllCompDef() []ICompDefContext CompDef(i int) ICompDefContext + AllCompilerDirectives() []ICompilerDirectivesContext + CompilerDirectives(i int) ICompilerDirectivesContext + AllPUB_KW() []antlr.TerminalNode + PUB_KW(i int) antlr.TerminalNode - // IsCompStmtContext differentiates from other interfaces. - IsCompStmtContext() + // IsGroupCompStmtContext differentiates from other interfaces. + IsGroupCompStmtContext() } -type CompStmtContext struct { +type GroupCompStmtContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyCompStmtContext() *CompStmtContext { - var p = new(CompStmtContext) +func NewEmptyGroupCompStmtContext() *GroupCompStmtContext { + var p = new(GroupCompStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_compStmt + p.RuleIndex = nevaParserRULE_groupCompStmt return p } -func InitEmptyCompStmtContext(p *CompStmtContext) { +func InitEmptyGroupCompStmtContext(p *GroupCompStmtContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = nevaParserRULE_compStmt + p.RuleIndex = nevaParserRULE_groupCompStmt } -func (*CompStmtContext) IsCompStmtContext() {} +func (*GroupCompStmtContext) IsGroupCompStmtContext() {} -func NewCompStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CompStmtContext { - var p = new(CompStmtContext) +func NewGroupCompStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GroupCompStmtContext { + var p = new(GroupCompStmtContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = nevaParserRULE_compStmt + p.RuleIndex = nevaParserRULE_groupCompStmt return p } -func (s *CompStmtContext) GetParser() antlr.Parser { return s.parser } +func (s *GroupCompStmtContext) GetParser() antlr.Parser { return s.parser } -func (s *CompStmtContext) AllNEWLINE() []antlr.TerminalNode { +func (s *GroupCompStmtContext) AllNEWLINE() []antlr.TerminalNode { return s.GetTokens(nevaParserNEWLINE) } -func (s *CompStmtContext) NEWLINE(i int) antlr.TerminalNode { +func (s *GroupCompStmtContext) NEWLINE(i int) antlr.TerminalNode { return s.GetToken(nevaParserNEWLINE, i) } -func (s *CompStmtContext) AllCompDef() []ICompDefContext { +func (s *GroupCompStmtContext) AllCompDef() []ICompDefContext { children := s.GetChildren() len := 0 for _, ctx := range children { @@ -9067,7 +10081,7 @@ func (s *CompStmtContext) AllCompDef() []ICompDefContext { return tst } -func (s *CompStmtContext) CompDef(i int) ICompDefContext { +func (s *GroupCompStmtContext) CompDef(i int) ICompDefContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { @@ -9087,41 +10101,90 @@ func (s *CompStmtContext) CompDef(i int) ICompDefContext { return t.(ICompDefContext) } -func (s *CompStmtContext) GetRuleContext() antlr.RuleContext { +func (s *GroupCompStmtContext) AllCompilerDirectives() []ICompilerDirectivesContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ICompilerDirectivesContext); ok { + len++ + } + } + + tst := make([]ICompilerDirectivesContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ICompilerDirectivesContext); ok { + tst[i] = t.(ICompilerDirectivesContext) + i++ + } + } + + return tst +} + +func (s *GroupCompStmtContext) CompilerDirectives(i int) ICompilerDirectivesContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICompilerDirectivesContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(ICompilerDirectivesContext) +} + +func (s *GroupCompStmtContext) AllPUB_KW() []antlr.TerminalNode { + return s.GetTokens(nevaParserPUB_KW) +} + +func (s *GroupCompStmtContext) PUB_KW(i int) antlr.TerminalNode { + return s.GetToken(nevaParserPUB_KW, i) +} + +func (s *GroupCompStmtContext) GetRuleContext() antlr.RuleContext { return s } -func (s *CompStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *GroupCompStmtContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *CompStmtContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *GroupCompStmtContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.EnterCompStmt(s) + listenerT.EnterGroupCompStmt(s) } } -func (s *CompStmtContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *GroupCompStmtContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(nevaListener); ok { - listenerT.ExitCompStmt(s) + listenerT.ExitGroupCompStmt(s) } } -func (p *nevaParser) CompStmt() (localctx ICompStmtContext) { - localctx = NewCompStmtContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 98, nevaParserRULE_compStmt) +func (p *nevaParser) GroupCompStmt() (localctx IGroupCompStmtContext) { + localctx = NewGroupCompStmtContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 112, nevaParserRULE_groupCompStmt) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(673) - p.Match(nevaParserT__24) + p.SetState(717) + p.Match(nevaParserT__25) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(677) + p.SetState(721) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9130,7 +10193,7 @@ func (p *nevaParser) CompStmt() (localctx ICompStmtContext) { for _la == nevaParserNEWLINE { { - p.SetState(674) + p.SetState(718) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -9138,7 +10201,7 @@ func (p *nevaParser) CompStmt() (localctx ICompStmtContext) { } } - p.SetState(679) + p.SetState(723) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9146,14 +10209,14 @@ func (p *nevaParser) CompStmt() (localctx ICompStmtContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(680) + p.SetState(724) p.Match(nevaParserT__5) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(684) + p.SetState(728) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9162,7 +10225,7 @@ func (p *nevaParser) CompStmt() (localctx ICompStmtContext) { for _la == nevaParserNEWLINE { { - p.SetState(681) + p.SetState(725) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -9170,27 +10233,59 @@ func (p *nevaParser) CompStmt() (localctx ICompStmtContext) { } } - p.SetState(686) + p.SetState(730) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(690) + p.SetState(740) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&6442450946) != 0 { + for (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&12884901890) != 0 { + p.SetState(732) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == nevaParserT__0 { + { + p.SetState(731) + p.CompilerDirectives() + } + + } + p.SetState(735) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == nevaParserPUB_KW { + { + p.SetState(734) + p.Match(nevaParserPUB_KW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } { - p.SetState(687) + p.SetState(737) p.CompDef() } - p.SetState(692) + p.SetState(742) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9198,7 +10293,7 @@ func (p *nevaParser) CompStmt() (localctx ICompStmtContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(693) + p.SetState(743) p.Match(nevaParserT__6) if p.HasError() { // Recognition error - abort rule @@ -9228,7 +10323,6 @@ type ICompDefContext interface { // Getter signatures InterfaceDef() IInterfaceDefContext - CompilerDirectives() ICompilerDirectivesContext CompBody() ICompBodyContext AllNEWLINE() []antlr.TerminalNode NEWLINE(i int) antlr.TerminalNode @@ -9285,22 +10379,6 @@ func (s *CompDefContext) InterfaceDef() IInterfaceDefContext { return t.(IInterfaceDefContext) } -func (s *CompDefContext) CompilerDirectives() ICompilerDirectivesContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ICompilerDirectivesContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(ICompilerDirectivesContext) -} - func (s *CompDefContext) CompBody() ICompBodyContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { @@ -9347,29 +10425,17 @@ func (s *CompDefContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) CompDef() (localctx ICompDefContext) { localctx = NewCompDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 100, nevaParserRULE_compDef) + p.EnterRule(localctx, 114, nevaParserRULE_compDef) var _la int - p.EnterOuterAlt(localctx, 1) - p.SetState(696) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if _la == nevaParserT__0 { - { - p.SetState(695) - p.CompilerDirectives() - } + var _alt int - } + p.EnterOuterAlt(localctx, 1) { - p.SetState(698) + p.SetState(745) p.InterfaceDef() } - p.SetState(700) + p.SetState(747) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9378,34 +10444,41 @@ func (p *nevaParser) CompDef() (localctx ICompDefContext) { if _la == nevaParserT__5 { { - p.SetState(699) + p.SetState(746) p.CompBody() } } - p.SetState(705) + p.SetState(752) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) - - for _la == nevaParserNEWLINE { - { - p.SetState(702) - p.Match(nevaParserNEWLINE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 95, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(749) + p.Match(nevaParserNEWLINE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - } - p.SetState(707) + } + p.SetState(754) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 95, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } } errorExit: @@ -9532,19 +10605,19 @@ func (s *CompBodyContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) CompBody() (localctx ICompBodyContext) { localctx = NewCompBodyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 102, nevaParserRULE_compBody) + p.EnterRule(localctx, 116, nevaParserRULE_compBody) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(708) + p.SetState(755) p.Match(nevaParserT__5) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(712) + p.SetState(759) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9553,7 +10626,7 @@ func (p *nevaParser) CompBody() (localctx ICompBodyContext) { for _la == nevaParserNEWLINE { { - p.SetState(709) + p.SetState(756) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -9561,26 +10634,26 @@ func (p *nevaParser) CompBody() (localctx ICompBodyContext) { } } - p.SetState(714) + p.SetState(761) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(722) + p.SetState(769) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == nevaParserT__25 { + if _la == nevaParserT__26 { { - p.SetState(715) + p.SetState(762) p.CompNodesDef() } - p.SetState(719) + p.SetState(766) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9589,7 +10662,7 @@ func (p *nevaParser) CompBody() (localctx ICompBodyContext) { for _la == nevaParserNEWLINE { { - p.SetState(716) + p.SetState(763) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -9597,7 +10670,7 @@ func (p *nevaParser) CompBody() (localctx ICompBodyContext) { } } - p.SetState(721) + p.SetState(768) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9606,19 +10679,19 @@ func (p *nevaParser) CompBody() (localctx ICompBodyContext) { } } - p.SetState(731) + p.SetState(778) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == nevaParserT__26 { + if _la == nevaParserT__27 { { - p.SetState(724) + p.SetState(771) p.CompNetDef() } - p.SetState(728) + p.SetState(775) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9627,7 +10700,7 @@ func (p *nevaParser) CompBody() (localctx ICompBodyContext) { for _la == nevaParserNEWLINE { { - p.SetState(725) + p.SetState(772) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -9635,7 +10708,7 @@ func (p *nevaParser) CompBody() (localctx ICompBodyContext) { } } - p.SetState(730) + p.SetState(777) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9645,7 +10718,7 @@ func (p *nevaParser) CompBody() (localctx ICompBodyContext) { } { - p.SetState(733) + p.SetState(780) p.Match(nevaParserT__6) if p.HasError() { // Recognition error - abort rule @@ -9760,19 +10833,19 @@ func (s *CompNodesDefContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) CompNodesDef() (localctx ICompNodesDefContext) { localctx = NewCompNodesDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 104, nevaParserRULE_compNodesDef) + p.EnterRule(localctx, 118, nevaParserRULE_compNodesDef) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(735) - p.Match(nevaParserT__25) + p.SetState(782) + p.Match(nevaParserT__26) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(739) + p.SetState(786) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9781,7 +10854,7 @@ func (p *nevaParser) CompNodesDef() (localctx ICompNodesDefContext) { for _la == nevaParserNEWLINE { { - p.SetState(736) + p.SetState(783) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -9789,7 +10862,7 @@ func (p *nevaParser) CompNodesDef() (localctx ICompNodesDefContext) { } } - p.SetState(741) + p.SetState(788) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9797,7 +10870,7 @@ func (p *nevaParser) CompNodesDef() (localctx ICompNodesDefContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(742) + p.SetState(789) p.CompNodesDefBody() } @@ -9934,19 +11007,19 @@ func (s *CompNodesDefBodyContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) CompNodesDefBody() (localctx ICompNodesDefBodyContext) { localctx = NewCompNodesDefBodyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 106, nevaParserRULE_compNodesDefBody) + p.EnterRule(localctx, 120, nevaParserRULE_compNodesDefBody) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(744) + p.SetState(791) p.Match(nevaParserT__5) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(748) + p.SetState(795) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9955,7 +11028,7 @@ func (p *nevaParser) CompNodesDefBody() (localctx ICompNodesDefBodyContext) { for _la == nevaParserNEWLINE { { - p.SetState(745) + p.SetState(792) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -9963,14 +11036,14 @@ func (p *nevaParser) CompNodesDefBody() (localctx ICompNodesDefBodyContext) { } } - p.SetState(750) + p.SetState(797) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) } - p.SetState(760) + p.SetState(807) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9979,10 +11052,10 @@ func (p *nevaParser) CompNodesDefBody() (localctx ICompNodesDefBodyContext) { for _la == nevaParserT__0 || _la == nevaParserIDENTIFIER { { - p.SetState(751) + p.SetState(798) p.CompNodeDef() } - p.SetState(755) + p.SetState(802) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -9991,7 +11064,7 @@ func (p *nevaParser) CompNodesDefBody() (localctx ICompNodesDefBodyContext) { for _la == nevaParserNEWLINE { { - p.SetState(752) + p.SetState(799) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -9999,7 +11072,7 @@ func (p *nevaParser) CompNodesDefBody() (localctx ICompNodesDefBodyContext) { } } - p.SetState(757) + p.SetState(804) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10007,7 +11080,7 @@ func (p *nevaParser) CompNodesDefBody() (localctx ICompNodesDefBodyContext) { _la = p.GetTokenStream().LA(1) } - p.SetState(762) + p.SetState(809) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10015,7 +11088,7 @@ func (p *nevaParser) CompNodesDefBody() (localctx ICompNodesDefBodyContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(763) + p.SetState(810) p.Match(nevaParserT__6) if p.HasError() { // Recognition error - abort rule @@ -10142,11 +11215,11 @@ func (s *CompNodeDefContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) CompNodeDef() (localctx ICompNodeDefContext) { localctx = NewCompNodeDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 108, nevaParserRULE_compNodeDef) + p.EnterRule(localctx, 122, nevaParserRULE_compNodeDef) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(766) + p.SetState(813) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10155,13 +11228,13 @@ func (p *nevaParser) CompNodeDef() (localctx ICompNodeDefContext) { if _la == nevaParserT__0 { { - p.SetState(765) + p.SetState(812) p.CompilerDirectives() } } { - p.SetState(768) + p.SetState(815) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -10169,7 +11242,7 @@ func (p *nevaParser) CompNodeDef() (localctx ICompNodeDefContext) { } } { - p.SetState(769) + p.SetState(816) p.NodeInst() } @@ -10314,29 +11387,29 @@ func (s *NodeInstContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) NodeInst() (localctx INodeInstContext) { localctx = NewNodeInstContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 110, nevaParserRULE_nodeInst) + p.EnterRule(localctx, 124, nevaParserRULE_nodeInst) var _la int var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(771) + p.SetState(818) p.EntityRef() } - p.SetState(775) + p.SetState(822) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 97, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 106, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(772) + p.SetState(819) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -10345,17 +11418,17 @@ func (p *nevaParser) NodeInst() (localctx INodeInstContext) { } } - p.SetState(777) + p.SetState(824) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 97, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 106, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } - p.SetState(779) + p.SetState(826) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10364,24 +11437,24 @@ func (p *nevaParser) NodeInst() (localctx INodeInstContext) { if _la == nevaParserT__11 { { - p.SetState(778) + p.SetState(825) p.TypeArgs() } } - p.SetState(784) + p.SetState(831) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 99, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 108, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(781) + p.SetState(828) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -10390,17 +11463,17 @@ func (p *nevaParser) NodeInst() (localctx INodeInstContext) { } } - p.SetState(786) + p.SetState(833) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 99, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 108, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } - p.SetState(788) + p.SetState(835) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10409,7 +11482,7 @@ func (p *nevaParser) NodeInst() (localctx INodeInstContext) { if _la == nevaParserT__5 { { - p.SetState(787) + p.SetState(834) p.NodeDIArgs() } @@ -10512,10 +11585,10 @@ func (s *NodeDIArgsContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) NodeDIArgs() (localctx INodeDIArgsContext) { localctx = NewNodeDIArgsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 112, nevaParserRULE_nodeDIArgs) + p.EnterRule(localctx, 126, nevaParserRULE_nodeDIArgs) p.EnterOuterAlt(localctx, 1) { - p.SetState(790) + p.SetState(837) p.CompNodesDefBody() } @@ -10626,21 +11699,21 @@ func (s *CompNetDefContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) CompNetDef() (localctx ICompNetDefContext) { localctx = NewCompNetDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 114, nevaParserRULE_compNetDef) + p.EnterRule(localctx, 128, nevaParserRULE_compNetDef) var _la int var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(792) - p.Match(nevaParserT__26) + p.SetState(839) + p.Match(nevaParserT__27) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(796) + p.SetState(843) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10649,7 +11722,7 @@ func (p *nevaParser) CompNetDef() (localctx ICompNetDefContext) { for _la == nevaParserNEWLINE { { - p.SetState(793) + p.SetState(840) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -10657,7 +11730,7 @@ func (p *nevaParser) CompNetDef() (localctx ICompNetDefContext) { } } - p.SetState(798) + p.SetState(845) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10665,26 +11738,26 @@ func (p *nevaParser) CompNetDef() (localctx ICompNetDefContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(799) + p.SetState(846) p.Match(nevaParserT__5) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(803) + p.SetState(850) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 102, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 111, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(800) + p.SetState(847) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -10693,31 +11766,31 @@ func (p *nevaParser) CompNetDef() (localctx ICompNetDefContext) { } } - p.SetState(805) + p.SetState(852) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 102, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 111, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } - p.SetState(807) + p.SetState(854) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == nevaParserT__28 || _la == nevaParserIDENTIFIER { + if _la == nevaParserT__29 || _la == nevaParserIDENTIFIER { { - p.SetState(806) + p.SetState(853) p.ConnDefList() } } - p.SetState(812) + p.SetState(859) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10726,7 +11799,7 @@ func (p *nevaParser) CompNetDef() (localctx ICompNetDefContext) { for _la == nevaParserNEWLINE { { - p.SetState(809) + p.SetState(856) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -10734,7 +11807,7 @@ func (p *nevaParser) CompNetDef() (localctx ICompNetDefContext) { } } - p.SetState(814) + p.SetState(861) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10742,7 +11815,7 @@ func (p *nevaParser) CompNetDef() (localctx ICompNetDefContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(815) + p.SetState(862) p.Match(nevaParserT__6) if p.HasError() { // Recognition error - abort rule @@ -10883,28 +11956,28 @@ func (s *ConnDefListContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) ConnDefList() (localctx IConnDefListContext) { localctx = NewConnDefListContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 116, nevaParserRULE_connDefList) + p.EnterRule(localctx, 130, nevaParserRULE_connDefList) var _la int var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(817) + p.SetState(864) p.ConnDef() } - p.SetState(827) + p.SetState(874) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 106, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 115, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { - p.SetState(821) + p.SetState(868) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10913,7 +11986,7 @@ func (p *nevaParser) ConnDefList() (localctx IConnDefListContext) { for _la == nevaParserNEWLINE { { - p.SetState(818) + p.SetState(865) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -10921,7 +11994,7 @@ func (p *nevaParser) ConnDefList() (localctx IConnDefListContext) { } } - p.SetState(823) + p.SetState(870) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -10929,17 +12002,17 @@ func (p *nevaParser) ConnDefList() (localctx IConnDefListContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(824) + p.SetState(871) p.ConnDef() } } - p.SetState(829) + p.SetState(876) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 106, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 115, p.GetParserRuleContext()) if p.HasError() { goto errorExit } @@ -11076,21 +12149,21 @@ func (s *ConnDefContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) ConnDef() (localctx IConnDefContext) { localctx = NewConnDefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 118, nevaParserRULE_connDef) + p.EnterRule(localctx, 132, nevaParserRULE_connDef) p.EnterOuterAlt(localctx, 1) { - p.SetState(830) + p.SetState(877) p.SenderSide() } { - p.SetState(831) - p.Match(nevaParserT__27) + p.SetState(878) + p.Match(nevaParserT__28) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(834) + p.SetState(881) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -11099,13 +12172,13 @@ func (p *nevaParser) ConnDef() (localctx IConnDefContext) { switch p.GetTokenStream().LA(1) { case nevaParserT__1, nevaParserIDENTIFIER: { - p.SetState(832) + p.SetState(879) p.ReceiverSide() } - case nevaParserT__14: + case nevaParserT__22: { - p.SetState(833) + p.SetState(880) p.MultipleReceiverSide() } @@ -11245,11 +12318,11 @@ func (s *SenderSideContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) SenderSide() (localctx ISenderSideContext) { localctx = NewSenderSideContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 120, nevaParserRULE_senderSide) + p.EnterRule(localctx, 134, nevaParserRULE_senderSide) var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(838) + p.SetState(885) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -11258,13 +12331,13 @@ func (p *nevaParser) SenderSide() (localctx ISenderSideContext) { switch p.GetTokenStream().LA(1) { case nevaParserIDENTIFIER: { - p.SetState(836) + p.SetState(883) p.PortAddr() } - case nevaParserT__28: + case nevaParserT__29: { - p.SetState(837) + p.SetState(884) p.SenderConstRef() } @@ -11272,7 +12345,7 @@ func (p *nevaParser) SenderSide() (localctx ISenderSideContext) { p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) goto errorExit } - p.SetState(841) + p.SetState(888) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -11281,7 +12354,7 @@ func (p *nevaParser) SenderSide() (localctx ISenderSideContext) { if _la == nevaParserT__9 { { - p.SetState(840) + p.SetState(887) p.StructSelectors() } @@ -11401,8 +12474,8 @@ func (s *ReceiverSideContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) ReceiverSide() (localctx IReceiverSideContext) { localctx = NewReceiverSideContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 122, nevaParserRULE_receiverSide) - p.SetState(845) + p.EnterRule(localctx, 136, nevaParserRULE_receiverSide) + p.SetState(892) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -11412,14 +12485,14 @@ func (p *nevaParser) ReceiverSide() (localctx IReceiverSideContext) { case nevaParserIDENTIFIER: p.EnterOuterAlt(localctx, 1) { - p.SetState(843) + p.SetState(890) p.PortAddr() } case nevaParserT__1: p.EnterOuterAlt(localctx, 2) { - p.SetState(844) + p.SetState(891) p.ThenConnExpr() } @@ -11561,21 +12634,21 @@ func (s *ThenConnExprContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) ThenConnExpr() (localctx IThenConnExprContext) { localctx = NewThenConnExprContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 124, nevaParserRULE_thenConnExpr) + p.EnterRule(localctx, 138, nevaParserRULE_thenConnExpr) var _la int var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(847) + p.SetState(894) p.Match(nevaParserT__1) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(851) + p.SetState(898) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -11584,7 +12657,7 @@ func (p *nevaParser) ThenConnExpr() (localctx IThenConnExprContext) { for _la == nevaParserNEWLINE { { - p.SetState(848) + p.SetState(895) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -11592,7 +12665,7 @@ func (p *nevaParser) ThenConnExpr() (localctx IThenConnExprContext) { } } - p.SetState(853) + p.SetState(900) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -11600,22 +12673,22 @@ func (p *nevaParser) ThenConnExpr() (localctx IThenConnExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(854) + p.SetState(901) p.ConnDef() } - p.SetState(859) + p.SetState(906) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 112, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 121, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(855) + p.SetState(902) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -11623,22 +12696,22 @@ func (p *nevaParser) ThenConnExpr() (localctx IThenConnExprContext) { } } { - p.SetState(856) + p.SetState(903) p.ConnDef() } } - p.SetState(861) + p.SetState(908) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 112, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 121, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } - p.SetState(865) + p.SetState(912) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -11647,7 +12720,7 @@ func (p *nevaParser) ThenConnExpr() (localctx IThenConnExprContext) { for _la == nevaParserNEWLINE { { - p.SetState(862) + p.SetState(909) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -11655,7 +12728,7 @@ func (p *nevaParser) ThenConnExpr() (localctx IThenConnExprContext) { } } - p.SetState(867) + p.SetState(914) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -11663,7 +12736,7 @@ func (p *nevaParser) ThenConnExpr() (localctx IThenConnExprContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(868) + p.SetState(915) p.Match(nevaParserT__3) if p.HasError() { // Recognition error - abort rule @@ -11768,18 +12841,18 @@ func (s *SenderConstRefContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) SenderConstRef() (localctx ISenderConstRefContext) { localctx = NewSenderConstRefContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 126, nevaParserRULE_senderConstRef) + p.EnterRule(localctx, 140, nevaParserRULE_senderConstRef) p.EnterOuterAlt(localctx, 1) { - p.SetState(870) - p.Match(nevaParserT__28) + p.SetState(917) + p.Match(nevaParserT__29) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(871) + p.SetState(918) p.EntityRef() } @@ -11914,36 +12987,36 @@ func (s *PortAddrContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) PortAddr() (localctx IPortAddrContext) { localctx = NewPortAddrContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 128, nevaParserRULE_portAddr) + p.EnterRule(localctx, 142, nevaParserRULE_portAddr) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(873) + p.SetState(920) p.PortAddrNode() } { - p.SetState(874) - p.Match(nevaParserT__23) + p.SetState(921) + p.Match(nevaParserT__24) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(875) + p.SetState(922) p.PortAddrPort() } - p.SetState(877) + p.SetState(924) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == nevaParserT__14 { + if _la == nevaParserT__22 { { - p.SetState(876) + p.SetState(923) p.PortAddrIdx() } @@ -12034,10 +13107,10 @@ func (s *PortAddrNodeContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) PortAddrNode() (localctx IPortAddrNodeContext) { localctx = NewPortAddrNodeContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 130, nevaParserRULE_portAddrNode) + p.EnterRule(localctx, 144, nevaParserRULE_portAddrNode) p.EnterOuterAlt(localctx, 1) { - p.SetState(879) + p.SetState(926) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -12130,10 +13203,10 @@ func (s *PortAddrPortContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) PortAddrPort() (localctx IPortAddrPortContext) { localctx = NewPortAddrPortContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 132, nevaParserRULE_portAddrPort) + p.EnterRule(localctx, 146, nevaParserRULE_portAddrPort) p.EnterOuterAlt(localctx, 1) { - p.SetState(881) + p.SetState(928) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -12226,18 +13299,18 @@ func (s *PortAddrIdxContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) PortAddrIdx() (localctx IPortAddrIdxContext) { localctx = NewPortAddrIdxContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 134, nevaParserRULE_portAddrIdx) + p.EnterRule(localctx, 148, nevaParserRULE_portAddrIdx) p.EnterOuterAlt(localctx, 1) { - p.SetState(883) - p.Match(nevaParserT__14) + p.SetState(930) + p.Match(nevaParserT__22) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(884) + p.SetState(931) p.Match(nevaParserINT) if p.HasError() { // Recognition error - abort rule @@ -12245,8 +13318,8 @@ func (p *nevaParser) PortAddrIdx() (localctx IPortAddrIdxContext) { } } { - p.SetState(885) - p.Match(nevaParserT__15) + p.SetState(932) + p.Match(nevaParserT__23) if p.HasError() { // Recognition error - abort rule goto errorExit @@ -12343,12 +13416,12 @@ func (s *StructSelectorsContext) ExitRule(listener antlr.ParseTreeListener) { func (p *nevaParser) StructSelectors() (localctx IStructSelectorsContext) { localctx = NewStructSelectorsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 136, nevaParserRULE_structSelectors) + p.EnterRule(localctx, 150, nevaParserRULE_structSelectors) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(887) + p.SetState(934) p.Match(nevaParserT__9) if p.HasError() { // Recognition error - abort rule @@ -12356,14 +13429,14 @@ func (p *nevaParser) StructSelectors() (localctx IStructSelectorsContext) { } } { - p.SetState(888) + p.SetState(935) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(893) + p.SetState(940) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12372,7 +13445,7 @@ func (p *nevaParser) StructSelectors() (localctx IStructSelectorsContext) { for _la == nevaParserT__9 { { - p.SetState(889) + p.SetState(936) p.Match(nevaParserT__9) if p.HasError() { // Recognition error - abort rule @@ -12380,7 +13453,7 @@ func (p *nevaParser) StructSelectors() (localctx IStructSelectorsContext) { } } { - p.SetState(890) + p.SetState(937) p.Match(nevaParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -12388,7 +13461,7 @@ func (p *nevaParser) StructSelectors() (localctx IStructSelectorsContext) { } } - p.SetState(895) + p.SetState(942) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12529,19 +13602,19 @@ func (s *MultipleReceiverSideContext) ExitRule(listener antlr.ParseTreeListener) func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideContext) { localctx = NewMultipleReceiverSideContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 138, nevaParserRULE_multipleReceiverSide) + p.EnterRule(localctx, 152, nevaParserRULE_multipleReceiverSide) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(896) - p.Match(nevaParserT__14) + p.SetState(943) + p.Match(nevaParserT__22) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(900) + p.SetState(947) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12550,7 +13623,7 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte for _la == nevaParserNEWLINE { { - p.SetState(897) + p.SetState(944) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -12558,7 +13631,7 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte } } - p.SetState(902) + p.SetState(949) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12566,10 +13639,10 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte _la = p.GetTokenStream().LA(1) } { - p.SetState(903) + p.SetState(950) p.ReceiverSide() } - p.SetState(920) + p.SetState(967) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12578,14 +13651,14 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte for _la == nevaParserT__2 { { - p.SetState(904) + p.SetState(951) p.Match(nevaParserT__2) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(908) + p.SetState(955) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12594,7 +13667,7 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte for _la == nevaParserNEWLINE { { - p.SetState(905) + p.SetState(952) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -12602,7 +13675,7 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte } } - p.SetState(910) + p.SetState(957) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12610,10 +13683,10 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte _la = p.GetTokenStream().LA(1) } { - p.SetState(911) + p.SetState(958) p.ReceiverSide() } - p.SetState(915) + p.SetState(962) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12622,7 +13695,7 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte for _la == nevaParserNEWLINE { { - p.SetState(912) + p.SetState(959) p.Match(nevaParserNEWLINE) if p.HasError() { // Recognition error - abort rule @@ -12630,7 +13703,7 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte } } - p.SetState(917) + p.SetState(964) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12638,7 +13711,7 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte _la = p.GetTokenStream().LA(1) } - p.SetState(922) + p.SetState(969) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -12646,8 +13719,8 @@ func (p *nevaParser) MultipleReceiverSide() (localctx IMultipleReceiverSideConte _la = p.GetTokenStream().LA(1) } { - p.SetState(923) - p.Match(nevaParserT__15) + p.SetState(970) + p.Match(nevaParserT__23) if p.HasError() { // Recognition error - abort rule goto errorExit diff --git a/internal/compiler/parser/listener.go b/internal/compiler/parser/listener.go index 10689bf2..b5dc4be0 100644 --- a/internal/compiler/parser/listener.go +++ b/internal/compiler/parser/listener.go @@ -42,15 +42,36 @@ func (s *treeShapeListener) EnterImportDef(actx *generated.ImportDefContext) { /* --- Types --- */ -func (s *treeShapeListener) EnterTypeDef(actx *generated.TypeDefContext) { +func (s *treeShapeListener) EnterTypeStmt(actx *generated.TypeStmtContext) { + single := actx.SingleTypeStmt() + + if single != nil { + typeDef := single.TypeDef() + parsedEntity := parseTypeDef(typeDef) + parsedEntity.IsPublic = single.PUB_KW() != nil //nolint:nosnakecase + name := typeDef.IDENTIFIER().GetText() + s.file.Entities[name] = parsedEntity + return + } + + group := actx.GroupTypeStmt() + for i, typeDef := range group.AllTypeDef() { + parsedEntity := parseTypeDef(typeDef) + parsedEntity.IsPublic = group.PUB_KW(i) != nil //nolint:nosnakecase + name := typeDef.IDENTIFIER().GetText() + s.file.Entities[name] = parsedEntity + } +} + +func parseTypeDef(actx generated.ITypeDefContext) src.Entity { var body *ts.Expr if expr := actx.TypeExpr(); expr != nil { body = parseTypeExpr(actx.TypeExpr()) } - result := src.Entity{ - IsPublic: actx.PUB_KW() != nil, //nolint:nosnakecase - Kind: src.TypeEntity, + return src.Entity{ + // IsPublic: actx.PUB_KW() != nil, //nolint:nosnakecase + Kind: src.TypeEntity, Type: ts.Def{ Params: parseTypeParams(actx.TypeParams()).Params, BodyExpr: body, @@ -67,22 +88,39 @@ func (s *treeShapeListener) EnterTypeDef(actx *generated.TypeDefContext) { }, }, } - s.file.Entities[actx.IDENTIFIER().GetText()] = result + // s.file.Entities[actx.IDENTIFIER().GetText()] = result } /* --- Constants --- */ -func (s *treeShapeListener) EnterConstDef(actx *generated.ConstDefContext) { - name := actx.IDENTIFIER().GetText() +func (s *treeShapeListener) EnterSingleConstStmt(actx *generated.SingleConstStmtContext) { + constDef := actx.ConstDef() + parsedEntity := parseConstDef(constDef) + parsedEntity.IsPublic = actx.PUB_KW() != nil //nolint:nosnakecase + name := constDef.IDENTIFIER().GetText() + s.file.Entities[name] = parsedEntity +} + +func (s *treeShapeListener) EnterGroupConstStmt(actx *generated.GroupConstStmtContext) { + for i, constDef := range actx.AllConstDef() { + parsedEntity := parseConstDef(constDef) + parsedEntity.IsPublic = actx.PUB_KW(i) != nil //nolint:nosnakecase + name := constDef.IDENTIFIER().GetText() + s.file.Entities[name] = parsedEntity + } +} + +func parseConstDef(actx generated.IConstDefContext) src.Entity { + // name := actx.IDENTIFIER().GetText() typeExpr := parseTypeExpr(actx.TypeExpr()) constVal := actx.ConstVal() parsedMsg := parseConstVal(constVal) parsedMsg.TypeExpr = *typeExpr - s.file.Entities[name] = src.Entity{ - IsPublic: actx.PUB_KW() != nil, //nolint:nosnakecase - Kind: src.ConstEntity, + return src.Entity{ + // IsPublic: actx.PUB_KW() != nil, //nolint:nosnakecase + Kind: src.ConstEntity, Const: src.Const{ Value: &parsedMsg, Meta: src.Meta{ @@ -102,63 +140,101 @@ func (s *treeShapeListener) EnterConstDef(actx *generated.ConstDefContext) { /* --- Interfaces --- */ +// func (s ) EnterSingleInterfaceStmt(c *generated.SingleInterfaceStmtContext) { + +// } +// func (s ) EnterGroupInterfaceStmt(c *generated.GroupInterfaceStmtContext) { + +// } + func (s *treeShapeListener) EnterInterfaceStmt(actx *generated.InterfaceStmtContext) { - for _, interfaceDef := range actx.AllInterfaceDef() { + single := actx.SingleInterfaceStmt() + group := actx.GroupInterfaceStmt() + + if single != nil { + name := single.InterfaceDef().IDENTIFIER().GetText() + s.file.Entities[name] = src.Entity{ + IsPublic: single.PUB_KW() != nil, //nolint:nosnakecase + Kind: src.InterfaceEntity, + Interface: parseInterfaceDef(single.InterfaceDef()), + } + return + } + + for i, interfaceDef := range group.AllInterfaceDef() { name := interfaceDef.IDENTIFIER().GetText() + s.file.Entities[name] = src.Entity{ - IsPublic: interfaceDef.PUB_KW() != nil, //nolint:nosnakecase + IsPublic: group.PUB_KW(i) != nil, //nolint:nosnakecase Kind: src.InterfaceEntity, Interface: parseInterfaceDef(interfaceDef), } } } -/* -- Components --- */ +/* --- Components --- */ + +func (s *treeShapeListener) EnterCompStmt(actx *generated.CompStmtContext) { + single := actx.SingleCompStmt() + + if single != nil { + compDef := single.CompDef() + parsedCompEntity := parseCompDef(compDef) + parsedCompEntity.IsPublic = single.PUB_KW() != nil //nolint:nosnakecase + parsedCompEntity.Component.Directives = parseCompilerDirectives( + single.CompilerDirectives(), + ) + name := compDef.InterfaceDef().IDENTIFIER().GetText() + s.file.Entities[name] = parsedCompEntity + return + } -func (s *treeShapeListener) EnterCompDef(actx *generated.CompDefContext) { - name := actx.InterfaceDef().IDENTIFIER().GetText() - parsedInterfaceDef := parseInterfaceDef(actx.InterfaceDef()) - isPublic := actx.InterfaceDef().PUB_KW() != nil //nolint:nosnakecase + group := actx.GroupCompStmt() + for i, compDef := range group.AllCompDef() { + parsedCompEntity := parseCompDef(compDef) + parsedCompEntity.IsPublic = group.PUB_KW(i) != nil //nolint:nosnakecase + parsedCompEntity.Component.Directives = parseCompilerDirectives( + group.CompilerDirectives(i), + ) + name := compDef.InterfaceDef().IDENTIFIER().GetText() + s.file.Entities[name] = parsedCompEntity + } +} - directives := parseCompilerDirectives(actx.CompilerDirectives()) +// parseCompDef does NOT set isPublic +func parseCompDef(actx generated.ICompDefContext) src.Entity { + parsedInterfaceDef := parseInterfaceDef(actx.InterfaceDef()) - var cmp src.Entity - if body := actx.CompBody(); body == nil { //nolint:nestif - cmp = src.Entity{ - IsPublic: isPublic, - Kind: src.ComponentEntity, + body := actx.CompBody() + if body == nil { + return src.Entity{ + Kind: src.ComponentEntity, Component: src.Component{ - Directives: directives, - Interface: parsedInterfaceDef, + Interface: parsedInterfaceDef, }, } - s.file.Entities[name] = cmp - } else { - var nodes map[string]src.Node - if nodesDef := body.CompNodesDef(); nodesDef != nil { - nodes = parseNodes(nodesDef.CompNodesDefBody()) - } + } - var net []src.Connection - if netDef := body.CompNetDef(); netDef != nil { - parsedNet, err := parseNet(netDef) - if err != nil { - panic(err) - } - net = parsedNet - } + var nodes map[string]src.Node + if nodesDef := body.CompNodesDef(); nodesDef != nil { + nodes = parseNodes(nodesDef.CompNodesDefBody()) + } - cmp = src.Entity{ - IsPublic: isPublic, - Kind: src.ComponentEntity, - Component: src.Component{ - Directives: directives, - Interface: parsedInterfaceDef, - Nodes: nodes, - Net: net, - }, + var net []src.Connection + if netDef := body.CompNetDef(); netDef != nil { + parsedNet, err := parseNet(netDef) + if err != nil { + panic(err) } + net = parsedNet } - s.file.Entities[name] = cmp + return src.Entity{ + Kind: src.ComponentEntity, + Component: src.Component{ + Interface: parsedInterfaceDef, + Nodes: nodes, + Net: net, + }, + } } diff --git a/internal/compiler/parser/listener_helpers.go b/internal/compiler/parser/listener_helpers.go index d37c0ac2..bc9beffa 100644 --- a/internal/compiler/parser/listener_helpers.go +++ b/internal/compiler/parser/listener_helpers.go @@ -124,14 +124,11 @@ func parseUnionExpr(unionExpr generated.IUnionTypeExprContext) *ts.Expr { func parseLitExpr(litExpr generated.ITypeLitExprContext) *ts.Expr { enumExpr := litExpr.EnumTypeExpr() - arrExpr := litExpr.ArrTypeExpr() structExpr := litExpr.StructTypeExpr() switch { case enumExpr != nil: return parseEnumExpr(enumExpr) - case arrExpr != nil: - return parseArrExpr(arrExpr) case structExpr != nil: return parseStructExpr(structExpr) } @@ -152,26 +149,6 @@ func parseEnumExpr(enumExpr generated.IEnumTypeExprContext) *ts.Expr { return &result } -func parseArrExpr(arrExpr generated.IArrTypeExprContext) *ts.Expr { - typeExpr := arrExpr.TypeExpr() - parsedTypeExpr := parseTypeExpr(typeExpr) - size := arrExpr.INT().GetText() - - parsedSize, err := strconv.ParseInt(size, 10, 64) - if err != nil { - panic(err) - } - - return &ts.Expr{ - Lit: &ts.LitExpr{ - Arr: &ts.ArrLit{ - Expr: *parsedTypeExpr, - Size: int(parsedSize), - }, - }, - } -} - func parseStructExpr(structExpr generated.IStructTypeExprContext) *ts.Expr { result := ts.Expr{ Lit: &ts.LitExpr{ @@ -515,8 +492,10 @@ func parseConnSenderSide(connDef generated.IConnDefContext) src.ConnectionSender } parsedSenderSide := src.ConnectionSenderSide{ - PortAddr: senderSidePortAddr, - ConstRef: constRef, + PortAddr: senderSidePortAddr, + Const: &src.Const{ + Ref: constRef, + }, Selectors: senderSelectors, Meta: src.Meta{ Text: senderSide.GetText(), @@ -584,8 +563,8 @@ func parsePortAddr(expr generated.IPortAddrContext) src.PortAddr { } } -func parseConstVal(constVal generated.IConstValContext) src.Msg { //nolint:funlen - val := src.Msg{ +func parseConstVal(constVal generated.IConstValContext) src.Message { //nolint:funlen + val := src.Message{ Meta: src.Meta{ Text: constVal.GetText(), Start: src.Position{ @@ -630,9 +609,9 @@ func parseConstVal(constVal generated.IConstValContext) src.Msg { //nolint:funle "'", ), ) - case constVal.ArrLit() != nil: - listItems := constVal.ArrLit().ListItems() - if listItems == nil { // empty array [] + case constVal.ListLit() != nil: + listItems := constVal.ListLit().ListItems() + if listItems == nil { // empty list [] val.List = []src.Const{} return val } @@ -662,7 +641,7 @@ func parseConstVal(constVal generated.IConstValContext) src.Msg { //nolint:funle } } case constVal.Nil_() != nil: - return src.Msg{} + return src.Message{} default: panic("unknown const: " + constVal.GetText()) } diff --git a/internal/compiler/parser/neva.g4 b/internal/compiler/parser/neva.g4 index e7918143..eb415fcc 100644 --- a/internal/compiler/parser/neva.g4 +++ b/internal/compiler/parser/neva.g4 @@ -34,22 +34,23 @@ pkgRef: IDENTIFIER; entityName: IDENTIFIER; // Types -typeStmt: 'types' NEWLINE* '{' NEWLINE* (typeDef NEWLINE*)* '}'; -typeDef: PUB_KW? IDENTIFIER typeParams? typeExpr?; +typeStmt: singleTypeStmt | groupTypeStmt; +singleTypeStmt: PUB_KW? 'type' typeDef; +groupTypeStmt: + 'type' NEWLINE* '{' NEWLINE* (PUB_KW? typeDef NEWLINE*)* '}'; +typeDef: IDENTIFIER typeParams? typeExpr?; typeParams: '<' NEWLINE* typeParamList? '>'; typeParamList: typeParam (',' NEWLINE* typeParam NEWLINE*)*; typeParam: IDENTIFIER typeExpr?; typeExpr: typeInstExpr | typeLitExpr | unionTypeExpr; -typeInstExpr: - entityRef typeArgs?; // entity ref points to type definition +typeInstExpr: entityRef typeArgs?; typeArgs: '<' NEWLINE* typeExpr (',' NEWLINE* typeExpr)* NEWLINE* '>'; -typeLitExpr: enumTypeExpr | arrTypeExpr | structTypeExpr; +typeLitExpr: enumTypeExpr | structTypeExpr; enumTypeExpr: 'enum' NEWLINE* '{' NEWLINE* IDENTIFIER ( ',' NEWLINE* IDENTIFIER )* NEWLINE* '}'; -arrTypeExpr: '[' NEWLINE* INT NEWLINE* ']' typeExpr; structTypeExpr: 'struct' NEWLINE* '{' NEWLINE* structFields? '}'; structFields: structField (NEWLINE+ structField)*; @@ -61,10 +62,12 @@ nonUnionTypeExpr: | typeLitExpr; // union inside union lead to mutual left recursion (not supported by ANTLR) // interfaces -interfaceStmt: - 'interfaces' NEWLINE* '{' NEWLINE* (interfaceDef)* '}'; +interfaceStmt: singleInterfaceStmt | groupInterfaceStmt; +singleInterfaceStmt: PUB_KW? 'interface' interfaceDef; +groupInterfaceStmt: + 'interface' NEWLINE* '{' NEWLINE* (PUB_KW? interfaceDef)* '}'; interfaceDef: - PUB_KW? IDENTIFIER typeParams? inPortsDef outPortsDef NEWLINE*; + IDENTIFIER typeParams? inPortsDef outPortsDef NEWLINE*; inPortsDef: portsDef; outPortsDef: portsDef; portsDef: @@ -72,32 +75,39 @@ portsDef: portDef: NEWLINE* IDENTIFIER typeExpr NEWLINE*; // const -constStmt: 'const' NEWLINE* '{' NEWLINE* (constDef)* '}'; -constDef: PUB_KW? IDENTIFIER typeExpr constVal NEWLINE*; +constStmt: singleConstStmt | groupConstStmt; +singleConstStmt: PUB_KW? 'const' constDef; +groupConstStmt: + 'const' NEWLINE* '{' NEWLINE* (PUB_KW? constDef)* '}'; +constDef: IDENTIFIER '=' typeExpr constVal NEWLINE*; constVal: - bool + nil + | bool | INT | FLOAT | STRING - | arrLit - | structLit - | nil; + | listLit + | structLit; bool: 'true' | 'false'; nil: 'nil'; -arrLit: - '[' NEWLINE* listItems? ']'; // array and vector use same syntax +listLit: '[' NEWLINE* listItems? ']'; listItems: constVal | constVal (',' NEWLINE* constVal NEWLINE*)*; structLit: '{' NEWLINE* structValueFields? '}'; // same for struct and map structValueFields: - structValueField (NEWLINE* structValueField)*; + structValueField (',' NEWLINE* structValueField)* ','?; structValueField: IDENTIFIER ':' constVal NEWLINE*; // components -compStmt: 'components' NEWLINE* '{' NEWLINE* (compDef)* '}'; -compDef: compilerDirectives? interfaceDef compBody? NEWLINE*; +compStmt: singleCompStmt | groupCompStmt; +singleCompStmt: compilerDirectives? PUB_KW? 'component' compDef; +groupCompStmt: + 'component' NEWLINE* '{' NEWLINE* ( + compilerDirectives? PUB_KW? compDef + )* '}'; +compDef: interfaceDef compBody? NEWLINE*; compBody: '{' NEWLINE* (compNodesDef NEWLINE*)? (compNetDef NEWLINE*)? '}'; @@ -123,7 +133,10 @@ portAddrNode: IDENTIFIER; portAddrPort: IDENTIFIER; portAddrIdx: '[' INT ']'; structSelectors: '.' IDENTIFIER ('.' IDENTIFIER)*; -multipleReceiverSide: '[' NEWLINE* receiverSide (',' NEWLINE* receiverSide NEWLINE*)* ']'; +multipleReceiverSide: + '[' NEWLINE* receiverSide ( + ',' NEWLINE* receiverSide NEWLINE* + )* ']'; /* LEXER */ diff --git a/internal/compiler/parser/parser_test.go b/internal/compiler/parser/parser_test.go index 31da80ab..181c9f48 100644 --- a/internal/compiler/parser/parser_test.go +++ b/internal/compiler/parser/parser_test.go @@ -14,25 +14,25 @@ import ( func TestParser_ParseFile_Directives(t *testing.T) { text := []byte(` components { - #runtime_func(d1) + #extern(d1) C1() () - #runtime_func(d2) + #extern(d2) C2() () { nodes { - #runtime_func_msg(d3) + #bind(d3) n1 C1 - #runtime_func_msg(d4) + #bind(d4) n2 C1 } } - #struct_inports + #autoports C3() () - #runtime_func(d5) - #struct_inports + #extern(d5) + #autoports C4() () } `) @@ -42,28 +42,28 @@ func TestParser_ParseFile_Directives(t *testing.T) { got, err := p.ParseFile(text) require.True(t, err == nil) - d1 := got.Entities["C1"].Component.Directives[compiler.RuntimeFuncDirective][0] + d1 := got.Entities["C1"].Component.Directives[compiler.ExternDirective][0] require.Equal(t, "d1", d1) c2 := got.Entities["C2"].Component - d2 := c2.Directives[compiler.RuntimeFuncDirective][0] + d2 := c2.Directives[compiler.ExternDirective][0] require.Equal(t, "d2", d2) - d3 := c2.Nodes["n1"].Directives[compiler.RuntimeFuncMsgDirective][0] + d3 := c2.Nodes["n1"].Directives[compiler.BindDirective][0] require.Equal(t, "d3", d3) - d4 := c2.Nodes["n2"].Directives[compiler.RuntimeFuncMsgDirective][0] + d4 := c2.Nodes["n2"].Directives[compiler.BindDirective][0] require.Equal(t, "d4", d4) c3 := got.Entities["C3"].Component - _, ok := c3.Directives[compiler.StructInports] + _, ok := c3.Directives[compiler.AutoportsDirective] require.Equal(t, true, ok) c4 := got.Entities["C4"].Component - d5, ok := c4.Directives[compiler.RuntimeFuncDirective] + d5, ok := c4.Directives[compiler.ExternDirective] require.Equal(t, true, ok) require.Equal(t, "d5", d5[0]) - _, ok = c4.Directives[compiler.StructInports] + _, ok = c4.Directives[compiler.AutoportsDirective] require.Equal(t, true, ok) } diff --git a/internal/compiler/parser/tests/happypath/004_type.simple.neva b/internal/compiler/parser/tests/happypath/004_type.simple.neva index d794934e..230dd6b6 100644 --- a/internal/compiler/parser/tests/happypath/004_type.simple.neva +++ b/internal/compiler/parser/tests/happypath/004_type.simple.neva @@ -1,99 +1,99 @@ -types {} +type {} -types { +type { } -types { +type { } -types +type {} -types +type { } -types +type { } -types { MyInt int } +type { MyInt int } -types { +type { MyInt int } -types { +type { MyInt int } -types +type { MyInt int } -types +type { MyInt int } -types +type { MyInt int } -types +type { MyInt int } -types { MyInt int +type { MyInt int pub MyStr string } -types { MyInt int +type { MyInt int pub MyStr string } -types { MyInt int +type { MyInt int pub MyStr string } -types { +type { MyInt int pub MyStr string } -types { +type { MyInt int pub MyStr string } -types { +type { MyInt int pub MyStr string } -types { +type { MyInt int pub MyStr string } -types { +type { MyInt int pub MyStr string } -types { +type { MyInt int pub MyStr string } -types { +type { MyInt int diff --git a/internal/compiler/parser/tests/happypath/005_type.args.neva b/internal/compiler/parser/tests/happypath/005_type.args.neva index e46cac5b..45193682 100644 --- a/internal/compiler/parser/tests/happypath/005_type.args.neva +++ b/internal/compiler/parser/tests/happypath/005_type.args.neva @@ -1,75 +1,75 @@ -types { MyVec vec } +type { MyVec vec } -types { +type { MyVec vec } -types { +type { MyVec vec } -types { +type { MyVec vec } -types { +type { MyVec vec< int> } -types { MyVec vec< +type { MyVec vec< int> } -types { MyVec vec< +type { MyVec vec< int> } -types { +type { MyVec vec< int> } -types { +type { MyVec vec< int > } -types { +type { MyVec1 Vec pub MyVec2 Vec } -types { +type { MyVec1 Vec pub MyVec2 Vec } -types { +type { pub MyMap map } -types { +type { MyMap map } -types { +type { MyMap map } -types { +type { MyMap map< string, int > } -types { +type { MyInt int MyVec vec @@ -80,7 +80,7 @@ types { > } -types { +type { MyInt int @@ -93,7 +93,7 @@ types { } -types { +type { MyMap1 map MyMap2 map @@ -101,27 +101,27 @@ types { MyMap3> map } -types { +type { MyMap3> map } -types { +type { MyMap3< T int, Y vec > map } -types { +type { MyMap3< T int, Y vec > map> } -types { +type { MyMap3< T int, Y vec diff --git a/internal/compiler/parser/tests/happypath/006_type.enum.neva b/internal/compiler/parser/tests/happypath/006_type.enum.neva index 31082771..cf3f5edf 100644 --- a/internal/compiler/parser/tests/happypath/006_type.enum.neva +++ b/internal/compiler/parser/tests/happypath/006_type.enum.neva @@ -1,47 +1,47 @@ -types { +type { MyEnum1 enum { One } } -types { +type { MyEnum2 enum { One } } -types { +type { MyEnum3 enum { One } } -types { +type { MyEnum4 enum { One } } -types { +type { MyEnum5 enum { One, Two } } -types { +type { MyEnum6 enum { One, Two } } -types { +type { MyEnum7 enum { One, Two } } -types { +type { MyEnum8 enum { One, Two } } -types { +type { MyEnum9 enum { One } pub MyEnum10 enum { One, diff --git a/internal/compiler/parser/tests/happypath/007_type.rec.simple.neva b/internal/compiler/parser/tests/happypath/007_type.rec.simple.neva index a1bc9dde..4b6a39a3 100644 --- a/internal/compiler/parser/tests/happypath/007_type.rec.simple.neva +++ b/internal/compiler/parser/tests/happypath/007_type.rec.simple.neva @@ -1,58 +1,58 @@ -types { +type { EmptyRec struct {} } -types { +type { EmptyRec2 struct { } } -types { +type { EmptyRec2 struct { } } -types { +type { Rec struct { foo int } } -types { +type { Rec struct { foo int } } -types { +type { Rec struct { foo int } } -types { +type { Rec struct { foo int } } -types { +type { Rec struct { foo int bar enum { Monday, Tuesday, Wednesday } } } -types { +type { Rec struct { foo int bar enum { Monday, Tuesday, Wednesday } } } -types { +type { Rec struct { foo int bar enum { Monday, Tuesday, Wednesday } } } -types { +type { Rec struct { foo int bar enum { @@ -63,7 +63,7 @@ types { } } -types { +type { Rec struct { foo int @@ -75,7 +75,7 @@ types { } } -types { +type { EmptyRec struct {} Rec struct { foo int } diff --git a/internal/compiler/parser/tests/happypath/008_type.rec.args.neva b/internal/compiler/parser/tests/happypath/008_type.rec.args.neva index 4041b201..c1def447 100644 --- a/internal/compiler/parser/tests/happypath/008_type.rec.args.neva +++ b/internal/compiler/parser/tests/happypath/008_type.rec.args.neva @@ -1,43 +1,43 @@ -types { +type { Rec struct { foo vec } } -types { +type { Rec struct { foo vec } } -types { +type { Rec struct { foo vec } } -types { +type { Rec struct { foo vec } } -types { +type { Rec struct { foo vec bar map } } -types { +type { Rec struct { foo vec bar map } } -types { +type { Rec struct { foo vec bar map } } -types { +type { Rec struct { foo vec @@ -45,7 +45,7 @@ types { } } -types { +type { Rec struct { foo vec @@ -53,7 +53,7 @@ types { } } -types { +type { Rec struct { foo vec bar map @@ -61,7 +61,7 @@ types { } } -types { +type { Rec struct { foo vec @@ -70,7 +70,7 @@ types { } } -types { +type { Rec struct { foo vec @@ -80,14 +80,14 @@ types { } } -types { +type { Rec struct { foo map bar vec } } -types { +type { Rec struct { foo map bar vec bar vec bar vec bar vec @@ -6,7 +6,7 @@ types { } } -types { +type { Rec2Lvl1 struct { rec2Lvl2 struct { foo vec } -types { +type { bar i32 | vec } -types { +type { bar i32 | vec } -types { +type { bar i32 | vec< i32 > } -types { +type { bar i32 | vec } -types { +type { bar i32 | vec< i32 | f32> } -types { +type { bar i32 | vec } -types { +type { bar i32 | vec< i32 | f32 > } -types { +type { bar vec> } -types { +type { bar vec< i32 | vec> } -types { +type { bar vec> } -types { +type { bar vec< i32 | vec > } -types { +type { bar vec> | map } -types { +type { bar vec< i32 | vec> | map } -types { +type { bar vec< i32 | vec > | map } -types { +type { bar vec> | map< i32, i32 | f32 > } -types { +type { bar vec> | map> } -types { bar vec> | map> +type { bar vec> | map> } -types { +type { bar vec> | map> } -types { bar vec> | map> } +type { bar vec> | map> } -types { +type { bar vec< i32 | vec> | map > } -types { +type { pub bar vec< i32 | vec diff --git a/internal/compiler/parser/tests/happypath/014_type.complex.neva b/internal/compiler/parser/tests/happypath/014_type.complex.neva index 6a3721af..efc33b20 100644 --- a/internal/compiler/parser/tests/happypath/014_type.complex.neva +++ b/internal/compiler/parser/tests/happypath/014_type.complex.neva @@ -1,4 +1,4 @@ -types { +type { MyInt i8 MyNum Int | Float diff --git a/internal/compiler/parser/tests/happypath/015_interface.simple.neva b/internal/compiler/parser/tests/happypath/015_interface.simple.neva index 6a55ce91..d6db4beb 100644 --- a/internal/compiler/parser/tests/happypath/015_interface.simple.neva +++ b/internal/compiler/parser/tests/happypath/015_interface.simple.neva @@ -1,127 +1,127 @@ -interfaces {} +interface {} -interfaces { +interface { } -interfaces { +interface { } -interfaces { IReader1 () () } +interface { IReader1 () () } -interfaces { IReader2 () () +interface { IReader2 () () } -interfaces { +interface { IReader3 () () } -interfaces { +interface { IReader4 () () } -interfaces { +interface { IReader5 ( ) () } -interfaces { +interface { IReader6 () ( ) } -interfaces { +interface { IReader7 ( ) ( ) } -interfaces { IReader8 (x int) () } +interface { IReader8 (x int) () } -interfaces { IReader8 ( +interface { IReader8 ( x int) () } -interfaces { IReader8 (x int +interface { IReader8 (x int ) () } -interfaces { IReader8 (x int) ( +interface { IReader8 (x int) ( ) } -interfaces { +interface { IReader8 (x int) () } -interfaces { IReader8 (x int) () +interface { IReader8 (x int) () } -interfaces { +interface { IReader8 (x int) () } -interfaces { +interface { IReader8 ( x int) () } -interfaces { +interface { IReader8 (x int ) () } -interfaces { +interface { IReader8 (x int) ( ) } -interfaces { +interface { IReader8 ( x int ) () } -interfaces { +interface { IReader8 ( x int ) ( ) } -interfaces { IReader8 (x int, y string) () } +interface { IReader8 (x int, y string) () } -interfaces { +interface { IReader8 (x int, y string) () } -interfaces { IReader8 (x int, y string) () +interface { IReader8 (x int, y string) () } -interfaces { IReader8 ( +interface { IReader8 ( x int, y string) () } -interfaces { IReader8 (x int, +interface { IReader8 (x int, y string) () } -interfaces { +interface { IReader8 (x int, y string) () } -interfaces { +interface { IReader8 ( x int, y string ) () } -interfaces { +interface { IReader8 ( x int, y string) () } -interfaces { +interface { IReader8 ( x int, y string ) () } -interfaces { +interface { IReader8 ( x int, y string @@ -129,61 +129,61 @@ interfaces { ) } -interfaces { +interface { IReader8 ( x int, y string ) () } -interfaces { IReader9 () (a int) } +interface { IReader9 () (a int) } -interfaces { +interface { IReader10 () (a int) } -interfaces { IReader11 () (a int) +interface { IReader11 () (a int) } -interfaces { +interface { IReader12 () (a int) } -interfaces { +interface { IReader13 ( ) (a int) } -interfaces { +interface { IReader14 () ( a int) } -interfaces { +interface { IReader15 () (a int ) } -interfaces { +interface { IReader16 ( ) ( a int ) } -interfaces { IReader17 (x int) (a int) } +interface { IReader17 (x int) (a int) } -interfaces { +interface { IReader18 (x int) (a int) } -interfaces { +interface { IReader19 (x int, y string) (a int) } -interfaces { +interface { pub IReader20 (x int, y string) (a int, b bool) } -interfaces { +interface { pub IReader21 (x, y) (a, b) } \ No newline at end of file diff --git a/internal/compiler/parser/tests/happypath/016_interface.enums.neva b/internal/compiler/parser/tests/happypath/016_interface.enums.neva index ef48b5c8..d726572e 100644 --- a/internal/compiler/parser/tests/happypath/016_interface.enums.neva +++ b/internal/compiler/parser/tests/happypath/016_interface.enums.neva @@ -1,46 +1,46 @@ -interfaces { IReader1 (x enum { Monday }) () } +interface { IReader1 (x enum { Monday }) () } -interfaces { IReader2 (x enum { +interface { IReader2 (x enum { Monday }) () } -interfaces { IReader3 (x enum { Monday +interface { IReader3 (x enum { Monday }) () } -interfaces { +interface { IReader4 (x enum { Monday }) () } -interfaces { +interface { IReader5 (x enum { Monday }) () } -interfaces { +interface { IReader6 (x enum { Monday, Tuesday, Wednesday }) () } -interfaces { +interface { IReader7 (x enum { Monday, Tuesday, Wednesday }) () } -interfaces { +interface { IReader8 (x enum { Monday, Tuesday, Wednesday }) (a enum { Monday, Tuesday, Wednesday }) } -interfaces { +interface { IReader9 (x enum { Monday, Tuesday, Wednesday }) (a enum { Monday, Tuesday, Wednesday }) } -interfaces { +interface { IReader10 (x enum { Monday, Tuesday, Wednesday }) (a enum { Monday, Tuesday, Wednesday }) } -interfaces { +interface { IReader11 (x enum { Monday, Tuesday, Wednesday }) (a enum { @@ -48,7 +48,7 @@ interfaces { }) } -interfaces { +interface { IReader12 (x enum { Monday, Tuesday, @@ -60,17 +60,17 @@ interfaces { }) } -interfaces { +interface { IReader12 (x enum { Monday, Tuesday, Wednesday }, y enum { January, February }) (a enum { Monday, Tuesday, Wednesday }, b enum { January, February }) } -interfaces { +interface { IReader12 ( x enum { Monday, Tuesday, Wednesday }, y enum { January, February } ) (a enum { Monday, Tuesday, Wednesday }, b enum { January, February }) } -interfaces { +interface { IReader12 ( x enum { Monday, Tuesday, Wednesday }, y enum { January, February } ) ( @@ -78,7 +78,7 @@ interfaces { ) } -interfaces { +interface { IReader12 ( x enum { Monday, Tuesday, Wednesday @@ -89,7 +89,7 @@ interfaces { } -interfaces { +interface { IReader12 ( x enum { Monday, Tuesday, Wednesday @@ -101,7 +101,7 @@ interfaces { ) } -interfaces { +interface { IReader12 ( x enum { Monday, Tuesday, Wednesday @@ -114,7 +114,7 @@ interfaces { ) } -interfaces { +interface { IReader12 ( x enum { Monday, Tuesday, Wednesday @@ -128,7 +128,7 @@ interfaces { ) } -interfaces { +interface { pub IReader12 ( x enum { Monday, diff --git a/internal/compiler/parser/tests/happypath/017_interface.arr.neva b/internal/compiler/parser/tests/happypath/017_interface.arr.neva index 75e06d35..4dc0b71f 100644 --- a/internal/compiler/parser/tests/happypath/017_interface.arr.neva +++ b/internal/compiler/parser/tests/happypath/017_interface.arr.neva @@ -1,48 +1,48 @@ -interfaces { IReader1 (arr [512]int) () } +interface { IReader1 (arr [512]int) () } -interfaces { +interface { IReader1 (arr [512]int) () } -interfaces { IReader1 (arr [512]int) (arr [1024]bool) } +interface { IReader1 (arr [512]int) (arr [1024]bool) } -interfaces { +interface { IReader1 (arr [512]int) (arr [1024]bool) } -interfaces { IReader1 (arr [512]enum{ Monday, Tuesday }) (arr [1024]enum{ January, February }) } +interface { IReader1 (arr [512]enum{ Monday, Tuesday }) (arr [1024]enum{ January, February }) } -interfaces { +interface { IReader1 (arr [512]enum{ Monday, Tuesday }) (arr [1024]enum{ January, February }) } -interfaces { IReader1 (arr [512]struct{ foo int }) (arr [1024]struct{ bar bool }) } +interface { IReader1 (arr [512]struct{ foo int }) (arr [1024]struct{ bar bool }) } -interfaces { +interface { IReader1 (arr [512]enum{ Monday, Tuesday }) (arr [1024]enum{ January, February }) } -interfaces { IReader1 (arr [512]enum{ Monday, Tuesday }, arr2 [256]struct{ foo int }) (arr [1024]enum{ January, February }) } +interface { IReader1 (arr [512]enum{ Monday, Tuesday }, arr2 [256]struct{ foo int }) (arr [1024]enum{ January, February }) } -interfaces { +interface { IReader1 (arr [512]enum{ Monday, Tuesday }, arr2 [256]struct{ foo int }) (arr [1024]enum{ January, February }) } -interfaces { +interface { IReader1 ( arr [512]enum{ Monday, Tuesday }, arr2 [256]struct{ foo int } ) (arr [1024]enum{ January, February }) } -interfaces { +interface { IReader1 ( arr [512]enum{ Monday, Tuesday }, arr2 [256]struct{ foo int } ) (arr [1024]enum{ January, February }, arr2 [256]struct{ bar bool }) } -interfaces { +interface { IReader1 ( arr [512]enum{ Monday, Tuesday }, arr2 [256]struct{ foo int } @@ -52,7 +52,7 @@ interfaces { ) } -interfaces { +interface { pub IReader1 ( arr [512]enum{ Monday, Tuesday }, arr2 [256]struct{ foo int }, diff --git a/internal/compiler/parser/tests/happypath/018_interface.struct_simple.neva b/internal/compiler/parser/tests/happypath/018_interface.struct_simple.neva index 29194968..5fff34c4 100644 --- a/internal/compiler/parser/tests/happypath/018_interface.struct_simple.neva +++ b/internal/compiler/parser/tests/happypath/018_interface.struct_simple.neva @@ -1,96 +1,96 @@ -interfaces { IReader1 (x struct {}) () } +interface { IReader1 (x struct {}) () } -interfaces { IReader1 (x struct { +interface { IReader1 (x struct { }) () } -interfaces { +interface { IReader1 (x struct {}) () } -interfaces { IReader1 (x struct { +interface { IReader1 (x struct { foo int }) () } -interfaces { IReader1 (x struct { foo int +interface { IReader1 (x struct { foo int }) () } -interfaces { IReader1 (x struct { +interface { IReader1 (x struct { foo int }) () } -interfaces { +interface { IReader1 (x struct { foo int }) () } -interfaces { +interface { IReader1 (x struct { foo int }) () } -interfaces { IReader1 (x struct {}) (a struct {}) } +interface { IReader1 (x struct {}) (a struct {}) } -interfaces { IReader1 (x struct {}) (a struct { +interface { IReader1 (x struct {}) (a struct { }) } -interfaces { +interface { IReader1 (x struct {}) (a struct {}) } -interfaces { +interface { IReader1 (x struct {}) (a struct { }) } -interfaces { +interface { IReader1 (x struct { }) (a struct { }) } -interfaces { IReader1 (x struct { foo int }) (a struct {}) } +interface { IReader1 (x struct { foo int }) (a struct {}) } -interfaces { +interface { IReader1 (x struct { foo int }) (a struct { }) } -interfaces { +interface { IReader1 (x struct { }) (a struct { bar bool }) } -interfaces { +interface { IReader1 (x struct { }) (a struct { bar bool }) } -interfaces { +interface { IReader1 (x struct { }) (a struct { bar bool }) } -interfaces { +interface { IReader1 (x struct { foo int bar string }) (a struct { bar bool }) } -interfaces { +interface { IReader1 (x struct { foo int bar string }) (a struct { bar bool }) } -interfaces { +interface { IReader1 (x struct { foo int bar string }) (a struct { bar bool }) } -interfaces { +interface { IReader1 (x struct { foo int bar string @@ -98,14 +98,14 @@ interfaces { bar bool }) } -interfaces { +interface { IReader1 (x struct { foo int bar string }) (a struct { bar bool }) } -interfaces { +interface { IReader1 (x struct { foo int bar string @@ -115,7 +115,7 @@ interfaces { }) } -interfaces { +interface { IReader1 (x struct { foo int bar string @@ -124,7 +124,7 @@ interfaces { }) } -interfaces { +interface { pub IReader1 (x struct { foo int bar string diff --git a/internal/compiler/parser/tests/happypath/019_interface.struct_nested.neva b/internal/compiler/parser/tests/happypath/019_interface.struct_nested.neva index 57504918..33de7197 100644 --- a/internal/compiler/parser/tests/happypath/019_interface.struct_nested.neva +++ b/internal/compiler/parser/tests/happypath/019_interface.struct_nested.neva @@ -1,25 +1,25 @@ -interfaces { IReader1 (x struct { foo struct {} }) () } +interface { IReader1 (x struct { foo struct {} }) () } -interfaces { +interface { IReader1 (x struct { foo struct {} }) () } -interfaces { +interface { IReader1 (x struct { foo struct {} }) () } -interfaces { IReader1 (x struct { foo struct {} }) (bar struct { baz struct {} }) } +interface { IReader1 (x struct { foo struct {} }) (bar struct { baz struct {} }) } -interfaces { +interface { IReader1 (x struct { foo struct {} }) (bar struct { baz struct {} }) } -interfaces { +interface { IReader1 ( x struct { foo struct {} } ) (bar struct { baz struct {} }) } -interfaces { +interface { IReader1 ( x struct { foo struct {} } ) ( @@ -27,7 +27,7 @@ interfaces { ) } -interfaces { +interface { IReader1 (x struct { foo struct { a int } }) (bar struct { @@ -35,7 +35,7 @@ interfaces { }) } -interfaces { +interface { IReader1 ( x struct { foo struct { a int } } ) ( @@ -43,7 +43,7 @@ interfaces { ) } -interfaces { +interface { pub IReader1 ( x struct { foo struct { a int } }, y struct {} diff --git a/internal/compiler/parser/tests/happypath/020_interface.union.neva b/internal/compiler/parser/tests/happypath/020_interface.union.neva index 63008ec1..2c14398b 100644 --- a/internal/compiler/parser/tests/happypath/020_interface.union.neva +++ b/internal/compiler/parser/tests/happypath/020_interface.union.neva @@ -1,22 +1,22 @@ -interfaces { IReader1 (a bool | int) () } +interface { IReader1 (a bool | int) () } -interfaces { +interface { IReader1 (a bool | int) () } -interfaces { +interface { IReader1 () (x string | float) } -interfaces { +interface { IReader1 (a bool | int) (x string | float) } -interfaces { +interface { IReader1 (a bool | int | struct {}) (x string | float | enum { Monday }) } -interfaces { +interface { IReader1 ( a bool | int | struct { foo int | string } ) ( @@ -29,7 +29,7 @@ interfaces { ) } -interfaces { +interface { pub IReader1 ( a bool | int | struct { foo int | string }, b [256][128]struct { bar int | [64]int } diff --git a/internal/compiler/parser/tests/happypath/021_interface.mixed.neva b/internal/compiler/parser/tests/happypath/021_interface.mixed.neva index 3b0a03fa..859c29d1 100644 --- a/internal/compiler/parser/tests/happypath/021_interface.mixed.neva +++ b/internal/compiler/parser/tests/happypath/021_interface.mixed.neva @@ -1,4 +1,4 @@ -interfaces { +interface { IReader1 () () IReader20 (x int, y string) (a int, b bool) diff --git a/internal/compiler/parser/tests/happypath/022_interface.typeargs.neva b/internal/compiler/parser/tests/happypath/022_interface.typeargs.neva index c1d5bee2..a0890f34 100644 --- a/internal/compiler/parser/tests/happypath/022_interface.typeargs.neva +++ b/internal/compiler/parser/tests/happypath/022_interface.typeargs.neva @@ -1,4 +1,4 @@ -interfaces { +interface { IReader1<> () () IReader20 (x int, y T) (a int, b bool) diff --git a/internal/compiler/parser/tests/happypath/023_const.simple.neva b/internal/compiler/parser/tests/happypath/023_const.simple.neva index 6cbd52da..680bf6a0 100644 --- a/internal/compiler/parser/tests/happypath/023_const.simple.neva +++ b/internal/compiler/parser/tests/happypath/023_const.simple.neva @@ -7,203 +7,157 @@ const { } -const { PI f32 3.14 } +const { PI = f32 = 3.14 } const { - PI f32 3.14 } + PI f32 = 3.14 } -const { PI f32 3.14 +const { PI f32 = 3.14 } const { - PI f32 3.14 + PI f32 = 3.14 } const { - PI f32 3.14 + PI f32 = 3.14 } const { - PI f32 3.14 + PI f32 = 3.14 } -const { PI f32 3.14 - MAGIC_NUM i8 42 } +const { PI f32 = 3.14 + MAGIC_NUM i8 = 42 } const { - PI f32 3.14 - MAGIC_NUM i8 42 } + PI f32 = 3.14 + MAGIC_NUM i8 = 42 } const { - PI f32 3.14 - MAGIC_NUM i8 42 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 } const { - PI f32 3.14 - MAGIC_NUM i8 42 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 } const { - PI f32 3.14 - MAGIC_NUM i8 42 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 } const { - PI f32 3.14 - MAGIC_NUM i8 42 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 } const { - PI f32 3.14 - MAGIC_NUM i8 42 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 } const { - PI f32 3.14 + PI f32 = 3.14 - MAGIC_NUM i8 42 + MAGIC_NUM i8 = 42 } -const { VEC vec [] } +const { VEC list = [] } const { - VEC vec [] } + VEC list = [] } -const { VEC vec [] +const { VEC list = [] } const { - VEC vec [] + VEC list = [] } const { - VEC vec [1, 2, 3, 4] + VEC list = [1, 2, 3, 4] } -const { ARR [4]i8 [0, 1, 2, 3] } +const { REC struct {} = {} } -const { - ARR [4]i8 [0, 1, 2, 3] } - -const { ARR [4]i8 [0, 1, 2, 3] +const { REC struct {} = {} } -const { - ARR [4]i8 [0, 1, 2, 3] +const { REC struct {} = {} } const { - ARR [4]i8 [ - 0, 1, 2, 3] + REC struct {} = {} } -const { - ARR [4]i8 [0, 1, 2, 3 - ] -} +const { REC struct { foo int } = { foo: 42 } } const { - ARR [4]i8 [ - 0, 1, 2, 3 - ] -} + REC struct { foo int } = { foo: 42 } } -const { - ARR [4]i8 [ - 0, 1, - 2, 3 - ] -} - -const { - ARR [4]i8 [ - 0, - 1, - 2, - 3 - ] -} - -const { REC struct {} {} } - -const { REC struct {} {} -} - -const { REC struct {} {} -} - -const { - REC struct {} {} -} - -const { REC struct { foo int } { foo: 42 } } - -const { - REC struct { foo int } { foo: 42 } } - -const { REC struct { foo int } { foo: 42 } +const { REC struct { foo int } = { foo: 42 } } const { REC struct { foo int - bar [4]i8 - } { - foo: 42 - bar: [1, 2, 3, 4] + bar list + } = { + foo: 42, + bar: [1, 2, 3, 4], } } -const { ENUM enum { Monday, Tuesday } 1 } +const { ENUM enum { Monday, Tuesday } = 1 } const { - ENUM enum { Monday, Tuesday } 2 } + ENUM enum { Monday, Tuesday } = 2 } -const { ENUM enum { Monday, Tuesday } 3 +const { ENUM enum { Monday, Tuesday } = 3 } const { - ENUM enum { Monday, Tuesday } 4 + ENUM enum { Monday, Tuesday } = 4 } const { ENUM enum { - Monday, Tuesday } 5 + Monday, Tuesday } = 5 } const { ENUM enum { Monday, Tuesday - } 6 + } = 6 } const { ENUM enum { Monday, Tuesday - } 7 + } = 7 } const { ENUM enum { Monday, Tuesday - } 8 + } = 8 } -const { UNION int | string 42 } +const { UNION int | string = 42 } const { - pub UNION int | string 'hello!' + pub UNION int | string = 'hello!' } const { - msg string 'hello!' + msg string = 'hello!' } - - diff --git a/internal/compiler/parser/tests/happypath/024_const.mixed.neva b/internal/compiler/parser/tests/happypath/024_const.mixed.neva index 484907d7..7291e7b3 100644 --- a/internal/compiler/parser/tests/happypath/024_const.mixed.neva +++ b/internal/compiler/parser/tests/happypath/024_const.mixed.neva @@ -1,91 +1,68 @@ const { - PI f32 3.14 - MAGIC_NUM i8 42 - pub VEC_EMPTY vec [] - VEC_FULL vec [1, 2, 3, 4] - ARR [4]i8 [0, 1, 2, 3] - REC struct { foo int } { foo: 42 } - pub ENUM enum { Monday, Tuesday } 1 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 + pub VEC_EMPTY list = [] + VEC_FULL list = [1, 2, 3, 4] + REC struct { foo int } = { foo: 42 } + pub ENUM enum { Monday, Tuesday } = 1 } -const { PI f32 3.14 - MAGIC_NUM i8 42 - VEC_EMPTY vec [] - pub VEC_FULL vec [1, 2, 3, 4] - ARR [4]i8 [0, 1, 2, 3] - pub REC struct { foo int } { foo: 42 } - ENUM enum { Monday, Tuesday } 1 +const { PI f32 = 3.14 + MAGIC_NUM i8 = 42 + VEC_EMPTY list = [] + pub VEC_FULL list = [1, 2, 3, 4] + pub REC struct { foo int } = { foo: 42 } + ENUM enum { Monday, Tuesday } = 1 } const { - PI f32 3.14 - MAGIC_NUM i8 42 - VEC_EMPTY vec [] - pub VEC_FULL vec [1, 2, 3, 4] - ARR [4]i8 [0, 1, 2, 3] - pub REC struct { foo int } { foo: 42 } - ENUM enum { Monday, Tuesday } 1 } + PI f32 = 3.14 + MAGIC_NUM i8 = 42 + VEC_EMPTY list = [] + pub VEC_FULL list = [1, 2, 3, 4] + pub REC struct { foo int } = { foo: 42 } + ENUM enum { Monday, Tuesday } = 1 } const { - PI f32 3.14 - MAGIC_NUM i8 42 - VEC_EMPTY vec [] - pub VEC_FULL vec [1, 2, 3, 4] - pub ARR [4]i8 [0, 1, 2, 3] - REC struct { foo int } { foo: 42 } - ENUM enum { Monday, Tuesday } 1 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 + VEC_EMPTY list = [] + pub VEC_FULL list = [1, 2, 3, 4] + REC struct { foo int } = { foo: 42 } + ENUM enum { Monday, Tuesday } = 1 } const { - PI f32 3.14 - MAGIC_NUM i8 42 - VEC_EMPTY vec [] - VEC_FULL vec [1, 2, 3, 4] - ARR [4]i8 [0, 1, 2, 3] - REC struct { foo int } { foo: 42 } - pub ENUM enum { Monday, Tuesday } 1 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 + VEC_EMPTY list = [] + VEC_FULL list = [1, 2, 3, 4] + REC struct { foo int } = { foo: 42 } + pub ENUM enum { Monday, Tuesday } = 1 } const { - PI f32 3.14 - MAGIC_NUM i8 42 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 - VEC_EMPTY vec [] - VEC_FULL vec [1, 2, 3, 4] - ARR [4]i8 [0, 1, 2, 3] + VEC_EMPTY list = [] + VEC_FULL list = [1, 2, 3, 4] - pub REC struct { foo int } { foo: 42 } - ENUM enum { Monday, Tuesday } 1 + pub REC struct { foo int } = { foo: 42 } + ENUM enum { Monday, Tuesday } = 1 } const { - PI f32 3.14 - MAGIC_NUM i8 42 + PI f32 = 3.14 + MAGIC_NUM i8 = 42 - VEC_EMPTY vec [] - VEC_FULL vec [1, 2, 3, 4] - ARR [4]i8 [0, 1, 2, 3] + VEC_EMPTY list = [] + VEC_FULL list = [1, 2, 3, 4] - REC struct { foo int } { foo: 42 } - pub ENUM enum { Monday, Tuesday } 1 + REC struct { foo int } = { foo: 42 } + pub ENUM enum { Monday, Tuesday } = 1 } - -const { - pub MIXED_REC struct { - foo [64]int | struct { bar [2]bool } - baz [3]bool - } | [2]struct{ bax f32 } { - foo: { bar: [ - true, false - ] } - baz: [ - true, - true, - true - ] - } -} \ No newline at end of file diff --git a/internal/compiler/parser/tests/happypath/025_component.neva b/internal/compiler/parser/tests/happypath/025_component.neva index 71e4d899..c7e4b5b8 100644 --- a/internal/compiler/parser/tests/happypath/025_component.neva +++ b/internal/compiler/parser/tests/happypath/025_component.neva @@ -1,76 +1,76 @@ -components {} +component {} -components { +component { } -components { +component { } -components { Doer() () {} } +component { Doer() () {} } -components { +component { Doer() () {} } -components { Doer() () {} +component { Doer() () {} } -components { +component { Doer() () {} } -components { Doer(x int) (y T) {} } +component { Doer(x int) (y T) {} } -components { +component { Doer(x int) (y T) { } } -components { +component { Doer(x int) (y T) { } } -components { +component { Doer(x int) (y T) { } } -components { +component { Doer(x int) (y T) { nodes {} } } -components { +component { Doer(x int) (y T) { nodes { } } } -components { +component { Doer(x int) (y T) { nodes { absNode INode } } } -components { +component { Doer(x int) (y T) { nodes { absNode INode } } } -components { +component { Doer(x int) (y T) { nodes { absNode INode } } } -components { +component { Doer(x int) (y T) { nodes { absNode INode @@ -78,7 +78,7 @@ components { } } -components { +component { Doer(x int) (y T) { nodes { simpleAbsNode INode @@ -92,27 +92,27 @@ components { } } -components { +component { Doer(x int) (y T) { nodes { concreteNode Node } } } -components { +component { Doer(x int) (y T) { nodes { concreteNode Node } } } -components { +component { Doer(x int) (y T) { nodes { concreteNode Node } } } -components { +component { Doer(x int) (y T) { nodes { concreteNode Node @@ -120,7 +120,7 @@ components { } } -components { +component { Doer(x int) (y T) { nodes { concreteNodeWithTypeArgs Node> @@ -128,7 +128,7 @@ components { } } -components { +component { Doer(x int) (y T) { nodes { concreteNodeWithDI1 Node1{foo Node2} @@ -140,7 +140,7 @@ components { } } -components { +component { Doer(x int) (y T) { nodes { concreteNodeWithDI1 Node1{ @@ -154,7 +154,7 @@ components { } } -components { +component { Doer(x int) (y T) { nodes { concreteNodeWithDIAndTypeArgs Node1< @@ -171,7 +171,7 @@ components { } } -components { +component { Doer(x int) (y T) { nodes { simpleAbsNode INode @@ -199,21 +199,21 @@ components { } } -components { - Main(enter) (exit) { +component { + Main(start) (stop) { nodes { abs IReader concrete io.Reader } net { - in:enter -> abs:v + in:start -> abs:v abs:v -> [concrete:v] concrete:v -> out:code } } } -components { +component { Main() () { net { $foo.bar -> foo:bar @@ -229,7 +229,7 @@ components { } } -components { +component { Main() () { net { $foo -> (foo:bar -> bar:baz) @@ -254,7 +254,7 @@ components { } } -components { +component { Main() () { net { $a -> ($b -> ($c -> d:e)) diff --git a/internal/compiler/parser/tests/happypath/026_mixed.neva b/internal/compiler/parser/tests/happypath/026_mixed.neva index 664cc869..c5aa8156 100644 --- a/internal/compiler/parser/tests/happypath/026_mixed.neva +++ b/internal/compiler/parser/tests/happypath/026_mixed.neva @@ -2,7 +2,7 @@ import { std/io } -types { +type { useId int money float userName string @@ -10,23 +10,23 @@ types { } const { - pi float 3.14 - magicNum int 42 + pi float = 3.14 + magicNum int = 42 } -interfaces { +interface { IReader(path string) (i int, e err) IWriter(path) (i int, anything) } -components { - Main(enter) (exit) { +component { + Main(start) (stop) { nodes { abs IReader concrete io.Reader } net { - in:enter -> abs:v + in:start -> abs:v abs:v -> [concrete:v] concrete:v -> out:code } diff --git a/internal/compiler/parser/tests/happypath/027_compiler_directives.neva b/internal/compiler/parser/tests/happypath/027_compiler_directives.neva index ef189fe8..e87bd651 100644 --- a/internal/compiler/parser/tests/happypath/027_compiler_directives.neva +++ b/internal/compiler/parser/tests/happypath/027_compiler_directives.neva @@ -1,21 +1,21 @@ -components { - #struct_inports +component { + #autoports pub C1() () - #runtime_func(read) + #extern(read) pub C1(sig) (v string) - #struct_inports - #runtime_func(read) + #extern(read) + #autoports pub C1_5(sig) (v string) - #runtime_func(int DoInt, float DoFloat) + #extern(int DoInt, float DoFloat) pub C2(sig) (v string) - #runtime_func(read, write) + #extern(read, write) pub C3(v T) (v T) { nodes { - #runtime_func_msg(msg) + #bind(msg) msg Const } } diff --git a/cmd/interpreter/adapter.go b/internal/interpreter/adapter.go similarity index 99% rename from cmd/interpreter/adapter.go rename to internal/interpreter/adapter.go index cf633e3e..ff4b6410 100644 --- a/cmd/interpreter/adapter.go +++ b/internal/interpreter/adapter.go @@ -1,4 +1,4 @@ -package main +package interpreter import ( "errors" diff --git a/cmd/interpreter/interpreter.go b/internal/interpreter/interpreter.go similarity index 98% rename from cmd/interpreter/interpreter.go rename to internal/interpreter/interpreter.go index 8272c0ac..391b3f75 100644 --- a/cmd/interpreter/interpreter.go +++ b/internal/interpreter/interpreter.go @@ -1,4 +1,4 @@ -package main +package interpreter import ( "context" diff --git a/internal/pkgmanager/tests/testmod/do_nothing/main.neva b/internal/pkgmanager/tests/testmod/do_nothing/main.neva index c4e4935c..2fc472e9 100644 --- a/internal/pkgmanager/tests/testmod/do_nothing/main.neva +++ b/internal/pkgmanager/tests/testmod/do_nothing/main.neva @@ -1,5 +1,5 @@ -components { - Main(enter) (exit) { - net { in.enter -> out.exit } +component { + Main(start) (stop) { + net { in.start -> out.stop } } } \ No newline at end of file diff --git a/internal/runtime/funcs/add.go b/internal/runtime/funcs/add.go index b5198054..986fe4d7 100644 --- a/internal/runtime/funcs/add.go +++ b/internal/runtime/funcs/add.go @@ -6,9 +6,9 @@ import ( "github.com/nevalang/neva/internal/runtime" ) -type addInts struct{} +type intAdder struct{} -func (addInts) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { +func (intAdder) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { // vvin, err := io.In.Port("vv") // if err != nil { // return nil, err @@ -24,8 +24,8 @@ func (addInts) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Contex select { case <-ctx.Done(): return - // case subStreamItem := <-vvin: - // subStreamItem + // case subStreamItem := <-vvin: + // subStreamItem } } }, nil diff --git a/internal/runtime/funcs/const.go b/internal/runtime/funcs/const.go index 2d52d9af..a95b7b4e 100644 --- a/internal/runtime/funcs/const.go +++ b/internal/runtime/funcs/const.go @@ -7,9 +7,9 @@ import ( "github.com/nevalang/neva/internal/runtime" ) -type constant struct{} +type emitter struct{} -func (c constant) Create(io runtime.FuncIO, msg runtime.Msg) (func(ctx context.Context), error) { +func (c emitter) Create(io runtime.FuncIO, msg runtime.Msg) (func(ctx context.Context), error) { v, ok := msg.(runtime.Msg) if !ok { return nil, errors.New("ctx value is not runtime message") diff --git a/internal/runtime/funcs/funcs.go b/internal/runtime/funcs/funcs.go index 8828c1c0..1f3d4979 100644 --- a/internal/runtime/funcs/funcs.go +++ b/internal/runtime/funcs/funcs.go @@ -9,14 +9,13 @@ import ( // CreatorRegistry allows to create runtime functions by accessing function creators by key. func CreatorRegistry() map[string]runtime.FuncCreator { return map[string]runtime.FuncCreator{ - "Read": read{}, - "Print": print{}, - "Lock": lock{}, - "Const": constant{}, - "AddInts": addInts{}, - // "AddFloats": addFloats{}, - "ParseInt": parseInt{}, - "Void": void{}, + "Reader": reader{}, + "Printer": printer{}, + "Blocker": blocker{}, + "Emitter": emitter{}, + "IntAdder": intAdder{}, + "IntParser": intParser{}, + "Destructor": destructor{}, "StructSelector": structSelector{}, "MapSelector": mapSelector{}, "StructBuilder": structBuilder{}, diff --git a/internal/runtime/funcs/lock.go b/internal/runtime/funcs/lock.go index 62048a8e..07261c72 100644 --- a/internal/runtime/funcs/lock.go +++ b/internal/runtime/funcs/lock.go @@ -6,9 +6,9 @@ import ( "github.com/nevalang/neva/internal/runtime" ) -type lock struct{} +type blocker struct{} -func (l lock) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { +func (l blocker) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { vin, err := io.In.Port("v") if err != nil { return nil, err @@ -27,7 +27,7 @@ func (l lock) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context return l.Handle(vin, sig, vout), nil } -func (lock) Handle(vin, sig, vout chan runtime.Msg) func(ctx context.Context) { +func (blocker) Handle(vin, sig, vout chan runtime.Msg) func(ctx context.Context) { return func(ctx context.Context) { for { select { diff --git a/internal/runtime/funcs/parseint.go b/internal/runtime/funcs/parseint.go index 19f230aa..93c01568 100644 --- a/internal/runtime/funcs/parseint.go +++ b/internal/runtime/funcs/parseint.go @@ -9,9 +9,9 @@ import ( "github.com/nevalang/neva/internal/runtime" ) -type parseInt struct{} +type intParser struct{} -func (p parseInt) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { +func (p intParser) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { vin, err := io.In.Port("v") if err != nil { return nil, err diff --git a/internal/runtime/funcs/print.go b/internal/runtime/funcs/print.go index 25390638..b44d6115 100644 --- a/internal/runtime/funcs/print.go +++ b/internal/runtime/funcs/print.go @@ -7,9 +7,9 @@ import ( "github.com/nevalang/neva/internal/runtime" ) -type print struct{} //nolint:predeclared +type printer struct{} -func (p print) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { +func (p printer) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { vin, err := io.In.Port("v") if err != nil { return nil, err diff --git a/internal/runtime/funcs/read.go b/internal/runtime/funcs/read.go index 944ee676..a51f7159 100644 --- a/internal/runtime/funcs/read.go +++ b/internal/runtime/funcs/read.go @@ -8,9 +8,9 @@ import ( "github.com/nevalang/neva/internal/runtime" ) -type read struct{} +type reader struct{} -func (r read) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { +func (r reader) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { sig, err := io.In.Port("sig") if err != nil { return nil, err diff --git a/internal/runtime/funcs/streamers.go b/internal/runtime/funcs/streamers.go index 592ada2c..5c666c74 100644 --- a/internal/runtime/funcs/streamers.go +++ b/internal/runtime/funcs/streamers.go @@ -1,4 +1 @@ package funcs - - - diff --git a/internal/runtime/funcs/void.go b/internal/runtime/funcs/void.go index 8feda8fc..5ab139d5 100644 --- a/internal/runtime/funcs/void.go +++ b/internal/runtime/funcs/void.go @@ -6,9 +6,9 @@ import ( "github.com/nevalang/neva/internal/runtime" ) -type void struct{} +type destructor struct{} -func (v void) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { +func (v destructor) Create(io runtime.FuncIO, _ runtime.Msg) (func(ctx context.Context), error) { vin, err := io.In.Port("v") if err != nil { return nil, err diff --git a/internal/runtime/runtime.go b/internal/runtime/runtime.go index 066c5e57..ce53b397 100644 --- a/internal/runtime/runtime.go +++ b/internal/runtime/runtime.go @@ -30,12 +30,12 @@ var ( ) func (r Runtime) Run(ctx context.Context, prog Program) (err error) { - enter := prog.Ports[PortAddr{Path: "in", Port: "enter"}] + enter := prog.Ports[PortAddr{Path: "in", Port: "start"}] if enter == nil { return ErrStartPortNotFound } - exit := prog.Ports[PortAddr{Path: "out", Port: "exit"}] + exit := prog.Ports[PortAddr{Path: "out", Port: "stop"}] if exit == nil { return ErrExitPortNotFound } diff --git a/pkg/sourcecode/sourcecode.go b/pkg/sourcecode/sourcecode.go index cc417920..356d2429 100644 --- a/pkg/sourcecode/sourcecode.go +++ b/pkg/sourcecode/sourcecode.go @@ -197,11 +197,11 @@ func (e EntityRef) String() string { type Const struct { Ref *EntityRef `json:"ref,omitempty"` - Value *Msg `json:"value,omitempty"` + Value *Message `json:"value,omitempty"` Meta Meta `json:"meta,omitempty"` } -type Msg struct { +type Message struct { TypeExpr ts.Expr `json:"typeExpr,omitempty"` Bool *bool `json:"bool,omitempty"` Int *int `json:"int,omitempty"` @@ -212,6 +212,10 @@ type Msg struct { Meta Meta `json:"meta,omitempty"` } +func (m Message) String() string { + return "message" // TODO +} + type IO struct { In map[string]Port `json:"in,omitempty"` Out map[string]Port `json:"out,omitempty"` @@ -265,10 +269,10 @@ func (r ConnectionReceiver) String() string { // ConnectionSenderSide unlike ReceiverConnectionSide could refer to constant. type ConnectionSenderSide struct { - PortAddr *PortAddr `json:"portAddr,omitempty"` - ConstRef *EntityRef `json:"constRef,omitempty"` // Only sugared form - Selectors []string `json:"selectors,omitempty"` - Meta Meta `json:"meta,omitempty"` + PortAddr *PortAddr `json:"portAddr,omitempty"` + Const *Const `json:"literal,omitempty"` + Selectors []string `json:"selectors,omitempty"` + Meta Meta `json:"meta,omitempty"` } func (s ConnectionSenderSide) String() string { @@ -280,8 +284,12 @@ func (s ConnectionSenderSide) String() string { } var result string - if s.ConstRef != nil { - result = s.ConstRef.String() + if s.Const != nil { + if s.Const.Ref != nil { + result = s.Const.Ref.String() + } else { + result = s.Const.Value.String() + } } else { result = s.PortAddr.String() } diff --git a/pkg/typesystem/resolver_test.go b/pkg/typesystem/resolver_test.go index 1e4d33da..09004334 100644 --- a/pkg/typesystem/resolver_test.go +++ b/pkg/typesystem/resolver_test.go @@ -484,13 +484,13 @@ func TestExprResolver_Resolve(t *testing.T) { //nolint:maintidx h.ParamWithNoConstr("p1"), h.ParamWithNoConstr("p2"), ), - "int": h.BaseDef(), - "str": h.BaseDef(), - "vec": h.BaseDef(h.ParamWithNoConstr("a")), - "map": h.BaseDef(h.ParamWithNoConstr("a"), h.ParamWithNoConstr("b")), + "int": h.BaseDef(), + "string": h.BaseDef(), + "vec": h.BaseDef(h.ParamWithNoConstr("a")), + "map": h.BaseDef(h.ParamWithNoConstr("a"), h.ParamWithNoConstr("b")), } return testcase{ - expr: h.Inst("t1", h.Inst("int"), h.Inst("str")), + expr: h.Inst("t1", h.Inst("int"), h.Inst("string")), scope: scope, prepareValidator: func(v *MockexprValidatorMockRecorder) { v.Validate(gomock.Any()).AnyTimes().Return(nil) @@ -503,7 +503,7 @@ func TestExprResolver_Resolve(t *testing.T) { //nolint:maintidx t2 := ts.NewTrace(&t1, ts.DefaultStringer("int")) t.ShouldTerminate(t2, scope).Return(false, nil) - t3 := ts.NewTrace(&t1, ts.DefaultStringer("str")) + t3 := ts.NewTrace(&t1, ts.DefaultStringer("string")) t.ShouldTerminate(t3, scope).Return(false, nil) t4 := ts.NewTrace(&t1, ts.DefaultStringer("vec")) @@ -521,12 +521,12 @@ func TestExprResolver_Resolve(t *testing.T) { //nolint:maintidx t8 := ts.NewTrace(&t5, ts.DefaultStringer("p2")) t.ShouldTerminate(t8, scope).Return(false, nil) - t9 := ts.NewTrace(&t8, ts.DefaultStringer("str")) + t9 := ts.NewTrace(&t8, ts.DefaultStringer("string")) t.ShouldTerminate(t9, scope).Return(false, nil) }, want: h.Inst( "vec", - h.Inst("map", h.Inst("int"), h.Inst("str")), + h.Inst("map", h.Inst("int"), h.Inst("string")), ), } }, diff --git a/pkg/typesystem/subtype_checker_test.go b/pkg/typesystem/subtype_checker_test.go index fe5d8a50..76d10298 100644 --- a/pkg/typesystem/subtype_checker_test.go +++ b/pkg/typesystem/subtype_checker_test.go @@ -86,7 +86,7 @@ func TestCompatChecker_Check(t *testing.T) { //nolint:maintidx }, { // vec <: vec (impossible if checker used by resolver) name: "insts, subtype has more args count", - subType: h.Inst("vec", h.Inst("int"), h.Inst("str")), + subType: h.Inst("vec", h.Inst("int"), h.Inst("string")), superType: h.Inst("vec", h.Inst("int")), terminator: func(mtmr *MockrecursionTerminatorMockRecorder) { t := ts.Trace{} @@ -100,10 +100,10 @@ func TestCompatChecker_Check(t *testing.T) { //nolint:maintidx // args compatibility { name: "insts, one subtype's subtype incompat", // vec <: vec - subType: h.Inst("vec", h.Inst("str")), + subType: h.Inst("vec", h.Inst("string")), superType: h.Inst( "vec", - h.Union(h.Inst("str"), h.Inst("int")), + h.Union(h.Inst("string"), h.Inst("int")), ), subtypeTrace: ts.Trace{}, supertypeTrace: ts.Trace{}, @@ -121,7 +121,7 @@ func TestCompatChecker_Check(t *testing.T) { //nolint:maintidx subType: h.Inst( "vec", h.Union( - h.Inst("str"), + h.Inst("string"), h.Inst("int"), ), ), diff --git a/pkg/typesystem/typesystem_test.go b/pkg/typesystem/typesystem_test.go index b418d81b..4446af91 100644 --- a/pkg/typesystem/typesystem_test.go +++ b/pkg/typesystem/typesystem_test.go @@ -152,7 +152,7 @@ func TestExpr_String(t *testing.T) { Args: []ts.Expr{ { Inst: &ts.InstExpr{ - Ref: ts.DefaultStringer("str"), + Ref: ts.DefaultStringer("string"), }, }, }, @@ -166,7 +166,7 @@ func TestExpr_String(t *testing.T) { Inst: &ts.InstExpr{ Ref: ts.DefaultStringer("map"), Args: []ts.Expr{ - {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("str")}}, + {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("string")}}, }, }, }, @@ -178,7 +178,7 @@ func TestExpr_String(t *testing.T) { Inst: &ts.InstExpr{ Ref: ts.DefaultStringer("map"), Args: []ts.Expr{ - {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("str")}}, + {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("string")}}, {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("bool")}}, }, }, @@ -191,7 +191,7 @@ func TestExpr_String(t *testing.T) { Inst: &ts.InstExpr{ Ref: ts.DefaultStringer("map"), Args: []ts.Expr{ - {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("str")}}, + {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("string")}}, { Inst: &ts.InstExpr{ Ref: ts.DefaultStringer("vec"), @@ -284,7 +284,7 @@ func TestExpr_String(t *testing.T) { Struct: map[string]ts.Expr{ "name": { Inst: &ts.InstExpr{ - Ref: ts.DefaultStringer("str"), + Ref: ts.DefaultStringer("string"), }, }, }, @@ -297,7 +297,7 @@ func TestExpr_String(t *testing.T) { expr: ts.Expr{ Lit: &ts.LitExpr{ Struct: map[string]ts.Expr{ - "name": {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("str")}}, + "name": {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("string")}}, "age": {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("int")}}, }, }, @@ -331,7 +331,7 @@ func TestExpr_String(t *testing.T) { Lit: &ts.LitExpr{ Union: []ts.Expr{ {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("int")}}, - {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("str")}}, + {Inst: &ts.InstExpr{Ref: ts.DefaultStringer("string")}}, }, }, }, diff --git a/std/builtin/arithmetic.neva b/std/builtin/arithmetic.neva index 66bad920..c164db5f 100644 --- a/std/builtin/arithmetic.neva +++ b/std/builtin/arithmetic.neva @@ -1,20 +1,20 @@ // All arithmetic operations support IStreamHandler // and thus could be used with bridges. -components { - #runtime_func(int IntAdder, float FloatAdder, string StringAdder) +component { + #extern(int IntAdder, float FloatAdder, string StringAdder) pub Adder< T int | float | string >(seq stream) (res T) - #runtime_func(int IntSubstractor, float FloatSubstractor) + #extern(int IntSubstractor, float FloatSubstractor) pub Substractor< T int | float >(seq stream) (res T) - #runtime_func(int IntMultiplier, float FloatMultiplier) + #extern(int IntMultiplier, float FloatMultiplier) pub Multiplier(seq stream) (res T) - #runtime_func(int IntDivider, float FloatDivider) + #extern(int IntDivider, float FloatDivider) pub Divider(seq stream) (res T) } \ No newline at end of file diff --git a/std/builtin/base.neva b/std/builtin/base.neva index ab91edfa..e14f23bc 100644 --- a/std/builtin/base.neva +++ b/std/builtin/base.neva @@ -1,4 +1,4 @@ -types { +type { pub any pub maybe @@ -11,37 +11,41 @@ types { pub list pub stream maybe + pub error struct { - msg string + text string child maybe } } -components { - #runtime_func(Destructor) - pub Destructor(msg any) () +component { + #extern(Emitter) + pub Emitter() (msg T) - #runtime_func(Distributor) - pub Distributor() (msg T) + #extern(Destructor) + pub Destructor(msg any) () - #runtime_func(Blocker) + #extern(Blocker) pub Blocker(cond any, data T) (data T) - #runtime_func(Checker) + #extern(Checker) pub Checker(opt maybe) (some T, none struct{}) - #struct_inports - #runtime_func(StructBuilder) + #autoports + #extern(StructBuilder) pub StructBuilder () (msg T) - #runtime_func(StructSelector) + #extern(StructSelector) pub StructSelector(msg struct {}) (msg T) - #runtime_func(string StrLen, list ListLen, map MapLen) + #extern(string StrLen, list ListLen, map MapLen) pub Len< T string | list | map - >(msg T) (n int) + >(data T) (n int) + + #extern(LinePrinter) + pub Printer(data T) (sig T) - #runtime_func(LinePrinter) - pub Printer(msg T) (sig T) + #extern(Ranger) + pub Ranger(n int) (stream) } \ No newline at end of file diff --git a/std/builtin/bridges.neva b/std/builtin/bridges.neva index 2aed0a63..b2d655bc 100644 --- a/std/builtin/bridges.neva +++ b/std/builtin/bridges.neva @@ -1,11 +1,11 @@ // Bridges are basically decorators that works over DI API // they serve as adapters for stream handlers and outside world: -interfaces { - IStreamHandler(seq stream) (res T) +interface { + pub IStreamHandler(seq stream) (res T) } -components { +component { pub PortBridge([p] T) (res T) { nodes { streamer PortStreamer diff --git a/std/builtin/logic.neva b/std/builtin/logic.neva index 6832392d..41b41c11 100644 --- a/std/builtin/logic.neva +++ b/std/builtin/logic.neva @@ -3,31 +3,31 @@ // So when logic operation happens without stream - streamer must be used. // And that's BTW is the reason to for more handy `yes, no, b` API. -components { - #runtime_func(Neg) +component { + #extern(Neg) pub Neg(arg bool) (b bool) - #runtime_func(And) + #extern(And) pub And(args stream) (y struct{}, n struct{}, b bool) - #runtime_func(Or) + #extern(Or) pub Or(args stream) (y struct{}, n struct{}, b bool) - #runtime_func(Eq) + #extern(Eq) pub Eq(args stream) (y struct{}, n struct{}, b bool) - #runtime_func(NotEq) + #extern(NotEq) pub NotEq(args stream) (y struct{}, n struct{}, b bool) - #runtime_func(Less) + #extern(Less) pub Less(args stream) (y struct{}, n struct{}, b bool) - #runtime_func(More) + #extern(More) pub More(args stream) (y struct{}, n struct{}, b bool) - #runtime_func(LessOrEq) + #extern(LessOrEq) pub LessOrEq(args stream) (y struct{}, n struct{}, b bool) - #runtime_func(MoreOrEq) + #extern(MoreOrEq) pub MoreOrEq(args stream) (y struct{}, n struct{}, b bool) } \ No newline at end of file diff --git a/std/builtin/streamers.neva b/std/builtin/streamers.neva index 8f25d9e2..0f746639 100644 --- a/std/builtin/streamers.neva +++ b/std/builtin/streamers.neva @@ -2,20 +2,20 @@ // It allows to iterate over array ports, lists and maps. // It also allows to use bridges (and to create custom bridges when needed). -types { +type { pub MapEntry struct { k string v T } } -components { - #runtime_func(PortStreamer) +component { + #extern(PortStreamer) pub PortStreamer([p] T) (seq stream) - #runtime_func(ListStreamer) + #extern(ListStreamer) pub ListStreamer(l list) (seq stream) - #runtime_func(MapStreamer) + #extern(MapStreamer) pub MapStreamer(m map) (seq stream) } \ No newline at end of file diff --git a/std/io/io.neva b/std/io/io.neva index af962b92..f27b6d44 100644 --- a/std/io/io.neva +++ b/std/io/io.neva @@ -1,4 +1,7 @@ -components { - #runtime_func(Reader) +component { + #extern(Reader) pub Reader(sig any) (s string) + + #extern(StreamReader) + pub StreamReader(start any, stop any) (seq stream) } \ No newline at end of file diff --git a/std/lists/lists.neva b/std/lists/lists.neva index 571ec594..4bdee861 100644 --- a/std/lists/lists.neva +++ b/std/lists/lists.neva @@ -1,22 +1,22 @@ -components { - #runtime_func(ListAccumulator) +component { + #extern(ListAccumulator) pub Accumulator(els stream) (res list) - #runtime_func(ListBuilder) + #extern(ListBuilder) pub Builder ([els] T) (res list) - #runtime_func(ListConcatenator) + #extern(ListConcatenator) pub Concatenator (lsts stream>) (res list) - #runtime_func(ListPusher) + #extern(ListPusher) pub Pusher (l list, el T) (res list) - #runtime_func(ListUpdater) + #extern(ListUpdater) pub Updater (l list, i int, el T) (res list, err error) - #runtime_func(ListSelector) + #extern(ListSelector) pub Selector(l list, i int) (ok T, miss int) - #runtime_func(ListSlicer) + #extern(ListSlicer) pub Slicer(l list, from int, to int) (res list, err error) } \ No newline at end of file diff --git a/std/maps/maps.neva b/std/maps/maps.neva index 2a3ef870..aca05751 100644 --- a/std/maps/maps.neva +++ b/std/maps/maps.neva @@ -1,22 +1,22 @@ -components { - #runtime_func(MapAccumulator) +component { + #extern(MapAccumulator) pub Accumulator(ents stream>) (res map) - #runtime_func(MapBuilder) + #extern(MapBuilder) pub Builder ([ents] MapEntry) (res map) - #runtime_func(MapDiscriminator) + #extern(MapDiscriminator) pub Discriminator(maps stream>) (res map) - #runtime_func(MapIntersector) + #extern(MapIntersector) pub Intersector(maps stream>) (res map) - #runtime_func(MapMerger) + #extern(MapMerger) pub Merger(maps stream>) (res map) - #runtime_func(MapUpdater) + #extern(MapUpdater) pub Updater (m map, k string, v T) (res map) - #runtime_func(MapSelector) + #extern(MapSelector) pub Selector(m map, k string) (ok T, miss string) } \ No newline at end of file diff --git a/std/math/math.neva b/std/math/math.neva index b8e91b7b..3fdc8381 100644 --- a/std/math/math.neva +++ b/std/math/math.neva @@ -2,13 +2,13 @@ // Just like them, these implement IStreamHandler // and thus could be used with bridges. -components { - #runtime_func(int PowInts, float PowFloats) +component { + #extern(int PowInts, float PowFloats) pub Pow(seq stream) (res T) - #runtime_func(int ModInts, float ModFloats) + #extern(int ModInts, float ModFloats) pub Mod(seq stream) (res T) - #runtime_func(int AbsInts, float AbsFloats) + #extern(int AbsInts, float AbsFloats) pub Abs(seq stream) (res T) } \ No newline at end of file diff --git a/std/os/os.neva b/std/os/os.neva new file mode 100644 index 00000000..cf3895d5 --- /dev/null +++ b/std/os/os.neva @@ -0,0 +1,7 @@ +type ArgsReaderResult { + args list + len int +} + +#extern(OsArgsReader) +component ArgsReader(sig any) (res ArgsReaderResult) \ No newline at end of file diff --git a/std/strconv/strconv.neva b/std/strconv/strconv.neva index 1e7cdbd4..823c86c3 100644 --- a/std/strconv/strconv.neva +++ b/std/strconv/strconv.neva @@ -1,12 +1,10 @@ -const { - base 10 -} +#extern(BoolParser) +pub component BoolParser(s string) (res bool, err error)Q -components { - #runtime_func(BoolParser) - pub BoolParser(s string) (res bool, err error) +const base = 10 - #runtime_func(int IntParser, float FloatParser) +component { + #extern(int IntParser, float FloatParser) pub BaseNumParser(s string, base int) (res T, err error) pub NumParser(s string) (res T, err error) { diff --git a/std/strings/strings.neva b/std/strings/strings.neva index 5bd27964..08f2ba0f 100644 --- a/std/strings/strings.neva +++ b/std/strings/strings.neva @@ -1,25 +1,25 @@ -components { - #runtime_func(StringConcatenator) +component { + #extern(StringConcatenator) pub Concatenator(seq stream) (res string) - #runtime_func(StringTrimmer) + #extern(StringTrimmer) pub Trimmer(s string) (res string) - #runtime_func(StringUpperCaser) + #extern(StringUpperCaser) pub UpperCaser(s string) (res string) - #runtime_func(StringLowerCaser) + #extern(StringLowerCaser) pub LowerCaser(s string) (res string) - #runtime_func(StringOccurrenceChecker) + #extern(StringOccurrenceChecker) pub OccurrenceChecker(s string, subs string) (b bool) - #runtime_func(StringPrefixChecker) + #extern(StringPrefixChecker) pub PrefixChecker(s string, pref string) (b bool) - #runtime_func(StringSuffixChecker) + #extern(StringSuffixChecker) pub SuffixChecker(s string, suff string) (b bool) - #runtime_func(StringSlicer) + #extern(StringSlicer) pub Slicer(s string, from int, to int) (s string, err error) } \ No newline at end of file