mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.1'
This commit is contained in:
@@ -26,10 +26,10 @@ NOTE: naive implementation of PHP evaluator. intended only for parsing Messages*
|
||||
public class Php_evaluator implements Php_tkn_wkr {
|
||||
byte mode = Mode_key_bgn, next_tid = 0, next_mode = 0;
|
||||
Php_line_assign cur_line; Php_itm_ary cur_ary; Php_key cur_kv_key;
|
||||
List_adp frame_stack = List_adp_.new_();
|
||||
List_adp frame_stack = List_adp_.New();
|
||||
public Php_evaluator(Gfo_msg_log msg_log) {this.msg_log = msg_log;} Gfo_msg_log msg_log;
|
||||
public void Init(Php_ctx ctx) {src = ctx.Src(); frame_stack.Clear();} private byte[] src;
|
||||
public List_adp List() {return lines;} List_adp lines = List_adp_.new_();
|
||||
public List_adp List() {return lines;} List_adp lines = List_adp_.New();
|
||||
public Gfo_msg_log Msg_log() {return msg_log;}
|
||||
public void Clear() {
|
||||
lines.Clear(); msg_log.Clear();
|
||||
@@ -249,7 +249,7 @@ public class Php_evaluator implements Php_tkn_wkr {
|
||||
public void Msg_many(byte[] src, int bgn, int end, Gfo_msg_itm itm, Object... args) {
|
||||
msg_log.Add_itm_many(itm, src, bgn, end, args);
|
||||
}
|
||||
public static final Gfo_msg_itm Expecting_itm_failed = Gfo_msg_itm_.new_warn_(Php_parser.Log_nde, "expecting_itm_failed", "expecting_itm ~{0} but got ~{1} instead");
|
||||
public static final Gfo_msg_itm Expecting_itm_failed = Gfo_msg_itm_.new_warn_(Php_parser.Log_nde, "expecting_itm_failed", "expecting_itm ~{0} but got ~{1} instead");
|
||||
private static final byte Mode_key_bgn = 1, Mode_key_end = 2, Mode_expect = 3, Mode_suspend = 4, Mode_val = 5, Mode_ary_subs = 6, Mode_ary_dlm = 7, Mode_ary_term = 8, Mode_brack_itm = 9;
|
||||
}
|
||||
class Php_scanner_frame {
|
||||
@@ -258,6 +258,6 @@ class Php_scanner_frame {
|
||||
public void Rls() {ary = null;}
|
||||
}
|
||||
class Php_parser_interrupt {
|
||||
public static final Php_parser_interrupt Char = new Php_parser_interrupt();
|
||||
public static final Php_parser_interrupt Char = new Php_parser_interrupt();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Php_parser {
|
||||
byte[] src; int src_len; Php_tkn_wkr tkn_wkr; Php_tkn_factory tkn_factory = new Php_tkn_factory(); Php_ctx ctx = new Php_ctx();
|
||||
Php_parser_interrupt[] parser_interrupts = new Php_parser_interrupt[256];
|
||||
public Php_parser() {
|
||||
List_adp list = List_adp_.new_();
|
||||
List_adp list = List_adp_.New();
|
||||
Init_lxr(list, new Php_lxr_declaration());
|
||||
Init_lxr(list, new Php_lxr_ws(Php_tkn_ws.Tid_space));
|
||||
Init_lxr(list, new Php_lxr_ws(Php_tkn_ws.Tid_nl));
|
||||
@@ -117,5 +117,5 @@ public class Php_parser {
|
||||
return end;
|
||||
}
|
||||
public static final int NotFound = -1;
|
||||
public static final Gfo_msg_grp Log_nde = Gfo_msg_grp_.new_(Gfo_msg_grp_.Root_gplx, "php_parser");
|
||||
public static final Gfo_msg_grp Log_nde = Gfo_msg_grp_.new_(Gfo_msg_grp_.Root_gplx, "php_parser");
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ abstract class Php_tkn_chkr_base implements Tst_chkr {
|
||||
class Php_tkn_declaration_chkr extends Php_tkn_chkr_base {
|
||||
@Override public Class<?> TypeOf() {return Php_tkn_declaration.class;}
|
||||
@Override public byte Tkn_tid() {return Php_tkn_.Tid_declaration;}
|
||||
public static final Php_tkn_declaration_chkr Instance = new Php_tkn_declaration_chkr();
|
||||
public static final Php_tkn_declaration_chkr Instance = new Php_tkn_declaration_chkr();
|
||||
}
|
||||
class Php_tkn_txt_chkr extends Php_tkn_chkr_base {
|
||||
public Php_tkn_txt_chkr(int src_bgn, int src_end) {this.Src_rng_(src_bgn, src_end);}
|
||||
@@ -295,7 +295,7 @@ abstract class Php_itm_chkr_base implements Tst_chkr {
|
||||
return rv;
|
||||
}
|
||||
@gplx.Virtual public int Chk_itm(Tst_mgr mgr, String path, Php_itm actl_obj) {return 0;}
|
||||
public static final Php_itm_chkr_base[] Ary_empty = new Php_itm_chkr_base[0];
|
||||
public static final Php_itm_chkr_base[] Ary_empty = new Php_itm_chkr_base[0];
|
||||
}
|
||||
class Php_itm_generic_chkr extends Php_itm_chkr_base {
|
||||
public Php_itm_generic_chkr(byte itm_tid) {this.itm_tid = itm_tid;} private byte itm_tid;
|
||||
@@ -365,7 +365,7 @@ class Php_itm_kv_chkr extends Php_itm_chkr_base {
|
||||
}
|
||||
}
|
||||
class Gfo_msg_log_chkr implements Tst_chkr {
|
||||
List_adp itms = List_adp_.new_();
|
||||
List_adp itms = List_adp_.New();
|
||||
public Class<?> TypeOf() {return Gfo_msg_log.class;}
|
||||
public void Clear() {itms.Clear();}
|
||||
public void Add_itm(Gfo_msg_itm itm, int bgn, int end) {
|
||||
|
||||
@@ -82,7 +82,7 @@ class Php_srl_parser_fxt {
|
||||
public void Clear() {
|
||||
parser = new Php_srl_parser();
|
||||
factory = parser.Factory();
|
||||
} Php_srl_parser parser; Php_srl_factory factory; Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
|
||||
} Php_srl_parser parser; Php_srl_factory factory; Bry_bfr tmp_bfr = Bry_bfr_.Reset(255);
|
||||
public Php_srl_itm itm_nil_() {return factory.Nil();}
|
||||
public Php_srl_itm itm_bool_n_() {return factory.Bool_n();}
|
||||
public Php_srl_itm itm_bool_y_() {return factory.Bool_y();}
|
||||
|
||||
@@ -39,10 +39,10 @@ class Php_text_itm_fxt {
|
||||
public Php_text_itm_fxt Init_q1() {parser.Quote_is_single_(Bool_.Y); return this;}
|
||||
public Php_text_itm_fxt Init_q2() {parser.Quote_is_single_(Bool_.N); return this;}
|
||||
public void Test_parse(String raw_str, String expd) {
|
||||
List_adp list = List_adp_.new_();
|
||||
List_adp list = List_adp_.New();
|
||||
byte[] raw = Bry_.new_u8(raw_str);
|
||||
parser.Parse(list, raw);
|
||||
Bry_bfr bfr = Bry_bfr.reset_(255);
|
||||
Bry_bfr bfr = Bry_bfr_.Reset(255);
|
||||
int list_len = list.Count();
|
||||
for (int i = 0; i < list_len; i++) {
|
||||
Php_text_itm itm = (Php_text_itm)list.Get_at(i);
|
||||
|
||||
@@ -24,7 +24,7 @@ public interface Php_tkn_wkr {
|
||||
}
|
||||
class Php_tkn_wkr_tkn implements Php_tkn_wkr {
|
||||
public void Init(Php_ctx ctx) {}
|
||||
public List_adp List() {return lines;} List_adp lines = List_adp_.new_();
|
||||
public List_adp List() {return lines;} List_adp lines = List_adp_.New();
|
||||
public Gfo_msg_log Msg_log() {return msg_log;} Gfo_msg_log msg_log = new Gfo_msg_log("gplx.langs.phps");
|
||||
public void Clear() {lines.Clear(); msg_log.Clear();}
|
||||
public void Process(Php_tkn tkn) {
|
||||
|
||||
Reference in New Issue
Block a user