xo-reader: refactor: + parserstatemachine; use for def_expr
This commit is contained in:
parent
6a71f718bd
commit
034dac7dfd
11 changed files with 69 additions and 18 deletions
36
include/xo/reader/parserstatemachine.hpp
Normal file
36
include/xo/reader/parserstatemachine.hpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/* file parserstatemachine.hpp
|
||||
*
|
||||
* author: Roland Conybeare, Aug 2024
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "exprstate.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class parserstatemachine
|
||||
* @brief public parser state.
|
||||
*
|
||||
* Schematica parser state; sent to subsidiary single-feature state machines.
|
||||
* For example entry points for the lambda feature (@ref lambda_xs)
|
||||
* will accept a non-const parserstatemachine pointer argument
|
||||
**/
|
||||
class parserstatemachine {
|
||||
public:
|
||||
using Expression = xo::ast::Expression;
|
||||
|
||||
public:
|
||||
parserstatemachine(exprstatestack * p_stack,
|
||||
rp<Expression> * p_emit_expr)
|
||||
: p_stack_{p_stack}, p_emit_expr_{p_emit_expr} {}
|
||||
|
||||
public:
|
||||
exprstatestack * p_stack_;
|
||||
rp<Expression> * p_emit_expr_;
|
||||
};
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
||||
/* end parserstatemachine.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue