UNPKG

tree-sitter-cg

Version:
2,329 lines 96.9 kB
{ "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json", "name": "cg", "rules": { "source_file": { "type": "SEQ", "members": [ { "type": "REPEAT1", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "set_special_list" }, { "type": "SYMBOL", "name": "static_sets" }, { "type": "SYMBOL", "name": "parentheses" }, { "type": "SYMBOL", "name": "mapping_prefix" }, { "type": "SYMBOL", "name": "subreadings" }, { "type": "SYMBOL", "name": "options" }, { "type": "SYMBOL", "name": "list_tags" }, { "type": "SYMBOL", "name": "strict_tags" }, { "type": "SYMBOL", "name": "list" }, { "type": "SYMBOL", "name": "set" }, { "type": "SYMBOL", "name": "template" }, { "type": "SYMBOL", "name": "include" }, { "type": "SYMBOL", "name": "section_header" }, { "type": "SYMBOL", "name": "anchor" }, { "type": "SYMBOL", "name": "rule" }, { "type": "SYMBOL", "name": "rule_substitute_etc" }, { "type": "SYMBOL", "name": "rule_map_etc" }, { "type": "SYMBOL", "name": "rule_parentchild" }, { "type": "SYMBOL", "name": "rule_move" }, { "type": "SYMBOL", "name": "rule_switch" }, { "type": "SYMBOL", "name": "rule_relation" }, { "type": "SYMBOL", "name": "rule_relations" }, { "type": "SYMBOL", "name": "rule_addcohort" }, { "type": "SYMBOL", "name": "rule_copycohort" }, { "type": "SYMBOL", "name": "rule_mergecohorts" }, { "type": "SYMBOL", "name": "rule_external" }, { "type": "SYMBOL", "name": "rule_with" }, { "type": "SYMBOL", "name": "semicolon" } ] } } ] }, "END": { "type": "PATTERN", "value": "[Ee][Nn][Dd]" }, "eq": { "type": "STRING", "value": "=" }, "pluseq": { "type": "STRING", "value": "+=" }, "semicolon": { "type": "STRING", "value": ";" }, "special_list_name": { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[Dd][Ee][Ll][Ii][Mm][Ii][Tt][Ee][Rr][Ss]" }, { "type": "PATTERN", "value": "[Ss][Oo][Ff][Tt]-[Dd][Ee][Ll][Ii][Mm][Ii][Tt][Ee][Rr][Ss]" }, { "type": "PATTERN", "value": "[Pp][Rr][Ee][Ff][Ee][Rr][Rr][Ee][Dd]-[Tt][Aa][Rr][Gg][Ee][Tt][Ss]" }, { "type": "PATTERN", "value": "[Rr][Ee][Oo][Pp][Ee][Nn]-[Mm][Aa][Pp][Pp][Ii][Nn][Gg][Ss]" }, { "type": "PATTERN", "value": "[Uu][Nn][Dd][Ee][Ff]-[Ss][Ee][Tt][Ss]" } ] }, "set_special_list": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "special_list_name" } }, { "type": "SYMBOL", "name": "eq" }, { "type": "FIELD", "name": "value", "content": { "type": "SYMBOL", "name": "taglist" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "STATIC_SETS": { "type": "PATTERN", "value": "[Ss][Tt][Aa][Tt][Ii][Cc]-[Ss][Ee][Tt][Ss]" }, "static_sets": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "STATIC_SETS" }, { "type": "SYMBOL", "name": "eq" }, { "type": "FIELD", "name": "value", "content": { "type": "REPEAT1", "content": { "type": "SYMBOL", "name": "setname" } } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "MAPPING_PREFIX": { "type": "PATTERN", "value": "[Mm][Aa][Pp][Pp][Ii][Nn][Gg]-[Pp][Rr][Ee][Ff][Ii][Xx]" }, "mapping_prefix": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "MAPPING_PREFIX" }, { "type": "SYMBOL", "name": "eq" }, { "type": "FIELD", "name": "value", "content": { "type": "SYMBOL", "name": "prefix" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "SUBREADINGS": { "type": "PATTERN", "value": "[Ss][Uu][Bb][Rr][Ee][Aa][Dd][Ii][Nn][Gg][Ss]" }, "RTL": { "type": "PATTERN", "value": "[Rr][Tt][Ll]" }, "LTR": { "type": "PATTERN", "value": "[Ll][Tt][Rr]" }, "subreadings": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "SUBREADINGS" }, { "type": "SYMBOL", "name": "eq" }, { "type": "FIELD", "name": "value", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "RTL" }, { "type": "SYMBOL", "name": "LTR" } ] } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "OPTIONS": { "type": "PATTERN", "value": "[Oo][Pp][Tt][Ii][Oo][Nn][Ss]" }, "options": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "OPTIONS" }, { "type": "SYMBOL", "name": "pluseq" }, { "type": "FIELD", "name": "value", "content": { "type": "REPEAT1", "content": { "type": "SYMBOL", "name": "ntag" } } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "LIST_TAGS": { "type": "PATTERN", "value": "[Ll][Ii][Ss][Tt]-[Tt][Aa][Gg][Ss]" }, "list_tags": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "LIST_TAGS" }, { "type": "SYMBOL", "name": "pluseq" }, { "type": "FIELD", "name": "value", "content": { "type": "REPEAT1", "content": { "type": "SYMBOL", "name": "ntag" } } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "STRICT_TAGS": { "type": "PATTERN", "value": "[Ss][Tt][Rr][Ii][Cc][Tt]-[Tt][Aa][Gg][Ss]" }, "strict_tags": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "STRICT_TAGS" }, { "type": "SYMBOL", "name": "pluseq" }, { "type": "FIELD", "name": "value", "content": { "type": "REPEAT1", "content": { "type": "SYMBOL", "name": "ntag" } } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "PARENTHESES": { "type": "PATTERN", "value": "[Pp][Aa][Rr][Ee][Nn][Tt][Hh][Ee][Ss][Ee][Ss]" }, "parentheses": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "PARENTHESES" }, { "type": "SYMBOL", "name": "eq" }, { "type": "FIELD", "name": "value", "content": { "type": "REPEAT1", "content": { "type": "SYMBOL", "name": "compotag" } } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "LIST": { "type": "PATTERN", "value": "[Ll][Ii][Ss][Tt]" }, "list": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "LIST" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "setname" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "eq" }, { "type": "SYMBOL", "name": "pluseq" } ] }, { "type": "FIELD", "name": "value", "content": { "type": "SYMBOL", "name": "taglist" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "SET": { "type": "PATTERN", "value": "[Ss][Ee][Tt]" }, "set": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "SET" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "setname" } }, { "type": "SYMBOL", "name": "eq" }, { "type": "FIELD", "name": "value", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "INCLUDE": { "type": "PATTERN", "value": "[Ii][Nn][Cc][Ll][Uu][Dd][Ee]" }, "include": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "INCLUDE" }, { "type": "FIELD", "name": "path", "content": { "type": "SYMBOL", "name": "rawpath" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "section_header": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[Ss][Ee][Tt][Ss]" }, { "type": "PATTERN", "value": "[Bb][Ee][Ff][Oo][Rr][Ee]-[Ss][Ee][Cc][Tt][Ii][Oo][Nn][Ss]" }, { "type": "PATTERN", "value": "[Mm][Aa][Pp][Pp][Ii][Nn][Gg][Ss]" }, { "type": "PATTERN", "value": "[Cc][Oo][Rr][Rr][Ee][Cc][Tt][Ii][Oo][Nn][Ss]" }, { "type": "PATTERN", "value": "[Ss][Ee][Cc][Tt][Ii][Oo][Nn]" }, { "type": "PATTERN", "value": "[Cc][Oo][Nn][Ss][Tt][Rr][Aa][Ii][Nn][Tt][Ss]" }, { "type": "PATTERN", "value": "[Aa][Ff][Tt][Ee][Rr]-[Ss][Ee][Cc][Tt][Ii][Oo][Nn][Ss]" }, { "type": "PATTERN", "value": "[Nn][Uu][Ll][Ll]-[Ss][Ee][Cc][Tt][Ii][Oo][Nn]" } ] }, { "type": "CHOICE", "members": [ { "type": "STRING", "value": "\n" }, { "type": "FIELD", "name": "name", "content": { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "ntag" }, { "type": "SYMBOL", "name": "semicolon" } ] }, { "type": "BLANK" } ] } } ] } ] }, "ANCHOR": { "type": "PATTERN", "value": "[Aa][Nn][Cc][Hh][Oo][Rr]" }, "anchor": { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "ANCHOR" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "ntag" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "_context": { "type": "REPEAT1", "content": { "type": "SEQ", "members": [ { "type": "STRING", "value": "(" }, { "type": "SYMBOL", "name": "contexttest" }, { "type": "STRING", "value": ")" } ] } }, "IF": { "type": "PATTERN", "value": "[Ii][Ff]" }, "TARGET": { "type": "PATTERN", "value": "[Tt][Aa][Rr][Gg][Ee][Tt]" }, "rule_target": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "TARGET" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "target", "content": { "type": "SYMBOL", "name": "inlineset" } } ] }, "_shared_rule_end": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "target", "content": { "type": "SYMBOL", "name": "rule_target" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "IF" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "context", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_context" }, { "type": "BLANK" } ] } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "rule_name": { "type": "SEQ", "members": [ { "type": "IMMEDIATE_TOKEN", "content": { "type": "STRING", "value": ":" } }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "ntag" } } ] }, "rule": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "SYMBOL", "name": "_shared_rule_end" } ] }, "rule_substitute_etc": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_substitute_etc" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "src", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "FIELD", "name": "trg", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "SYMBOL", "name": "_shared_rule_end" } ] }, "EXCEPT": { "type": "PATTERN", "value": "[Ee][Xx][Cc][Ee][Pp][Tt]" }, "BEFORE": { "type": "PATTERN", "value": "[Bb][Ee][Ff][Oo][Rr][Ee]" }, "AFTER": { "type": "PATTERN", "value": "[Aa][Ff][Tt][Ee][Rr]" }, "rule_map_etc": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_map_etc" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "tags", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "EXCEPT" }, { "type": "FIELD", "name": "except", "content": { "type": "SYMBOL", "name": "inlineset" } } ] }, { "type": "BLANK" } ] }, { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "BEFORE" }, { "type": "SYMBOL", "name": "AFTER" } ] }, { "type": "SYMBOL", "name": "inlineset" } ] }, { "type": "BLANK" } ] }, { "type": "SYMBOL", "name": "_shared_rule_end" } ] }, "TO": { "type": "PATTERN", "value": "[Tt][Oo]" }, "FROM": { "type": "PATTERN", "value": "[Ff][Rr][Oo][Mm]" }, "_to_from": { "type": "SEQ", "members": [ { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "TO" }, { "type": "SYMBOL", "name": "FROM" } ] }, { "type": "SYMBOL", "name": "_context" } ] }, "rule_parentchild": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_parentchild" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "trg", "content": { "type": "SYMBOL", "name": "rule_target" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "IF" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "context", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_context" }, { "type": "BLANK" } ] } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "TO" }, { "type": "SYMBOL", "name": "FROM" } ] }, { "type": "FIELD", "name": "to_from", "content": { "type": "SYMBOL", "name": "_context" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "WITHCHILD": { "type": "PATTERN", "value": "[Ww][Ii][Tt][Hh][Cc][Hh][Ii][Ll][Dd]" }, "NOCHILD": { "type": "PATTERN", "value": "[Nn][Oo][Cc][Hh][Ii][Ll][Dd]" }, "_child_specifier": { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "WITHCHILD" }, { "type": "FIELD", "name": "withchild", "content": { "type": "SYMBOL", "name": "inlineset" } } ] }, { "type": "FIELD", "name": "nochild", "content": { "type": "SYMBOL", "name": "NOCHILD" } } ] }, "rule_move": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_move" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_child_specifier" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "trg", "content": { "type": "SYMBOL", "name": "rule_target" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "IF" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "context", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_context" }, { "type": "BLANK" } ] } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "BEFORE" }, { "type": "SYMBOL", "name": "AFTER" } ] }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_child_specifier" }, { "type": "BLANK" } ] }, { "type": "SYMBOL", "name": "_context" }, { "type": "SYMBOL", "name": "semicolon" } ] }, "WITH": { "type": "PATTERN", "value": "[Ww][Ii][Tt][Hh]" }, "rule_switch": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_switch" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "trg", "content": { "type": "SYMBOL", "name": "rule_target" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "IF" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "context", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_context" }, { "type": "BLANK" } ] } }, { "type": "SYMBOL", "name": "WITH" }, { "type": "FIELD", "name": "context_target", "content": { "type": "SYMBOL", "name": "_context" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "rule_relation": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_relation" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "rel", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "FIELD", "name": "trg", "content": { "type": "SYMBOL", "name": "rule_target" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "IF" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "context", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_context" }, { "type": "BLANK" } ] } }, { "type": "SYMBOL", "name": "_to_from" }, { "type": "SYMBOL", "name": "semicolon" } ] }, "rule_relations": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_relations" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "rel1", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "FIELD", "name": "rel2", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "FIELD", "name": "trg", "content": { "type": "SYMBOL", "name": "rule_target" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "IF" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "context", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_context" }, { "type": "BLANK" } ] } }, { "type": "SYMBOL", "name": "_to_from" }, { "type": "SYMBOL", "name": "semicolon" } ] }, "rule_addcohort": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_addcohort" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "tags", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "FIELD", "name": "dir", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "BEFORE" }, { "type": "SYMBOL", "name": "AFTER" } ] } }, { "type": "FIELD", "name": "pos", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_child_specifier" }, { "type": "BLANK" } ] } }, { "type": "SYMBOL", "name": "_shared_rule_end" } ] }, "rule_mergecohorts": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_mergecohorts" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "recipe", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "FIELD", "name": "trg", "content": { "type": "SYMBOL", "name": "rule_target" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "IF" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "context", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_context" }, { "type": "BLANK" } ] } }, { "type": "SYMBOL", "name": "WITH" }, { "type": "FIELD", "name": "context_target", "content": { "type": "SYMBOL", "name": "_context" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "rule_copycohort": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_copycohort" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "tags", "content": { "type": "SYMBOL", "name": "inlineset" } }, { "type": "CHOICE", "members": [ { "type": "SEQ", "members": [ { "type": "SYMBOL", "name": "EXCEPT" }, { "type": "FIELD", "name": "except", "content": { "type": "SYMBOL", "name": "inlineset" } } ] }, { "type": "BLANK" } ] }, { "type": "CHOICE", "members": [ { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "BEFORE" }, { "type": "SYMBOL", "name": "AFTER" } ] }, { "type": "BLANK" } ] }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_child_specifier" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "target", "content": { "type": "SYMBOL", "name": "rule_target" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "IF" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "context", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "_context" }, { "type": "BLANK" } ] } }, { "type": "SYMBOL", "name": "FROM" }, { "type": "FIELD", "name": "context_target", "content": { "type": "SYMBOL", "name": "_context" } }, { "type": "SYMBOL", "name": "semicolon" } ] }, "ONCE": { "type": "PATTERN", "value": "[Oo][Nn][Cc][Ee]" }, "ALWAYS": { "type": "PATTERN", "value": "[Aa][Ll][Ww][Aa][Yy][Ss]" }, "rule_external": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_external" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "mode", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ONCE" }, { "type": "SYMBOL", "name": "ALWAYS" } ] } }, { "type": "FIELD", "name": "path", "content": { "type": "SYMBOL", "name": "filepath" } }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "SYMBOL", "name": "_shared_rule_end" } ] }, "rule_with": { "type": "SEQ", "members": [ { "type": "FIELD", "name": "word", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "qtag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "type", "content": { "type": "SYMBOL", "name": "ruletype_with" } }, { "type": "CHOICE", "members": [ { "type": "PATTERN", "value": "[\\s\\n]+" }, { "type": "FIELD", "name": "name", "content": { "type": "SYMBOL", "name": "rule_name" } } ] }, { "type": "FIELD", "name": "flag", "content": { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "ruleflag" }, { "type": "BLANK" } ] } }, { "type": "FIELD", "name": "trg", "content": { "type": "SYMBOL", "name": "rule_target" } }, { "type": "CHOICE", "members": [ { "type": "SYMBOL", "name": "IF" }, { "type": "BLANK" } ] }, { "type": "FIELD", "name": "cont