mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.10.3.1
This commit is contained in:
@@ -27,7 +27,7 @@ public class GfmlLxr_ {
|
||||
GfmlTkn tkn = GfmlTkn_.singleton_(key, raw, val, cmd);
|
||||
return GfmlLxr_.solo_(key, tkn);
|
||||
}
|
||||
@gplx.Internal protected static GfmlLxr frame_(String key, GfmlFrame frame, String bgn, String end) {return GfmlLxr_frame.new_(key, frame, bgn, end, GfmlBldrCmd_pendingTkns_add._, GfmlBldrCmd_frameEnd.data_());}
|
||||
@gplx.Internal protected static GfmlLxr frame_(String key, GfmlFrame frame, String bgn, String end) {return GfmlLxr_frame.new_(key, frame, bgn, end, GfmlBldrCmd_pendingTkns_add.Instance, GfmlBldrCmd_frameEnd.data_());}
|
||||
public static final GfmlLxr Null = new GfmlLxr_null();
|
||||
public static final String CmdTknChanged_evt = "Changed";
|
||||
public static GfmlLxr as_(Object obj) {return obj instanceof GfmlLxr ? (GfmlLxr)obj : null;}
|
||||
@@ -90,7 +90,7 @@ class GfmlLxr_group implements GfmlLxr {
|
||||
hookLength = trie.LastMatchCount;
|
||||
}
|
||||
if (ignoreOutput) return GfmlTkn_.IgnoreOutput;
|
||||
String raw = sb.Xto_str_and_clear();
|
||||
String raw = sb.To_str_and_clear();
|
||||
return outputTkn.MakeNew(raw, raw);
|
||||
}
|
||||
public GfmlLxr SubLxr() {throw Err_sublxr();}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class GfmlTrie {
|
||||
for (int i = 0; i < rv.length; i++)
|
||||
rv[i] = String_.cast(symbols.Get_at(i));
|
||||
return rv;
|
||||
} Ordered_hash symbols = Ordered_hash_.new_();
|
||||
} Ordered_hash symbols = Ordered_hash_.New();
|
||||
public int LastMatchCount; // PERF: prop is faster than method
|
||||
public Object FindMatch(CharStream stream) {
|
||||
Object result = null; int moveCount = 0; LastMatchCount = 0;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class GfmlFld {
|
||||
rv.defaultTkn = defaultTkn; // FIXME: defaultTkn.clone_()
|
||||
return rv;
|
||||
}
|
||||
public String To_str() {String_bldr sb = String_bldr_.new_(); this.To_str(sb); return sb.Xto_str_and_clear();}
|
||||
public String To_str() {String_bldr sb = String_bldr_.new_(); this.To_str(sb); return sb.To_str_and_clear();}
|
||||
public void To_str(String_bldr sb) {sb.Add_fmt("name={0} typeKey={1}", name, typeKey);}
|
||||
|
||||
public static final GfmlFld Null = new_(false, GfmlItmKeys.NullKey, GfmlType_.AnyKey);
|
||||
|
||||
@@ -29,6 +29,6 @@ public class GfmlFldList {
|
||||
hash.Del(fld);
|
||||
hash.Del(fld.Name());
|
||||
}
|
||||
Ordered_hash hash = Ordered_hash_.new_();
|
||||
Ordered_hash hash = Ordered_hash_.New();
|
||||
public static GfmlFldList new_() {return new GfmlFldList();} GfmlFldList() {}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ class GfmlFldPool {
|
||||
}
|
||||
}
|
||||
}
|
||||
Ordered_hash keyedRegy = Ordered_hash_.new_();
|
||||
Ordered_hash keyedRegy = Ordered_hash_.New();
|
||||
public static GfmlFldPool new_(GfmlType type) {
|
||||
GfmlFldPool rv = new GfmlFldPool();
|
||||
rv.InitByType(type);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class GfmlDoc {
|
||||
@gplx.Internal protected void RootLxr_set(GfmlLxr v) {rootLxr = v;}
|
||||
@gplx.Internal protected void Clear() {
|
||||
usrMsgs.Clear();
|
||||
rootNde = GfmlNde.named_(GfmlTkn_.cmd_("tkn.gfml.root_tkn", GfmlBldrCmd_pendingTkns_add._), GfmlType_.Null);
|
||||
rootNde = GfmlNde.named_(GfmlTkn_.cmd_("tkn.gfml.root_tkn", GfmlBldrCmd_pendingTkns_add.Instance), GfmlType_.Null);
|
||||
rootNde.DocPos_(GfmlDocPos_.Root);
|
||||
}
|
||||
@gplx.Internal protected static GfmlDoc new_() {
|
||||
@@ -41,5 +41,5 @@ public class GfmlDoc {
|
||||
// public GfmlTkn BgnBrace() {return bgnBrace;} public GfmlDocEditor BgnBrace_(GfmlTkn v) {bgnBrace = v; return this;} GfmlTkn bgnBrace = GfmlTkn_.new_("{", "");
|
||||
// public GfmlTkn EndBrace() {return endBrace;} public GfmlDocEditor EndBrace_(GfmlTkn v) {endBrace = v; return this;} GfmlTkn endBrace = GfmlTkn_.new_("}", "");
|
||||
// public GfmlTkn Hnd() {return hnd;} public GfmlDocEditor Hnd_(GfmlTkn v) {hnd = v; return this;} GfmlTkn hnd = GfmlTkn_.new_(":", "");
|
||||
// public static final GfmlDocEditor _ = new GfmlDocEditor(); GfmlDocEditor() {}
|
||||
// public static final GfmlDocEditor Instance = new GfmlDocEditor(); GfmlDocEditor() {}
|
||||
// }
|
||||
|
||||
@@ -41,11 +41,11 @@ class GfmlDocLxrs {
|
||||
rootLxr.SubLxr_Add(ary);
|
||||
}
|
||||
public static GfmlLxr Root_lxr() {
|
||||
GfmlTkn txtTkn = GfmlTkn_.cmd_("tkn:text", GfmlBldrCmd_dataTkn_set._);
|
||||
GfmlTkn txtTkn = GfmlTkn_.cmd_("tkn:text", GfmlBldrCmd_dataTkn_set.Instance);
|
||||
return GfmlLxr_.general_("lxr:root", txtTkn);
|
||||
}
|
||||
public static GfmlLxr Whitespace_lxr() {
|
||||
GfmlTkn tkn = GfmlTkn_.cmd_("key:gfml.whitespace_0", GfmlBldrCmd_whitespace._);
|
||||
GfmlTkn tkn = GfmlTkn_.cmd_("key:gfml.whitespace_0", GfmlBldrCmd_whitespace.Instance);
|
||||
GfmlLxr rv = GfmlLxr_.range_("lxr:gfml.whitespace_0", String_.Ary(" ", String_.Tab, String_.CrLf, String_.Lf), tkn, false);
|
||||
return rv;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ class GfmlDocLxrs {
|
||||
public static GfmlLxr QuoteFold_lxr() {
|
||||
GfmlLxr rv = GfmlLxr_.frame_("gfml.quote_fold_0", GfmlFrame_.quote_(), "^'", "'^");
|
||||
|
||||
GfmlTkn tkn = GfmlTkn_.valConst_("key:gfml.quote_fold_0_whitespace", GfmlTkn_.NullVal, GfmlBldrCmd_whitespace._);
|
||||
GfmlTkn tkn = GfmlTkn_.valConst_("key:gfml.quote_fold_0_whitespace", GfmlTkn_.NullVal, GfmlBldrCmd_whitespace.Instance);
|
||||
GfmlLxr whitespace = GfmlLxr_.range_("lxr:gfml.quote_fold_0_whitespace", String_.Ary(String_.Tab, String_.CrLf, String_.Lf), tkn, false);
|
||||
GfmlLxr escapeBgn = lxr_escape_("gfml.quote_fold_0_escape_bgn", "^'^'", "^'");
|
||||
GfmlLxr escapeEnd = lxr_escape_("gfml.quote_fold_0_escape_end", "'^'^", "'^");
|
||||
@@ -114,17 +114,17 @@ class GfmlDocLxrs {
|
||||
Comment1_lxr());
|
||||
return rv;
|
||||
}
|
||||
public static GfmlLxr ElmKey_lxr() {return lxr_symbol_("gfml.elm_key_0", "=", GfmlBldrCmd_elemKey_set._);}
|
||||
public static GfmlLxr NdeHeader_lxr() {return lxr_symbol_("gfml.node_name_0", ":", GfmlBldrCmd_ndeName_set._);}
|
||||
public static GfmlLxr NdeInline_lxr() {return lxr_symbol_("gfml.node_inline_0", ";", GfmlBldrCmd_ndeInline._);}
|
||||
public static GfmlLxr NdeBodyBgn_lxr() {return lxr_symbol_("gfml.node_body_0_begin", "{", GfmlBldrCmd_ndeBody_bgn._);}
|
||||
public static GfmlLxr ElmKey_lxr() {return lxr_symbol_("gfml.elm_key_0", "=", GfmlBldrCmd_elemKey_set.Instance);}
|
||||
public static GfmlLxr NdeHeader_lxr() {return lxr_symbol_("gfml.node_name_0", ":", GfmlBldrCmd_ndeName_set.Instance);}
|
||||
public static GfmlLxr NdeInline_lxr() {return lxr_symbol_("gfml.node_inline_0", ";", GfmlBldrCmd_ndeInline.Instance);}
|
||||
public static GfmlLxr NdeBodyBgn_lxr() {return lxr_symbol_("gfml.node_body_0_begin", "{", GfmlBldrCmd_ndeBody_bgn.Instance);}
|
||||
public static GfmlLxr NdeBodyEnd_lxr() {return lxr_symbol_("gfml.node_body_0_end", "}", GfmlBldrCmd_frameEnd.nde_(GfmlNdeSymType.BodyEnd));}
|
||||
public static GfmlLxr NdePropBgn_lxr() {return lxr_symbol_("lxr.gfml.node_prop_0_bgn", "[", GfmlBldrCmd_ndeProp_bgn._);}
|
||||
public static GfmlLxr NdePropBgn_lxr() {return lxr_symbol_("lxr.gfml.node_prop_0_bgn", "[", GfmlBldrCmd_ndeProp_bgn.Instance);}
|
||||
public static GfmlLxr NdePropEnd_lxr() {return lxr_symbol_("lxr.gfml.node_prop_0_end", "]", GfmlBldrCmd_frameEnd.nde_(GfmlNdeSymType.PrpEnd));}
|
||||
public static GfmlLxr NdeDot_lxr() {return lxr_symbol_("gfml.node_drill_0", ".", GfmlBldrCmd_ndeDot._);}
|
||||
public static GfmlLxr NdeHdrBgn_lxr() {return lxr_symbol_("lxr.gfml.node_hdr_0_bgn", "(", GfmlBldrCmd_ndeHdr_bgn._);}
|
||||
public static GfmlLxr NdeHdrEnd_lxr() {return lxr_symbol_("lxr.gfml.node_hdr_0_end", ")", GfmlBldrCmd_ndeHdr_end._);}
|
||||
public static GfmlLxr AtrSpr_lxr() {return lxr_symbol_("lxr.gfml.atrSpr", ",", GfmlBldrCmd_atrSpr._);}
|
||||
static GfmlLxr lxr_escape_(String key, String raw, String escape) {return GfmlLxr_.symbol_(key, raw, escape, GfmlBldrCmd_pendingTkns_add._);}
|
||||
public static GfmlLxr NdeDot_lxr() {return lxr_symbol_("gfml.node_drill_0", ".", GfmlBldrCmd_ndeDot.Instance);}
|
||||
public static GfmlLxr NdeHdrBgn_lxr() {return lxr_symbol_("lxr.gfml.node_hdr_0_bgn", "(", GfmlBldrCmd_ndeHdr_bgn.Instance);}
|
||||
public static GfmlLxr NdeHdrEnd_lxr() {return lxr_symbol_("lxr.gfml.node_hdr_0_end", ")", GfmlBldrCmd_ndeHdr_end.Instance);}
|
||||
public static GfmlLxr AtrSpr_lxr() {return lxr_symbol_("lxr.gfml.atrSpr", ",", GfmlBldrCmd_atrSpr.Instance);}
|
||||
static GfmlLxr lxr_escape_(String key, String raw, String escape) {return GfmlLxr_.symbol_(key, raw, escape, GfmlBldrCmd_pendingTkns_add.Instance);}
|
||||
static GfmlLxr lxr_symbol_(String key, String raw, GfmlBldrCmd cmd) {return GfmlLxr_.symbol_(key, raw, raw, cmd);}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.gfml; import gplx.*;
|
||||
import gplx.core.strings.*;
|
||||
public class GfmlDocWtr_ {
|
||||
public String Xto_str_and_clear() {return sb.Xto_str_and_clear();}
|
||||
public String To_str_and_clear() {return sb.To_str_and_clear();}
|
||||
public void BuildAttrib(GfmlAtr atr) {Build(atr);}
|
||||
public void BuildNode(GfmlNde nde) {Build(nde);}
|
||||
void Build(GfmlItm owner) {
|
||||
@@ -35,6 +35,6 @@ public class GfmlDocWtr_ {
|
||||
public static String xtoStr_(GfmlNde nde) {
|
||||
GfmlDocWtr_ wtr = new GfmlDocWtr_();
|
||||
wtr.BuildNode(nde);
|
||||
return wtr.Xto_str_and_clear();
|
||||
return wtr.To_str_and_clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class GfmlUsrMsgs {
|
||||
Err rv = Err_.new_wo_type("gfml parse error");
|
||||
for (int i = 0; i < bldr.Doc().UsrMsgs().Count(); i++) {
|
||||
UsrMsg um = (UsrMsg)bldr.Doc().UsrMsgs().Get_at(i);
|
||||
rv.Args_add("err" + Int_.Xto_str(i), um.To_str());
|
||||
rv.Args_add("err" + Int_.To_str(i), um.To_str());
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import gplx.lists.*;
|
||||
class GfmlPragmaType implements GfmlPragma {
|
||||
public String KeyOfPragma() {return pragmaKey;} private String pragmaKey = "_type";
|
||||
public void Exec(GfmlBldr bldr, GfmlNde pragmaNde) {
|
||||
Ordered_hash list = Ordered_hash_.new_(); List_adp replaced = List_adp_.new_();
|
||||
Ordered_hash list = Ordered_hash_.New(); List_adp replaced = List_adp_.new_();
|
||||
for (int i = 0 ; i < pragmaNde.SubHnds().Count(); i++) {
|
||||
GfmlNde typNde = pragmaNde.SubHnds().Get_at(i);
|
||||
GfmlType type = GfmlTypeCompiler.Compile(typNde, GfmlType_.Root, bldr.TypeMgr().TypeRegy(), list);
|
||||
|
||||
@@ -33,8 +33,8 @@ class GfmlBldrCmdRegy {
|
||||
Hash_adp hash = Hash_adp_.new_();
|
||||
public static GfmlBldrCmdRegy new_() {
|
||||
GfmlBldrCmdRegy rv = new GfmlBldrCmdRegy();
|
||||
rv.Add(GfmlBldrCmd_elemKey_set._);
|
||||
rv.Add(GfmlBldrCmd_dataTkn_set._);
|
||||
rv.Add(GfmlBldrCmd_elemKey_set.Instance);
|
||||
rv.Add(GfmlBldrCmd_dataTkn_set.Instance);
|
||||
return rv;
|
||||
} GfmlBldrCmdRegy() {}
|
||||
}
|
||||
|
||||
@@ -19,22 +19,22 @@ package gplx.gfml; import gplx.*;
|
||||
class GfmlBldrCmd_pendingTkns_add implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.pendingTkns_add";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurFrame().WaitingTkns().Add(tkn);}
|
||||
public static final GfmlBldrCmd_pendingTkns_add _ = new GfmlBldrCmd_pendingTkns_add(); GfmlBldrCmd_pendingTkns_add() {}
|
||||
public static final GfmlBldrCmd_pendingTkns_add Instance = new GfmlBldrCmd_pendingTkns_add(); GfmlBldrCmd_pendingTkns_add() {}
|
||||
}
|
||||
class GfmlBldrCmd_dataTkn_set implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.elm_data";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurNdeFrame().DatTkn_set(tkn);}
|
||||
public static final GfmlBldrCmd_dataTkn_set _ = new GfmlBldrCmd_dataTkn_set(); GfmlBldrCmd_dataTkn_set() {}
|
||||
public static final GfmlBldrCmd_dataTkn_set Instance = new GfmlBldrCmd_dataTkn_set(); GfmlBldrCmd_dataTkn_set() {}
|
||||
}
|
||||
class GfmlBldrCmd_elemKey_set implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.elm_key";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurNdeFrame().KeyTkn_set(tkn);}
|
||||
public static final GfmlBldrCmd_elemKey_set _ = new GfmlBldrCmd_elemKey_set(); GfmlBldrCmd_elemKey_set() {}
|
||||
public static final GfmlBldrCmd_elemKey_set Instance = new GfmlBldrCmd_elemKey_set(); GfmlBldrCmd_elemKey_set() {}
|
||||
}
|
||||
class GfmlBldrCmd_ndeName_set implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.ndeName_set";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurNdeFrame().NdeHeader_set(tkn);}
|
||||
public static final GfmlBldrCmd_ndeName_set _ = new GfmlBldrCmd_ndeName_set(); GfmlBldrCmd_ndeName_set() {}
|
||||
public static final GfmlBldrCmd_ndeName_set Instance = new GfmlBldrCmd_ndeName_set(); GfmlBldrCmd_ndeName_set() {}
|
||||
}
|
||||
class GfmlBldrCmd_ndeBody_bgn implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.nodeBody_bgn";}
|
||||
@@ -42,37 +42,37 @@ class GfmlBldrCmd_ndeBody_bgn implements GfmlBldrCmd {
|
||||
bldr.CurNdeFrame().NdeBody_bgn(tkn);
|
||||
bldr.CurNdeFrame().BgnPos_set(bldr.StreamPos() - String_.Len(tkn.Raw()));// stream has already advanced tkn.len so subtract
|
||||
}
|
||||
public static final GfmlBldrCmd_ndeBody_bgn _ = new GfmlBldrCmd_ndeBody_bgn(); GfmlBldrCmd_ndeBody_bgn() {}
|
||||
public static final GfmlBldrCmd_ndeBody_bgn Instance = new GfmlBldrCmd_ndeBody_bgn(); GfmlBldrCmd_ndeBody_bgn() {}
|
||||
}
|
||||
class GfmlBldrCmd_ndeProp_bgn implements GfmlBldrCmd {
|
||||
public String Key() {return "cmd.gfml.ndeProp_bgn";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurNdeFrame().NdeProp_bgn(tkn);}
|
||||
public static final GfmlBldrCmd_ndeProp_bgn _ = new GfmlBldrCmd_ndeProp_bgn(); GfmlBldrCmd_ndeProp_bgn() {}
|
||||
public static final GfmlBldrCmd_ndeProp_bgn Instance = new GfmlBldrCmd_ndeProp_bgn(); GfmlBldrCmd_ndeProp_bgn() {}
|
||||
}
|
||||
class GfmlBldrCmd_ndeHdr_bgn implements GfmlBldrCmd {
|
||||
public String Key() {return "cmd.gfml.ndeHdr_bgn";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurNdeFrame().NdeParen_bgn(tkn);}
|
||||
public static final GfmlBldrCmd_ndeHdr_bgn _ = new GfmlBldrCmd_ndeHdr_bgn(); GfmlBldrCmd_ndeHdr_bgn() {}
|
||||
public static final GfmlBldrCmd_ndeHdr_bgn Instance = new GfmlBldrCmd_ndeHdr_bgn(); GfmlBldrCmd_ndeHdr_bgn() {}
|
||||
}
|
||||
class GfmlBldrCmd_ndeHdr_end implements GfmlBldrCmd {
|
||||
public String Key() {return "cmd.gfml.ndeHdr_end";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurNdeFrame().NdeParen_end(tkn);}
|
||||
public static final GfmlBldrCmd_ndeHdr_end _ = new GfmlBldrCmd_ndeHdr_end(); GfmlBldrCmd_ndeHdr_end() {}
|
||||
public static final GfmlBldrCmd_ndeHdr_end Instance = new GfmlBldrCmd_ndeHdr_end(); GfmlBldrCmd_ndeHdr_end() {}
|
||||
}
|
||||
class GfmlBldrCmd_ndeInline implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.nodeInline_exec_end";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurNdeFrame().NdeInline(tkn);}
|
||||
public static final GfmlBldrCmd_ndeInline _ = new GfmlBldrCmd_ndeInline(); GfmlBldrCmd_ndeInline() {}
|
||||
public static final GfmlBldrCmd_ndeInline Instance = new GfmlBldrCmd_ndeInline(); GfmlBldrCmd_ndeInline() {}
|
||||
}
|
||||
class GfmlBldrCmd_ndeDot implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.ndeDot";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurNdeFrame().NdeDot(tkn);}
|
||||
public static final GfmlBldrCmd_ndeDot _ = new GfmlBldrCmd_ndeDot(); GfmlBldrCmd_ndeDot() {}
|
||||
public static final GfmlBldrCmd_ndeDot Instance = new GfmlBldrCmd_ndeDot(); GfmlBldrCmd_ndeDot() {}
|
||||
}
|
||||
class GfmlBldrCmd_atrSpr implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.nodeInline_atrSpr";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {bldr.CurNdeFrame().AtrSpr(tkn);}
|
||||
public static final GfmlBldrCmd_atrSpr _ = new GfmlBldrCmd_atrSpr(); GfmlBldrCmd_atrSpr() {}
|
||||
public static final GfmlBldrCmd_atrSpr Instance = new GfmlBldrCmd_atrSpr(); GfmlBldrCmd_atrSpr() {}
|
||||
}
|
||||
class GfmlBldrCmd_frameBgn implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.frame_bgn";}
|
||||
@@ -124,5 +124,5 @@ class GfmlBldrCmd_whitespace implements GfmlBldrCmd {
|
||||
else
|
||||
bldr.CurFrame().WaitingTkns().Add(tkn);
|
||||
}
|
||||
public static final GfmlBldrCmd_whitespace _ = new GfmlBldrCmd_whitespace(); GfmlBldrCmd_whitespace() {}
|
||||
public static final GfmlBldrCmd_whitespace Instance = new GfmlBldrCmd_whitespace(); GfmlBldrCmd_whitespace() {}
|
||||
}
|
||||
|
||||
@@ -67,12 +67,12 @@ class GfmlStringHighlighter {
|
||||
int gap = nxtMarkBgn - endPos;
|
||||
if (gap > 0) {
|
||||
int gapDigits = Int_.DigitCount(gap);
|
||||
posBfr.Add_fmt("[{0}]", Int_.Xto_str_pad_bgn_zero(gap, gapDigits));
|
||||
posBfr.Add_fmt("[{0}]", Int_.To_str_pad_bgn_zero(gap, gapDigits));
|
||||
rawBfr.Add_fmt("[{0}]", String_.Repeat(".", gapDigits));
|
||||
symBfr.Add_fmt(" {0} ", String_.Repeat(" ", gapDigits));
|
||||
}
|
||||
if (curMark.Sym() != ' ')
|
||||
symList.Add(String_.Format("[{0}] {1} {2}", Int_.Xto_str_pad_bgn_zero(curMark.Pos(), rawLenDigits), curMark.Sym(), curMark.Msg()));
|
||||
symList.Add(String_.Format("[{0}] {1} {2}", Int_.To_str_pad_bgn_zero(curMark.Pos(), rawLenDigits), curMark.Sym(), curMark.Msg()));
|
||||
}
|
||||
if (rawBfrBgn == 0) {
|
||||
posBfr.Add_at(0, "<");
|
||||
|
||||
@@ -93,7 +93,7 @@ public class GfmlDataWtr extends DataWtr_base implements DataWtr {
|
||||
@Override public SrlMgr SrlMgr_new(Object o) {return new GfmlDataWtr();}
|
||||
StackAdp stack = StackAdp_.new_();
|
||||
GfmlDoc gdoc = GfmlDoc.new_(); GfmlNde nde;
|
||||
String keyedSpr = GfmlDataWtrOpts._.KeyedSpr(); boolean indentNodes, ignoreNullNames;
|
||||
String keyedSpr = GfmlDataWtrOpts.Instance.KeyedSpr(); boolean indentNodes, ignoreNullNames;
|
||||
public static GfmlDataWtr new_() {return new GfmlDataWtr();}
|
||||
GfmlDataWtr() {this.nde = this.gdoc.RootNde();}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public class GfmlDataWtrOpts {
|
||||
public String KeyedSpr() {return keyedSeparator;} public GfmlDataWtrOpts KeyedSeparator_(String val) {keyedSeparator = val; return this;} private String keyedSeparator = " ";
|
||||
public boolean IndentNodes() {return indentNodes;} public GfmlDataWtrOpts IndentNodesOn_() {indentNodes = true; return this;} private boolean indentNodes;
|
||||
public boolean IgnoreNullNames() {return ignoreNullNames;} public GfmlDataWtrOpts IgnoreNullNamesOn_() {ignoreNullNames = true; return this;} private boolean ignoreNullNames;
|
||||
public static final GfmlDataWtrOpts _ = new GfmlDataWtrOpts();
|
||||
public static final GfmlDataWtrOpts Instance = new GfmlDataWtrOpts();
|
||||
public static GfmlDataWtrOpts new_() {return new GfmlDataWtrOpts();} GfmlDataWtrOpts() {}
|
||||
public static GfmlDataWtrOpts cast(Object obj) {try {return (GfmlDataWtrOpts)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, GfmlDataWtrOpts.class, obj);}}
|
||||
}
|
||||
|
||||
@@ -18,5 +18,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.gfml; import gplx.*;
|
||||
public class GfoMsgParser_gfml implements GfoMsgParser {
|
||||
public GfoMsg ParseToMsg(String s) {return GfmlDataNde.XtoMsg(s);}
|
||||
public static final GfoMsgParser_gfml _ = new GfoMsgParser_gfml(); GfoMsgParser_gfml() {}
|
||||
public static final GfoMsgParser_gfml Instance = new GfoMsgParser_gfml(); GfoMsgParser_gfml() {}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class SqlDoc {
|
||||
return bldr.XtoGfmlDoc(raw);
|
||||
}
|
||||
static GfmlLxr RootLxr_() {
|
||||
GfmlTkn txtTkn = GfmlTkn_.cmd_("tkn:text", SqlCmd_root._);
|
||||
GfmlTkn txtTkn = GfmlTkn_.cmd_("tkn:text", SqlCmd_root.Instance);
|
||||
GfmlLxr rv = GfmlLxr_.general_("lxr:root", txtTkn);
|
||||
whitespace_(rv);
|
||||
operator_(rv
|
||||
@@ -50,14 +50,14 @@ public class SqlDoc {
|
||||
return rv;
|
||||
}
|
||||
static GfmlLxr quote_(GfmlLxr lxr, String quote) {
|
||||
GfmlLxr rv = GfmlLxr_frame.new_("gfml.quote_0", SqlFrame_quote._, quote, quote, SqlCmd_quote_str._, SqlCmd_quote_end._);
|
||||
GfmlLxr rv = GfmlLxr_frame.new_("gfml.quote_0", SqlFrame_quote.Instance, quote, quote, SqlCmd_quote_str.Instance, SqlCmd_quote_end.Instance);
|
||||
|
||||
GfmlLxr escape = lxr_escape_("gfml.quote_0_escape", quote + quote, quote);
|
||||
rv.SubLxr_Add(escape);
|
||||
lxr.SubLxr_Add(rv);
|
||||
return rv;
|
||||
}
|
||||
static GfmlLxr lxr_escape_(String key, String raw, String escape) {return GfmlLxr_.symbol_(key, raw, escape, GfmlBldrCmd_pendingTkns_add._);}
|
||||
static GfmlLxr lxr_escape_(String key, String raw, String escape) {return GfmlLxr_.symbol_(key, raw, escape, GfmlBldrCmd_pendingTkns_add.Instance);}
|
||||
|
||||
static void operator_(GfmlLxr lxr, String... opAry) {
|
||||
for (String op : opAry) {
|
||||
@@ -71,7 +71,7 @@ class SqlCmd_quote_str implements GfmlBldrCmd {
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {
|
||||
bldr.CurFrame().WaitingTkns().Add(GfmlTkn_.raw_(tkn.Raw()));
|
||||
}
|
||||
public static final SqlCmd_quote_str _ = new SqlCmd_quote_str(); SqlCmd_quote_str() {}
|
||||
public static final SqlCmd_quote_str Instance = new SqlCmd_quote_str(); SqlCmd_quote_str() {}
|
||||
}
|
||||
class SqlCmd_quote_end implements GfmlBldrCmd {
|
||||
public String Key() {return "sql:root";}
|
||||
@@ -82,26 +82,26 @@ class SqlCmd_quote_end implements GfmlBldrCmd {
|
||||
GfmlTkn pnd = (GfmlTkn)list.Get_at(i);
|
||||
sb.Add(pnd.Val());
|
||||
}
|
||||
//Int_.Xto_str(bldr.CurNdeFrame().Nde().SubTkns().length)
|
||||
//Int_.To_str(bldr.CurNdeFrame().Nde().SubTkns().length)
|
||||
GfmlAtr atr = GfmlAtr.new_(GfmlTkn_.raw_("word"), GfmlTkn_.raw_(sb.To_str()), GfmlType_.String);
|
||||
bldr.CurNdeFrame().CurNde().SubObjs_Add(atr);
|
||||
bldr.Frames_end();
|
||||
}
|
||||
public static final SqlCmd_quote_end _ = new SqlCmd_quote_end(); SqlCmd_quote_end() {}
|
||||
public static final SqlCmd_quote_end Instance = new SqlCmd_quote_end(); SqlCmd_quote_end() {}
|
||||
}
|
||||
class SqlCmd_root implements GfmlBldrCmd {
|
||||
public String Key() {return "sql:root";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {
|
||||
GfmlSqlUtl.Atr_add(bldr, "word", tkn);
|
||||
}
|
||||
public static final SqlCmd_root _ = new SqlCmd_root(); SqlCmd_root() {}
|
||||
public static final SqlCmd_root Instance = new SqlCmd_root(); SqlCmd_root() {}
|
||||
}
|
||||
class SqlFrame_quote extends GfmlFrame_base {
|
||||
@Override public int FrameType() {return GfmlFrame_.Type_data;}
|
||||
@Override public void Build_end(GfmlBldr bldr, GfmlFrame ownerFrame) {
|
||||
}
|
||||
@Override protected GfmlFrame_base MakeNew_hook() {return new SqlFrame_quote();}
|
||||
public static final SqlFrame_quote _ = new SqlFrame_quote(); SqlFrame_quote() {}
|
||||
public static final SqlFrame_quote Instance = new SqlFrame_quote(); SqlFrame_quote() {}
|
||||
}
|
||||
class SqlCmd_operator implements GfmlBldrCmd {
|
||||
public String Key() {return "sql:operator";}
|
||||
|
||||
@@ -34,7 +34,7 @@ class GfmlTypeCompiler_fxt {
|
||||
}
|
||||
public void tst_Compile(GfmlNde_mok nde, GfmlTyp_mok expd) {
|
||||
GfmlNde gnde = run_Resolve(this.Regy(), "_type/type", nde);
|
||||
Ordered_hash list = Ordered_hash_.new_();
|
||||
Ordered_hash list = Ordered_hash_.New();
|
||||
GfmlType actlType = GfmlTypeCompiler.Compile(gnde, GfmlType_.Root, this.Regy(), list);
|
||||
GfmlTyp_mok actl = GfmlTyp_mok.type_(actlType);
|
||||
TfdsTstr_fxt tstr = TfdsTstr_fxt.new_();
|
||||
@@ -57,7 +57,7 @@ class GfmlTypeCompiler_fxt {
|
||||
for (int i = 0; i < max; i++) {
|
||||
GfmlFld_mok expdFld = (GfmlFld_mok)tstr.List_FetchAtOrNull(expd.Subs(), i);
|
||||
GfmlFld_mok actlFld = (GfmlFld_mok)tstr.List_FetchAtOrNull(actl.Subs(), i);
|
||||
tstr.SubName_push(Int_.Xto_str(i) + " fld");
|
||||
tstr.SubName_push(Int_.To_str(i) + " fld");
|
||||
tst(tstr, expdFld, actlFld);
|
||||
tstr.SubName_pop();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class GfmlNde_mok implements GfmlItm_mok {
|
||||
public List_adp Subs() {return subs;}
|
||||
public String XtoStrStub() {
|
||||
String_bldr sb = String_bldr_.new_();
|
||||
sb.Add_kv("key=", key).Add_kv("hnd=", hnd).Add_kv("typ=", typ).Add_kv("subs=", Int_.Xto_str(subs.Count()));
|
||||
sb.Add_kv("key=", key).Add_kv("hnd=", hnd).Add_kv("typ=", typ).Add_kv("subs=", Int_.To_str(subs.Count()));
|
||||
return sb.To_str();
|
||||
}
|
||||
public GfmlNde_mok Subs_(GfmlItm_mok... ary) {
|
||||
@@ -142,7 +142,7 @@ class GfmlTypeResolver_fxt {
|
||||
for (int i = 0; i < max; i++) {
|
||||
GfmlItm_mok expdSub = (GfmlItm_mok)tstr.List_FetchAtOrNull(expd.Subs(), i);
|
||||
GfmlItm_mok actlSub = (GfmlItm_mok)tstr.List_FetchAtOrNull(actl.Subs(), i);
|
||||
tstr.SubName_push(Int_.Xto_str(i));
|
||||
tstr.SubName_push(Int_.To_str(i));
|
||||
if (expdSub == null) {
|
||||
GfmlNde_mok mm = GfmlNde_mok.as_(actlSub);
|
||||
String actlSubStr = mm == null ? "sub:null" : mm.XtoStrStub();
|
||||
|
||||
@@ -68,7 +68,7 @@ class GfmlTkn_mok {
|
||||
for (int i = 0; i < max; i++) {
|
||||
GfmlTkn_mok expdSub = (GfmlTkn_mok)tstr.List_FetchAtOrNull(expd.Subs(), i);
|
||||
GfmlTkn_mok actlSub = (GfmlTkn_mok)tstr.List_FetchAtOrNull(actl.Subs(), i);
|
||||
tstr.SubName_push(Int_.Xto_str(i));
|
||||
tstr.SubName_push(Int_.To_str(i));
|
||||
tst(tstr, expdSub, actlSub);
|
||||
tstr.SubName_pop();
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ class UsrMsg_mok {
|
||||
public String Main() {return main;} public UsrMsg_mok Main_(String v) {main = v; return this;} private String main;
|
||||
public UsrMsg_mok Add_(String k, Object o) {hash.Add(k, KeyVal_.new_(k, o)); return this;}
|
||||
public UsrMsg_mok Require_(String k) {required.Add(k, k); return this;}
|
||||
public Ordered_hash Args() {return hash;} Ordered_hash hash = Ordered_hash_.new_();
|
||||
public Ordered_hash Required() {return required;} Ordered_hash required = Ordered_hash_.new_();
|
||||
public Ordered_hash Args() {return hash;} Ordered_hash hash = Ordered_hash_.New();
|
||||
public Ordered_hash Required() {return required;} Ordered_hash required = Ordered_hash_.New();
|
||||
public static UsrMsg_mok new_(UsrMsg um) {
|
||||
UsrMsg_mok rv = new UsrMsg_mok();
|
||||
if (um != null) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class z801_useCase_DataRdr_tst {
|
||||
fx_rdr.tst_Atrs(subRdr, kv_("x", "1"), kv_("y", "2"));
|
||||
}
|
||||
KeyVal kv_(String key, Object val) {return KeyVal_.new_(key, val);}
|
||||
DataRdr_Fxt fx_rdr = DataRdr_Fxt._;
|
||||
DataRdr_Fxt fx_rdr = DataRdr_Fxt.Instance;
|
||||
DataRdr rdr, subRdr;
|
||||
}
|
||||
class DataRdr_Fxt {
|
||||
@@ -77,5 +77,5 @@ class DataRdr_Fxt {
|
||||
actlAry[i] = rdr.KeyValAt(i);
|
||||
Tfds.Eq_ary_str(expdAry, actlAry);
|
||||
}
|
||||
public static final DataRdr_Fxt _ = new DataRdr_Fxt(); DataRdr_Fxt() {}
|
||||
public static final DataRdr_Fxt Instance = new DataRdr_Fxt(); DataRdr_Fxt() {}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class z803_useCase_KbdKeyboard_tst {
|
||||
}
|
||||
@Test public void Load_Smoke() {
|
||||
Io_url url = Tfds.RscDir.GenSubFil_nest("110_gfml", "cfgs_archive", "gfui-keyboard-ui.cfg.gfml");
|
||||
raw = Io_mgr.I.LoadFilStr(url);
|
||||
raw = Io_mgr.Instance.LoadFilStr(url);
|
||||
gdoc = GfmlDoc_.parse_any_eol_(raw);
|
||||
// Tfds.Write(gdoc.RootNde().To_str());
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class z901_perf_tst {
|
||||
// @Test
|
||||
public void Long() {
|
||||
// String longText = String_.Repeat("a", 30 * 1000 * 1000);
|
||||
String longText = Io_mgr.I.LoadFilStr(Io_url_.new_any_("C:\\core_weekly.temp.gfio"));
|
||||
String longText = Io_mgr.Instance.LoadFilStr(Io_url_.new_any_("C:\\core_weekly.temp.gfio"));
|
||||
// String_bldr sbXml = String_bldr_.new_();
|
||||
// sbXml.Add("<");
|
||||
// sbXml.Add(longText);
|
||||
@@ -108,7 +108,7 @@ class TimerWatch {
|
||||
this.End();
|
||||
Tfds.Write(XtoStr_ms() + " " + text);
|
||||
}
|
||||
public String XtoStr_ms() {return Long_.Xto_str(duration);}
|
||||
public String XtoStr_ms() {return Long_.To_str(duration);}
|
||||
public static TimerWatch new_() {
|
||||
TimerWatch rv = new TimerWatch();
|
||||
rv.Bgn();
|
||||
|
||||
Reference in New Issue
Block a user