Previous Up Next

13  Command-line semantic match

It is possible to specify a semantic match on the spatch command line, using the argument -sp. In such a semantic match, any token beginning with a capital letter is assumed to be a metavariable of type metavariable. In this case, the parser must be able to figure out what kind of metavariable it is. It is also possible to specify the type of a metavariable by enclosing the type in :’s, concatenated directly to the metavariable name.

Some examples of semantic matches that can be given as an argument to -sp are as follows:

When constraints, e.g. when != e, are allowed but the expression e must be represented as a single token.

The generated semantic match behaves as though there were a * in front of every token.

Previous Up Next