diff options
author | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /library/cpp/config/markupfsm.h.rl6 | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
download | ydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz |
fix ya.make
Diffstat (limited to 'library/cpp/config/markupfsm.h.rl6')
-rw-r--r-- | library/cpp/config/markupfsm.h.rl6 | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/library/cpp/config/markupfsm.h.rl6 b/library/cpp/config/markupfsm.h.rl6 new file mode 100644 index 0000000000..b709faaebf --- /dev/null +++ b/library/cpp/config/markupfsm.h.rl6 @@ -0,0 +1,81 @@ +%%{ + machine ParseXml; + + action startText { + l = p; + } + + action endText { + cb->DoText(TStringBuf(l + 1, p)); + } + + action startSTag { + l = p; + } + + action endSTag { + cb->DoTagOpen(TStringBuf(l, p)); + } + + action startETag { + l = p; + } + + action endETag { + cb->DoTagClose(TStringBuf(l, p)); + } + + action startKey { + l = p; + } + + action endKey { + cb->DoAttrKey(TStringBuf(l, p)); + } + + action startValue { + l = p; + } + + action endValue { + cb->DoAttrValue(TStringBuf(l, p)); + } + + spacesym = [ \r\n\t]; + gsym = (spacesym | '<' | '>' | '/'); + sym = any -- gsym; + asym = sym -- ('=' | '"'); + tag = sym+; + xattrkey = asym+; + xattrval = asym*; + xspace = spacesym*; + mspace = spacesym+; + attr = (xattrkey >startKey %endKey) '=' '"' (xattrval >startValue %endValue) '"'; + attrs = (mspace attr)*; + text = ('>' (any -- '<')*) >startText %endText; + stag = '<' xspace (tag >startSTag %endSTag) attrs xspace; + etag = '<' xspace '/' xspace (tag >startETag %endETag) xspace; + + main := spacesym* ((stag | etag) text)*; +}%% + +#if defined(MACHINE_DATA) +#undef MACHINE_DATA +%%{ + write data; +}%% +#endif + +#if defined(MACHINE_INIT) +#undef MACHINE_INIT +%%{ + write init; +}%% +#endif + +#if defined(MACHINE_EXEC) +#undef MACHINE_EXEC +%%{ + write exec; +}%% +#endif |