bug: multiple generated solutions
parent
a2d373d426
commit
e5c5b3e101
29
src/lang.bnf
29
src/lang.bnf
|
|
@ -1,29 +1,16 @@
|
||||||
|
|
||||||
|
|
||||||
<program> ::= <_n> <program$1> <_n>
|
<program> ::= <_n> <program$1> <_n>
|
||||||
|
|
||||||
<program$1> ::= <unit>
|
<program$1> ::= <unit>
|
||||||
| <unit> <_> <__n> <program$1>
|
| <unit> <_> <__n> <program$1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<unit> ::= <use_clause>
|
<unit> ::= <use_clause>
|
||||||
| <handler>
|
| <handler>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<use_clause> ::= "use" <__> <namespace>
|
<use_clause> ::= "use" <__> <namespace>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<body> ::= "{ }"
|
<body> ::= "{ }"
|
||||||
<parameters> ::= "()"
|
<parameters> ::= "()"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<namespace> ::= <identifier> | <identifier> "::" <namespace>
|
<namespace> ::= <identifier> | <identifier> "::" <namespace>
|
||||||
<static_ref> ::= "$" <identifier>
|
<static_ref> ::= "$" <identifier>
|
||||||
|
|
||||||
|
|
@ -43,19 +30,15 @@
|
||||||
<INTEGER> ::= <DIGIT> | <DIGIT> <INTEGER>
|
<INTEGER> ::= <DIGIT> | <DIGIT> <INTEGER>
|
||||||
|
|
||||||
<__n> ::= <EOL> <_n>
|
<__n> ::= <EOL> <_n>
|
||||||
<_n> ::= <NOTHING>
|
<_n> ::= <NOTHING> | <_n$1>
|
||||||
| <SPACE> | <TAB> | <EOL>
|
<_n$1> ::= <SPACE> | <TAB> | <EOL>
|
||||||
| <SPACE> <_n>
|
| <SPACE> <_n$1>
|
||||||
| <TAB> <_n>
|
| <TAB> <_n$1>
|
||||||
| <EOL> <_n>
|
| <EOL> <_n$1>
|
||||||
<_> ::= <NOTHING> | <__>
|
<_> ::= <NOTHING> | <__>
|
||||||
<__> ::= <SPACE> | <TAB>
|
<__> ::= <SPACE> | <TAB>
|
||||||
| <SPACE> <__>
|
| <SPACE> <__>
|
||||||
| <TAB> <__>
|
| <TAB> <__>
|
||||||
|
|
||||||
<NOTHING> ::= ""
|
<NOTHING> ::= ""
|
||||||
<SPACE> ::= " "
|
<SPACE> ::= " "
|
||||||
<EOL> ::= "
|
|
||||||
" | "
|
|
||||||
"
|
|
||||||
<TAB> ::= " "
|
|
||||||
|
|
@ -14,7 +14,8 @@ use crate::transformers::base::Program;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
||||||
let input = include_str!("lang.bnf");
|
let input = include_str!("lang.bnf").to_owned()
|
||||||
|
+ "\n<EOL> ::= \"\n\" | \"\r\n\"\n<TAB> ::= \"\t\"";
|
||||||
let grammar: Grammar = input.parse().unwrap();
|
let grammar: Grammar = input.parse().unwrap();
|
||||||
|
|
||||||
let vm_file = include_str!("person.vm");
|
let vm_file = include_str!("person.vm");
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
use vlib::Console
|
use vlib::thing::foo::bar::Console
|
||||||
|
|
||||||
use vlib::Map
|
use vlib::Map
|
||||||
Loading…
Reference in New Issue