ISISComputingGroup / lewis-ess

Let's write intricate simulators!
GNU General Public License v3.0
21 stars 19 forks source link

scanf format specification for Cmd and Var #227

Closed MichaelWedel closed 7 years ago

MichaelWedel commented 7 years ago

This fixes #216.

Thanks to the scanf package, it's possible to make scanf format specifications available for Cmd and Var.

The changes are not complete, this is just my current suggestion. It preserves everything that has been implemented so far (regular expressions for Cmd and Var by default), makes it relatively easy for an interface to use scanf patterns for commands by default and still leaves the possibility to have "one offs" within a device. It does not place any syntax constraints on the patterns and adds the possibility for even more types of patterns (that can be translated to regex)...should that ever be necessary.

If there's no major disagreement I'd go forward with adding/adjusting documentation.

MichaelWedel commented 7 years ago

This contains updates as suggested. It's a bit less regex-centric now, but regex groups are still being used in Func. Maybe that could move into PatternMatcher as well. If you're generally okay with the way this is implemented, I'd like to go ahead and update documentation.