!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); } }