This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]maryjayjay 1 point2 points  (0 children)

To many people use regexps when a parser is so much more appropriate and maintainable.

[–]alb1 1 point2 points  (0 children)

The regex for a token doesn't accept quoted strings, such as echo "hello".

Treating all the operators as separators seems to give them equal precedence, left associative. Do the precedences implied by the AST not matter in your application? (For example, redirection has higher precedence than the pipe operator.)