-
Good day, Im trying to write grammar for
Please guide me in which direction to look |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Logically, you have a list of segments, where each segment is either a unicode code point, or a dsl::list(dsl::curly_bracketed(format_syntax) | dsl::else_ >> dsl::code_point) (use Alternatively, you can merge adjacent unescaped code points, you can use dsl::list(dsl::until(param_start).or_eof(), dsl::sep(param_start >> grammar_parameter + dsl::lit_c<'}'>)) |
Beta Was this translation helpful? Give feedback.
Logically, you have a list of segments, where each segment is either a unicode code point, or a
{...}
sequence:dsl::list(dsl::curly_bracketed(format_syntax) | dsl::else_ >> dsl::code_point)
(use
dsl::bracekts(dsl::not_followed_by(...), ...)
as appropriate)Alternatively, you can merge adjacent unescaped code points, you can use
dsl::until
, which will consume the{
, but this just means you don't have to handle it specially. I think you could just treat it as a list of segments, with{
serving as list separator: