2017-07-14 19:28:54 +00:00
|
|
|
{
|
|
|
|
"name": "bash",
|
|
|
|
"rules": {
|
|
|
|
"program": {
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
2017-07-14 23:11:35 +00:00
|
|
|
"name": "_terminated_statement"
|
2017-07-14 19:28:54 +00:00
|
|
|
}
|
|
|
|
},
|
2017-07-14 23:11:35 +00:00
|
|
|
"_terminated_statement": {
|
2017-07-14 19:28:54 +00:00
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
2017-07-14 23:11:35 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "statement"
|
|
|
|
},
|
2017-07-14 19:28:54 +00:00
|
|
|
{
|
2017-07-14 23:29:28 +00:00
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "terminator"
|
2017-07-14 23:11:35 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"statement": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
2017-07-14 23:47:25 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "environment_variable_assignment"
|
|
|
|
},
|
2017-07-14 23:11:35 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "command"
|
|
|
|
},
|
2017-07-14 23:47:25 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "bracket_command"
|
|
|
|
},
|
2017-07-15 00:51:06 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "for_statement"
|
|
|
|
},
|
2017-07-14 23:11:35 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "while_statement"
|
|
|
|
},
|
2017-07-14 23:18:46 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "if_statement"
|
|
|
|
},
|
2017-07-14 23:29:28 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "case_statement"
|
|
|
|
},
|
2017-07-14 23:11:35 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "pipeline"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "list"
|
2017-07-15 00:32:55 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "subshell"
|
2017-07-15 00:35:51 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "function_definition"
|
2017-07-14 23:11:35 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-15 00:51:06 +00:00
|
|
|
"for_statement": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "for"
|
|
|
|
},
|
|
|
|
{
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "word"
|
2017-07-15 00:51:06 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "in"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "do_group"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 23:11:35 +00:00
|
|
|
"while_statement": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "while"
|
2017-07-14 19:28:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-14 23:11:35 +00:00
|
|
|
"name": "_terminated_statement"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "do_group"
|
2017-07-14 19:28:54 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 23:29:28 +00:00
|
|
|
"do_group": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "do"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "done"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 23:18:46 +00:00
|
|
|
"if_statement": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "if"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "then"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "elif_clause"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "else_clause"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "BLANK"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "fi"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"elif_clause": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "elif"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "then"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"else_clause": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "else"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 23:29:28 +00:00
|
|
|
"case_statement": {
|
2017-07-14 23:11:35 +00:00
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
2017-07-14 23:29:28 +00:00
|
|
|
"value": "case"
|
|
|
|
},
|
|
|
|
{
|
2017-07-14 23:47:25 +00:00
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "expression"
|
2017-07-14 23:29:28 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "terminator"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "BLANK"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "in"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "terminator"
|
2017-07-14 23:11:35 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
2017-07-14 23:29:28 +00:00
|
|
|
"name": "case_item"
|
2017-07-14 23:11:35 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
2017-07-14 23:29:28 +00:00
|
|
|
"value": "esac"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"case_item": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
2017-07-14 23:47:25 +00:00
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "expression"
|
2017-07-14 23:29:28 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ")"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2017-07-15 00:32:55 +00:00
|
|
|
"type": "STRING",
|
|
|
|
"value": ";;"
|
2017-07-14 23:11:35 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-15 00:35:51 +00:00
|
|
|
"function_definition": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "function"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "BLANK"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "RENAME",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "leading_word"
|
|
|
|
},
|
|
|
|
"value": "command_name"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "("
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ")"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "compound_statement"
|
2017-07-15 00:35:51 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-16 05:13:55 +00:00
|
|
|
"compound_statement": {
|
2017-07-15 00:35:51 +00:00
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "{"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "}"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 23:47:25 +00:00
|
|
|
"bracket_command": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "["
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT1",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "expression"
|
2017-07-14 23:47:25 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "]"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "[["
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT1",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "expression"
|
2017-07-14 23:47:25 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "]]"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 23:11:35 +00:00
|
|
|
"command": {
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "PREC_LEFT",
|
|
|
|
"value": 0,
|
|
|
|
"content": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "environment_variable_assignment"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "file_redirect"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2017-07-14 19:43:42 +00:00
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
2017-07-16 05:13:55 +00:00
|
|
|
{
|
|
|
|
"type": "RENAME",
|
|
|
|
"content": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "leading_word"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"value": "command_name"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ":"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "string"
|
|
|
|
},
|
2017-07-14 19:43:42 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "raw_string"
|
2017-07-14 19:43:42 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "command_substitution"
|
2017-07-14 19:43:42 +00:00
|
|
|
}
|
|
|
|
]
|
2017-07-16 05:13:55 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SEQ",
|
2017-07-15 00:32:55 +00:00
|
|
|
"members": [
|
|
|
|
{
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "PATTERN",
|
|
|
|
"value": "\\s+"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "expression"
|
|
|
|
}
|
2017-07-15 00:32:55 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-16 05:13:55 +00:00
|
|
|
{
|
|
|
|
"type": "BLANK"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "CHOICE",
|
2017-07-14 19:28:54 +00:00
|
|
|
"members": [
|
|
|
|
{
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "file_redirect"
|
2017-07-14 19:28:54 +00:00
|
|
|
},
|
|
|
|
{
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "heredoc_redirect"
|
2017-07-14 19:28:54 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2017-07-14 19:43:42 +00:00
|
|
|
}
|
2017-07-16 05:13:55 +00:00
|
|
|
]
|
|
|
|
}
|
2017-07-14 19:28:54 +00:00
|
|
|
},
|
|
|
|
"pipeline": {
|
|
|
|
"type": "PREC_LEFT",
|
2017-07-14 23:11:35 +00:00
|
|
|
"value": 1,
|
2017-07-14 19:28:54 +00:00
|
|
|
"content": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-14 23:11:35 +00:00
|
|
|
"name": "statement"
|
2017-07-14 19:28:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "|"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "|&"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-14 23:11:35 +00:00
|
|
|
"name": "statement"
|
2017-07-14 19:28:54 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"list": {
|
|
|
|
"type": "PREC_LEFT",
|
|
|
|
"value": 0,
|
|
|
|
"content": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
2017-07-14 23:11:35 +00:00
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "statement"
|
2017-07-14 19:28:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "&&"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
2017-07-14 23:11:35 +00:00
|
|
|
"value": "||"
|
2017-07-14 19:28:54 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2017-07-14 23:11:35 +00:00
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "statement"
|
2017-07-14 19:28:54 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2017-07-15 00:32:55 +00:00
|
|
|
"subshell": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "("
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_terminated_statement"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ")"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 19:28:54 +00:00
|
|
|
"environment_variable_assignment": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "RENAME",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "leading_word"
|
|
|
|
},
|
|
|
|
"value": "variable_name"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "="
|
|
|
|
},
|
2017-07-14 23:47:25 +00:00
|
|
|
{
|
2017-07-15 00:41:14 +00:00
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "expression"
|
2017-07-15 00:41:14 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_empty_value"
|
|
|
|
}
|
|
|
|
]
|
2017-07-14 23:47:25 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-16 05:13:55 +00:00
|
|
|
"expression": {
|
2017-07-14 23:47:25 +00:00
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
2017-07-14 19:28:54 +00:00
|
|
|
{
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "word"
|
2017-07-14 23:47:25 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "string"
|
2017-07-14 23:47:25 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "raw_string"
|
2017-07-14 23:47:25 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "expansion"
|
2017-07-14 23:47:25 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "simple_expansion"
|
2017-07-14 23:47:25 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "command_substitution"
|
2017-07-14 19:28:54 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-16 05:13:55 +00:00
|
|
|
"string": {
|
2017-07-14 23:47:25 +00:00
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "\""
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_quoted_chars"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "expansion"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "simple_expansion"
|
2017-07-14 23:47:25 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "command_substitution"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "\""
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"_quoted_chars": {
|
|
|
|
"type": "PATTERN",
|
|
|
|
"value": "[^\"$]+"
|
|
|
|
},
|
2017-07-16 05:13:55 +00:00
|
|
|
"raw_string": {
|
2017-07-14 23:47:25 +00:00
|
|
|
"type": "PATTERN",
|
|
|
|
"value": "'[^']*'"
|
|
|
|
},
|
2017-07-16 05:13:55 +00:00
|
|
|
"simple_expansion": {
|
2017-07-14 20:00:41 +00:00
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "$"
|
|
|
|
},
|
|
|
|
{
|
2017-07-15 00:32:55 +00:00
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "RENAME",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "simple_variable_name"
|
2017-07-15 00:32:55 +00:00
|
|
|
},
|
|
|
|
"value": "variable_name"
|
|
|
|
},
|
|
|
|
{
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "special_variable_name"
|
2017-07-15 00:32:55 +00:00
|
|
|
}
|
|
|
|
]
|
2017-07-14 20:00:41 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-16 05:13:55 +00:00
|
|
|
"expansion": {
|
2017-07-14 20:00:41 +00:00
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "${"
|
|
|
|
},
|
|
|
|
{
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_variable_name"
|
2017-07-14 20:00:41 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ":"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ":?"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "="
|
2017-07-15 00:32:55 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ":-"
|
2017-07-14 20:00:41 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2017-07-14 23:47:25 +00:00
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "expression"
|
2017-07-14 20:00:41 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "BLANK"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "}"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-16 05:13:55 +00:00
|
|
|
"_variable_name": {
|
|
|
|
"type": "CHOICE",
|
2017-07-14 23:47:25 +00:00
|
|
|
"members": [
|
|
|
|
{
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "RENAME",
|
|
|
|
"content": {
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "leading_word"
|
|
|
|
},
|
|
|
|
"value": "variable_name"
|
2017-07-14 23:47:25 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "special_variable_name"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"command_substitution": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "$("
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "command"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ")"
|
|
|
|
}
|
|
|
|
]
|
2017-07-14 23:47:25 +00:00
|
|
|
},
|
|
|
|
{
|
2017-07-16 05:13:55 +00:00
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "`"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "command"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "`"
|
|
|
|
}
|
|
|
|
]
|
2017-07-14 23:47:25 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 19:43:42 +00:00
|
|
|
"file_redirect": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "file_descriptor"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "BLANK"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "<"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ">"
|
|
|
|
},
|
2017-07-15 00:14:23 +00:00
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ">>"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "&>"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "&>>"
|
|
|
|
},
|
2017-07-14 19:43:42 +00:00
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "<&"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ">&"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2017-07-15 00:14:23 +00:00
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "expression"
|
2017-07-14 19:43:42 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 20:54:05 +00:00
|
|
|
"heredoc_redirect": {
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "<<"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "<<-"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "heredoc"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 21:27:13 +00:00
|
|
|
"heredoc": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_simple_heredoc"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SEQ",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_heredoc_beginning"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "REPEAT",
|
|
|
|
"content": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "expansion"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-16 05:13:55 +00:00
|
|
|
"name": "simple_expansion"
|
2017-07-14 21:27:13 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_heredoc_middle"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_heredoc_end"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 19:28:54 +00:00
|
|
|
"leading_word": {
|
|
|
|
"type": "PATTERN",
|
2017-07-16 05:13:55 +00:00
|
|
|
"value": "[^`\"\\\\\\s#=|;:{}()]+"
|
2017-07-14 19:28:54 +00:00
|
|
|
},
|
|
|
|
"word": {
|
|
|
|
"type": "PATTERN",
|
2017-07-16 05:13:55 +00:00
|
|
|
"value": "[^\"`#\\\\\\s$<>{}&;()]+"
|
2017-07-14 21:34:49 +00:00
|
|
|
},
|
|
|
|
"comment": {
|
|
|
|
"type": "PATTERN",
|
|
|
|
"value": "#.*"
|
2017-07-14 23:29:28 +00:00
|
|
|
},
|
2017-07-16 05:13:55 +00:00
|
|
|
"simple_variable_name": {
|
|
|
|
"type": "PATTERN",
|
|
|
|
"value": "\\w+"
|
|
|
|
},
|
|
|
|
"special_variable_name": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "*"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "@"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "#"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "?"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "-"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "$"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "!"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "0"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "_"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2017-07-14 23:29:28 +00:00
|
|
|
"terminator": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ";"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": ";;"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "\n"
|
2017-07-15 00:32:55 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "&"
|
2017-07-14 23:29:28 +00:00
|
|
|
}
|
|
|
|
]
|
2017-07-14 19:28:54 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"extras": [
|
2017-07-14 21:34:49 +00:00
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "comment"
|
|
|
|
},
|
2017-07-14 19:28:54 +00:00
|
|
|
{
|
2017-07-14 21:39:28 +00:00
|
|
|
"type": "TOKEN",
|
|
|
|
"content": {
|
|
|
|
"type": "CHOICE",
|
|
|
|
"members": [
|
|
|
|
{
|
|
|
|
"type": "PATTERN",
|
|
|
|
"value": "\\s"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "STRING",
|
|
|
|
"value": "\\\n"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2017-07-14 19:28:54 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"conflicts": [],
|
2017-07-14 20:54:05 +00:00
|
|
|
"externals": [
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
2017-07-14 21:27:13 +00:00
|
|
|
"name": "_simple_heredoc"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_heredoc_beginning"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_heredoc_middle"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_heredoc_end"
|
2017-07-15 00:14:23 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "file_descriptor"
|
2017-07-15 00:41:14 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "SYMBOL",
|
|
|
|
"name": "_empty_value"
|
2017-07-14 20:54:05 +00:00
|
|
|
}
|
|
|
|
],
|
2017-07-14 19:28:54 +00:00
|
|
|
"inline": [
|
2017-07-14 23:29:28 +00:00
|
|
|
"statement",
|
2017-07-14 23:47:25 +00:00
|
|
|
"terminator",
|
2017-07-16 05:13:55 +00:00
|
|
|
"expression",
|
|
|
|
"_variable_name"
|
2017-07-14 19:28:54 +00:00
|
|
|
]
|
|
|
|
}
|