Add 'xo-reader/' from commit 'c46c0f1cc4'
git-subtree-dir: xo-reader git-subtree-mainline:dacdeb2cd7git-subtree-split:c46c0f1cc4
This commit is contained in:
commit
0ae98c211d
48 changed files with 5184 additions and 0 deletions
47
xo-reader/include/xo/reader/sequence_xs.hpp
Normal file
47
xo-reader/include/xo/reader/sequence_xs.hpp
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/** @file sequence_xs.hpp
|
||||
*
|
||||
* Author: Roland Conybeare
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "exprstate.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace xo {
|
||||
namespace ast { class Sequence; }
|
||||
namespace ast { class Lambda; }
|
||||
|
||||
namespace scm {
|
||||
class sequence_xs : public exprstate {
|
||||
public:
|
||||
using Sequence = xo::ast::Sequence;
|
||||
using Lambda = xo::ast::Lambda;
|
||||
|
||||
public:
|
||||
/** start parsing a sequence-expr.
|
||||
* input begins with first expression in the sequence.
|
||||
**/
|
||||
static void start(parserstatemachine * p_psm);
|
||||
|
||||
virtual void on_expr(ref::brw<Expression> expr,
|
||||
parserstatemachine * p_psm) override;
|
||||
|
||||
virtual void on_rightbrace_token(const token_type & tk,
|
||||
parserstatemachine * p_psm) override;
|
||||
|
||||
private:
|
||||
sequence_xs();
|
||||
|
||||
/** named ctor idiom **/
|
||||
static std::unique_ptr<sequence_xs> make();
|
||||
|
||||
private:
|
||||
/** will build SequenceExpr from in-order contents of this vector **/
|
||||
std::vector<rp<Expression>> expr_v_;
|
||||
};
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
||||
/** end sequence_xs.hpp **/
|
||||
Loading…
Add table
Add a link
Reference in a new issue