-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
For the preliminary implementation, a pattern is an expression, with some wildcards.
Wildcards are valid identifiers starting by one underscore.
For instance, _a + _b*_a is supposed to match p + b*p but not p + b*c.
We can use that to define the elements of syntax that we want, for instance to define _x[_inds](_t) as the generic form of a timed and index variable (like v_{i,t+1})
There is a crude python implementation in https://github.com/EconForge/dolang/blob/master/dolang/pattern.py.
Some questions:
- are there available libraries which do it efficiently ?
- we probably want to "type" the wildcard so that, in the above example,
_tcould stand for a signed integer and_indswould be expected to be a list of indices - would we be better of by defining the expression parser ourselve instead of operating on the syntax tree ?
Metadata
Metadata
Assignees
Labels
No labels