ECE 2524 - The Final Piece: Command Parser

ECE 2524

Introduction to Unix for Engineers

The Final Piece: Command Parser

Last modified

Command Parser

  • read a line
  • split the line
  • use first word in line to route to a particular API function, passing remaining words as arguments

Design Rule Discussion

More Complex Parsing

What if you wanted to handle commands such as

> throw ball at window
> fight monster with magic sward
> drop 5 candles
  • regular expressions
  • flex/bison (and Python’s C bindings)