some tests failing because things have been made reference in vector, but grammer actually generates the state set for the real grammer in 2 minutes or so after a day of profiling and bugfixing, so this is gonna be committed.

This commit is contained in:
Nathan Braswell
2015-08-05 03:43:34 -04:00
parent e1dbe08c0a
commit dec9b7d0bd
13 changed files with 151 additions and 60 deletions

View File

@@ -1,5 +1,6 @@
# comment
a = b ;
Goal = a ;
a = b | rec ;
b = "c":named_c ;
b = c "d":dname ;
c = "a" | d ;
@@ -9,3 +10,4 @@ e = f | ;
f = ;
post_null = "hi" ;
post_non_null = "bye" ;
rec = "hmm" rec | ;

View File

@@ -7,9 +7,9 @@ import symbol:*
fun main():int {
//var a = load_grammer(read_file(string("../krakenGrammer.kgm")))
var a = load_grammer(read_file(string("../krakenGrammer.kgm")))
/*var a = load_grammer(read_file(string("grammer.kgm")))*/
var a = load_grammer(read_file(string("grammer2.kgm")))
//var a = load_grammer(read_file(string("grammer2.kgm")))
println(a.to_string())
var doFirstSet = fun() {
a.calculate_first_set()

View File

@@ -16,3 +16,6 @@ true
all:
4
5
all ref:
4
5

View File

@@ -27,5 +27,7 @@ fun main():int {
println("all:")
s.for_each( fun(it: int) println(it); )
println("all ref:")
s.for_each( fun(it: ref int) println(it); )
return 0
}

View File

@@ -6,6 +6,8 @@
15513
3.7000007.7000007.70000015.700000
123456789101112
with references
123456789101112
Constructed: 0
Copied: 0 to 1
Copied: 1 to 2

View File

@@ -69,6 +69,11 @@ fun main(): int {
vector(1,2,3,4,5,6,7,8,9,10,11,12).for_each(fun(i:int) { print(i); })
println()
// with references
println("with references")
vector(1,2,3,4,5,6,7,8,9,10,11,12).for_each(fun(i: ref int) { print(i); })
println()
var desVec: *vector<AbleToBeDestroyed> = new<vector<AbleToBeDestroyed>>()->construct();
var testDestruct.construct(0): AbleToBeDestroyed;
desVec->addEnd(testDestruct);