xo-reader: feat: + var lookup in envframestack, psm
This commit is contained in:
parent
3b57a1f142
commit
eed5cdf691
4 changed files with 51 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ namespace xo {
|
|||
class parserstatemachine {
|
||||
public:
|
||||
using Expression = xo::ast::Expression;
|
||||
using Variable = xo::ast::Variable;
|
||||
|
||||
public:
|
||||
parserstatemachine(exprstatestack * p_stack,
|
||||
|
|
@ -33,6 +34,14 @@ namespace xo {
|
|||
exprstate & top_exprstate();
|
||||
void push_exprstate(std::unique_ptr<exprstate> x);
|
||||
|
||||
/** lookup variable name in lexical context represented by
|
||||
* this psm. nullptr if not found
|
||||
**/
|
||||
rp<Variable> lookup_var(const std::string & x) const;
|
||||
|
||||
void push_envframe(envframe x);
|
||||
void pop_envframe();
|
||||
|
||||
public:
|
||||
/** stack of incomplete parser work.
|
||||
* generally speaking, push when to start new work for nested content;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue