Warning: session_start(): open(/var/lib/php/sessions/sess_b1n6hs3bm1e17kbjjtl1u9hn1p, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!759
static boolean printNulls = true, full = true;
static L inputs = toLinesFullTrim([[
hello
"hello!"
hello you
hello < you
[hello]
[hello] [you]
[hello < you]
[ ? < Is < it < safe < to < allow [PowerTOP] to [make < all < the < changes < located on < the < Tunables < tab] ]
[ I < was < going to < create < a < startup script < for < it ]
]]);
static S snlRules = [[
// highest (strongest binding) level
= idword
= subword
? = idword
! = idword
= word
= word
// juxtaposition on highest level
= word
// bracketing takes us to highest level
[ ] = subword
( ) = subword
// < is intermediate
= arrows
< = arrows
= lowest // allow empty here
= lowest
]];
p {
for (S input : inputs) {
Explain exp = full
? explainFull(input, snlRules, "lowest")
: explain(input, snlRules, "lowest");
print();
print("PARSING: " + input);
print();
if (exp == null)
print("No parse");
else {
//printStructure(exp.e);
printTree(0, exp);
}
print();
}
}
static void printTree(int indent, Explain e) {
if (e == null) {
// this would print "null" for every etc
if (printNulls)
print(indent(indent) + "null");
} else {
print(indent(indent) + e.className() + " | " + e.string());
for (Explain sub : e.subs)
printTree(indent+2, sub);
}
}