xo-reader2: use DUniqueString* to report parsed formal
This commit is contained in:
parent
fb48c94be6
commit
1c2352c008
50 changed files with 377 additions and 65 deletions
|
|
@ -166,6 +166,10 @@ namespace xo {
|
|||
ParserStateMachine * p_psm)
|
||||
{
|
||||
if (fstate_ == formalstatetype::formal_0) {
|
||||
// parsed symbol @c sym is stored in tokenizer memory;
|
||||
// must be copied to storage with expression lifetime,
|
||||
// hence call to intern_string()
|
||||
|
||||
this->fstate_ = formalstatetype::formal_1;
|
||||
this->name_ = p_psm->intern_string(sym);
|
||||
return;
|
||||
|
|
@ -180,11 +184,34 @@ namespace xo {
|
|||
DExpectFormalArgSsm::on_parsed_typedescr(TypeDescr td,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
if (fstate_ == formalstatetype::formal_2) {
|
||||
assert(name_);
|
||||
|
||||
p_psm->pop_ssm();
|
||||
p_psm->on_parsed_formal(name_, td);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
p_psm->illegal_input_on_typedescr("DExpectFormalArgSsm::on_parsed_typedescr",
|
||||
td,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectFormalArgSsm::on_parsed_formal(const DUniqueString * param_name,
|
||||
TypeDescr param_type,
|
||||
ParserStateMachine * p_psm)
|
||||
{
|
||||
// NOTE: (param_name,param_type) *produced* by this SSM,
|
||||
// but never *consumed*
|
||||
|
||||
p_psm->illegal_parsed_formal("DExpectFormalArgSsm::on_parsed_formal",
|
||||
param_name,
|
||||
param_type,
|
||||
this->get_expect_str());
|
||||
}
|
||||
|
||||
void
|
||||
DExpectFormalArgSsm::on_parsed_expression(obj<AExpression> expr,
|
||||
ParserStateMachine * p_psm)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue