本项目尝试为了明日方舟的攻击范围提供一个序列化方案。 DEMO
# 详见 src/utils/grammar.pegjs
expr -> init whitespace commands
expr -> commands
init -> modes offset:integer
init -> integer modes
init -> integer
init -> modes
commands -> multCmd whitespace commands
commands -> multCmd
multCmd -> cmdGroup '*' posInteger
multCmd -> cmdGroup
cmdGroup -> cmd:offsetCmd '&' cmdGroup
cmdGroup -> offsetCmd
offsetCmd -> cmd_or_i sign integer
offsetCmd -> cmd_or_i
sign -> [+-]
cmd_or_i -> command / posInteger
command -> [FCfc]
modes -> [+-]? modes:mode+
mode -> [FLRBAflrba]
posInteger -> [+]?[0-9]+
integer -> [+-]?[0-9]+
whitespace -> ' '