Implementation
@override
Map<String, List<JParse>> get parses => {
'root': [
JParse(
r'(clear|ls|whoami)', TkCMDSingle, ['props_end', 'exec_orend']),
JParse.bygroups(r'(cd|vim|whereis|rm)([\t\ ]*)', [TkCMDPath, BLANK],
['props_end', 'exec_orend', 'path']),
JParse.bygroups(r'(which)([\t\ ]*)', [TkCMDCmmdName, BLANK],
['exec_end', 'commondnames']),
JParse.empty(['exec_end'])
],
'path': [
JParse(r'\/(\w+\/?)+', TkAbsPath, [POP]),
JParse(r'\w+(\/(\w+\/?)*)?', TkRltvPath, [POP]),
JParse.empty([StErrNotLegalPath])
],
'exec_orend': [
// END PART
JParse.bygroups(r'(\s*)(\n)', [BLANK, TkExecSymbol], [POPROOT]),
// OR PART
JParse(r'\s+', BLANK, [POP]),
],
'exec_end': [
JParse.bygroups(r'(\s*)(\n)', [BLANK, TkExecSymbol], [POPROOT]),
JParse.empty([StErrExecSymbolAbsent])
],
'props_end': [
JParse(r'-(a|h)', TkProps, [POPROOT]),
],
'commondnames': [
JParse(r'(clear|ls|whoami|cd|vim|whereis|rm|which)', TkNAMECommands,
[POP]),
JParse.empty([StErrNotCommand])
]
};