Skip to content

Instantly share code, notes, and snippets.

@ikrima
Last active November 18, 2020 04:57
Show Gist options
  • Save ikrima/3345769249993cafd7851390966089cb to your computer and use it in GitHub Desktop.
Save ikrima/3345769249993cafd7851390966089cb to your computer and use it in GitHub Desktop.
tree-sitter c++ bindings + strongly typed adaptor generator
const _ = require('lodash');
const ndetypes = require(`./src/node-types.json`);
let symtbl = new Set()
let fldtbl = new Set()
let cde_astfwds = "";
let cde_astdefs = "";
let cde_astdcl = String.raw`
struct TlvBase_cst : public CSTNode_o {
ES2DFLT_XTORS(TlvBase_cst)
Array_o<CSTNode_o> children() const = delete;
index_t childCount() const = delete;
CSTNode_o childByIdx(uint32_t _chldidx) const = delete;
CSTNode_o namedChild(uint32_t _chldidx) const = delete;
uint32_t namedChildCount() const = delete;
Array_o<CSTNode_o> namedChildren() const = delete;
CSTNode_o childByFld(TSFieldId _fldid) const = delete;
Array_o<CSTNode_o> fldChildren(TSFieldId _fldid) const = delete;
CSTNode_o nxtSibling() const = delete;
CSTNode_o prvSibling() const = delete;
CSTNode_o nxtNamedSibling() const = delete;
CSTNode_o prvNamedSibling() const = delete;
TlvBase_cst(CSTNode_o _nde) : CSTNode_o(_nde) {}
template<typename CstTy>
Array_o<CstTy> namedChldrnAdaptor() const {
const index_t chldcnt = CSTNode_o::namedChildCount();
Array_o<CstTy> ret(ES2AlctrHndl, chldcnt);
for (index_t idx = 0; idx < chldcnt; ++idx) {
ES2PLCE_NEW(ret.pushUninit()){ CSTNode_o::namedChild(idx)};
}
return ret;
}
template<typename CstTy>
Array_o<CstTy> fldChldrnAdaptor(TSFieldId _fldid) const {
return CstTy(CSTNode_o::childByFld(_fldid)).template namedChldrnAdaptor<CstTy>();
}
};
template <typename FstTy, typename SndTy, typename... RestTy>
struct TlvSumt_cst : public TlvBase_cst {
using Base = TlvSumt_cst<FstTy, SndTy, RestTy...>;
static bool classof(TlvBase_cst const* _cst) {
return llvm::isa<FstTy>(_cst) || llvm::isa<SndTy>(_cst) || llvm::isa<RestTy...>(_cst);
}
ES2FRCINL() TlvSumt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(TlvSumt_cst::classof(this), "Mismatached node type");
}
};
`;
const kind2type = inkind => `${_.capitalize(_.trimStart(inkind,'_'))}_cst`;
const isCodegenTag = nde => _.startsWith(nde.type, "_codegentag_");
const isSuperTy = nde => !isCodegenTag(nde) && nde.hasOwnProperty('subtypes');
const isConcreteTy = nde => nde.named && !isCodegenTag(nde) && !isSuperTy(nde);
const getRetSumTy = fldsOrChldrn => {
let retKinds = fldsOrChldrn.types
.filter(t => t.named)
.map(t => t.type);
// let retTy = (retKinds.length > 1)
// ? `PointerUnion<${retKinds.join(',')}>`
// : retKinds[0];
let retTy = (retKinds.length === 1)
? kind2type(retKinds[0])
: `TlvBase_cst`;
return retTy;
};
let ndeTyMap = new Map();
ndetypes.forEach(nde => ndeTyMap.set(nde.type, nde))
let superTyNdes = _.filter(Array.from(ndetypes.values()), isSuperTy );
for (let nde of ndetypes.filter(n => isConcreteTy(n))) {
let asttype = kind2type(nde.type);
symtbl.add(nde.type);
cde_astfwds += `struct ${asttype};\n`
cde_astdcl += String.raw`
struct ${asttype} : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().${nde.type}_sym; }
ES2FRCINL() ${asttype}(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(${asttype}::classof(this), "Mismatached node type");
}
`;
if (nde.hasOwnProperty('fields')) {
for(let fldname in nde.fields) {
let ndefld = nde.fields[fldname];
fldtbl.add(fldname);
let retTy = getRetSumTy(ndefld);
cde_astdcl += ndefld.multiple
? ` Array_o<${retTy}> ${fldname}Nde() const;\n`
: ` ${retTy} ${fldname}Nde() const;\n`;
cde_astdefs += ndefld.multiple
? `ES2FRCINL() Array_o<${retTy}> ${asttype}::${fldname}Nde() const { return fldChldrnAdaptor<${retTy}>(TlvSymtbl::get().${fldname}_fld); }\n`
: `ES2FRCINL() ${retTy} ${asttype}::${fldname}Nde() const { return ${retTy}{CSTNode_o::childByFld(TlvSymtbl::get().${fldname}_fld)}; }\n`;
}
}
if (nde.hasOwnProperty('children')) {
let ndechldrn = nde.children;
let retTy = getRetSumTy(ndechldrn);
cde_astdcl += ndechldrn.multiple
? ` Array_o<${retTy}> childNodes() const;\n`
: ` ${retTy} childNode() const;\n`;
cde_astdefs += ndechldrn.multiple
? `ES2FRCINL() Array_o<${retTy}> ${asttype}::childNodes() const { return namedChldrnAdaptor<${retTy}>(); }\n`
: `ES2FRCINL() ${retTy} ${asttype}::childNode() const { return CSTNode_o::namedChild(0); }\n`;
}
cde_astdcl += `};\n\n`
}
for (let superTy of superTyNdes){
let asttype = kind2type(superTy.type);
symtbl.add(superTy.type);
let subTys = superTy.subtypes
.filter(t => t.named)
.map(t => kind2type(t.type) )
.join(`,\n `);
cde_astfwds += `struct ${asttype};\n`
cde_astdcl += String.raw`
struct ${asttype} : public TlvSumt_cst<
${subTys}> {
using Base::Base;
};
`;
}
fs = require('fs');
{
let cde_symtbldcl = `struct TlvSymtbl {\n`;
for(let ndety of symtbl) {
cde_symtbldcl += ` TSSymbol ${ndety}_sym;\n`
}
cde_symtbldcl += '\n';
for(let fldty of fldtbl) {
cde_symtbldcl += ` TSFieldId ${fldty}_fld;\n`
}
cde_symtbldcl += String.raw`
static ES2FRCINL() TlvSymtbl const& get() { return TlvSymtbl::s_tbl; }
static void init(CSTLang_o _lang);
ES2DSL_API static TlvSymtbl s_tbl;
};
`;
let code_h = String.raw`
#pragma once
#include "es2core/datastructures/es2array.h"
#include "es2core/datastructures/es2strview.h"
#include "es2dsl/ast/es2ast.h"
#include "llvm/Support/Casting.h"
namespace es2
{
struct TlvBase_cst;
}
namespace mlir
{
class Operation;
class OpBuilder;
namespace tlv
{
ES2DSL_API mlir::Operation* tlvast_mlirgen(es2::StrView_t _srcbuf, es2::StrView_t _filename, es2::TlvBase_cst const& _cstnde);
}
}
namespace es2
{
${cde_symtbldcl}
${cde_astfwds}
${cde_astdcl}
${cde_astdefs}
}
`;
fs.writeFileSync(`../../code/es2dsl/incl/es2dsl/ast/es2ast_tlv.h`,code_h);
}
{
let cde_symtbldef = String.raw`
TlvSymtbl TlvSymtbl::s_tbl = {};
void TlvSymtbl::init(CSTLang_o _lang) {
`;
for(let ndeTy of symtbl) {
cde_symtbldef += ` TlvSymtbl::s_tbl.${ndeTy}_sym = _lang.symId("${ndeTy}",true);\n`;
}
cde_symtbldef += '\n';
for(let ndeTy of fldtbl) {
cde_symtbldef += ` TlvSymtbl::s_tbl.${ndeTy}_fld = _lang.fldId("${ndeTy}");\n`;
}
cde_symtbldef += `}\n`;
let code_cpp = String.raw`
#include "es2dsl/ast/es2ast_tlv.h"
using namespace es2;
${cde_symtbldef}
`;
fs.writeFileSync(`../../code/es2dsl/src/ast/es2ast_tlv.cpp`, code_cpp);
}
#pragma once
#include "es2core/datastructures/es2array.h"
#include "es2core/datastructures/es2strview.h"
#include "es2dsl/ast/es2ast.h"
#include "llvm/Support/Casting.h"
namespace es2
{
struct TlvBase_cst;
}
namespace mlir
{
class Operation;
class OpBuilder;
namespace tlv
{
ES2DSL_API mlir::Operation* tlvast_mlirgen(es2::StrView_t _srcbuf, es2::StrView_t _filename, es2::TlvBase_cst const& _cstnde);
}
}
namespace es2
{
struct TlvSymtbl {
TSSymbol argument_list_sym;
TSSymbol array_type_spec_sym;
TSSymbol assignment_expr_sym;
TSSymbol binary_expr_sym;
TSSymbol block_stmt_sym;
TSSymbol break_stmt_sym;
TSSymbol call_expr_sym;
TSSymbol case_stmt_sym;
TSSymbol cast_expr_sym;
TSSymbol char_lit_sym;
TSSymbol comma_expr_sym;
TSSymbol compound_literal_expr_sym;
TSSymbol concat_str_lit_sym;
TSSymbol conditional_expr_sym;
TSSymbol continue_stmt_sym;
TSSymbol do_stmt_sym;
TSSymbol expression_stmt_sym;
TSSymbol field_designator_sym;
TSSymbol field_expr_sym;
TSSymbol fld_def_sym;
TSSymbol for_stmt_sym;
TSSymbol goto_stmt_sym;
TSSymbol if_stmt_sym;
TSSymbol initializer_list_sym;
TSSymbol initializer_pair_sym;
TSSymbol labeled_stmt_sym;
TSSymbol module_sym;
TSSymbol opdef_sym;
TSSymbol opdef_meta_sym;
TSSymbol opimport_meta_sym;
TSSymbol oprm_sym;
TSSymbol oprm_meta_sym;
TSSymbol oprmblk_sym;
TSSymbol parenthesized_expr_sym;
TSSymbol pointer_expr_sym;
TSSymbol ptr_type_spec_sym;
TSSymbol ref_type_spec_sym;
TSSymbol return_stmt_sym;
TSSymbol simple_type_spec_sym;
TSSymbol sizeof_expr_sym;
TSSymbol str_lit_sym;
TSSymbol struct_def_sym;
TSSymbol subscript_designator_sym;
TSSymbol subscript_expr_sym;
TSSymbol switch_stmt_sym;
TSSymbol type_descriptor_sym;
TSSymbol type_qualifier_sym;
TSSymbol unary_expr_sym;
TSSymbol update_expr_sym;
TSSymbol var_decl_sym;
TSSymbol varinit_decl_sym;
TSSymbol while_stmt_sym;
TSSymbol comment_sym;
TSSymbol escape_sequence_sym;
TSSymbol false_sym;
TSSymbol field_id_sym;
TSSymbol identifier_sym;
TSSymbol import_id_sym;
TSSymbol nullptr_sym;
TSSymbol num_lit_sym;
TSSymbol prmflags_sym;
TSSymbol stmt_id_sym;
TSSymbol true_sym;
TSSymbol type_id_sym;
TSSymbol var_id_sym;
TSSymbol _expr_sym;
TSSymbol _stmt_sym;
TSSymbol _type_spec_sym;
TSFieldId left_fld;
TSFieldId right_fld;
TSFieldId operator_fld;
TSFieldId arguments_fld;
TSFieldId function_fld;
TSFieldId value_fld;
TSFieldId type_fld;
TSFieldId alternative_fld;
TSFieldId condition_fld;
TSFieldId consequence_fld;
TSFieldId body_fld;
TSFieldId argument_fld;
TSFieldId field_fld;
TSFieldId fldname_fld;
TSFieldId fldtype_fld;
TSFieldId initializer_fld;
TSFieldId update_fld;
TSFieldId label_fld;
TSFieldId designator_fld;
TSFieldId evalFn_fld;
TSFieldId opdefmeta_fld;
TSFieldId oprmblk_fld;
TSFieldId name_fld;
TSFieldId module_fld;
TSFieldId oprmeta_fld;
TSFieldId prmflags_fld;
TSFieldId flddef_fld;
TSFieldId index_fld;
TSFieldId vardecl_fld;
static ES2FRCINL() TlvSymtbl const& get() { return TlvSymtbl::s_tbl; }
static void init(CSTLang_o _lang);
ES2DSL_API static TlvSymtbl s_tbl;
};
struct Argument_list_cst;
struct Array_type_spec_cst;
struct Assignment_expr_cst;
struct Binary_expr_cst;
struct Block_stmt_cst;
struct Break_stmt_cst;
struct Call_expr_cst;
struct Case_stmt_cst;
struct Cast_expr_cst;
struct Char_lit_cst;
struct Comma_expr_cst;
struct Compound_literal_expr_cst;
struct Concat_str_lit_cst;
struct Conditional_expr_cst;
struct Continue_stmt_cst;
struct Do_stmt_cst;
struct Expression_stmt_cst;
struct Field_designator_cst;
struct Field_expr_cst;
struct Fld_def_cst;
struct For_stmt_cst;
struct Goto_stmt_cst;
struct If_stmt_cst;
struct Initializer_list_cst;
struct Initializer_pair_cst;
struct Labeled_stmt_cst;
struct Module_cst;
struct Opdef_cst;
struct Opdef_meta_cst;
struct Opimport_meta_cst;
struct Oprm_cst;
struct Oprm_meta_cst;
struct Oprmblk_cst;
struct Parenthesized_expr_cst;
struct Pointer_expr_cst;
struct Ptr_type_spec_cst;
struct Ref_type_spec_cst;
struct Return_stmt_cst;
struct Simple_type_spec_cst;
struct Sizeof_expr_cst;
struct Str_lit_cst;
struct Struct_def_cst;
struct Subscript_designator_cst;
struct Subscript_expr_cst;
struct Switch_stmt_cst;
struct Type_descriptor_cst;
struct Type_qualifier_cst;
struct Unary_expr_cst;
struct Update_expr_cst;
struct Var_decl_cst;
struct Varinit_decl_cst;
struct While_stmt_cst;
struct Comment_cst;
struct Escape_sequence_cst;
struct False_cst;
struct Field_id_cst;
struct Identifier_cst;
struct Import_id_cst;
struct Nullptr_cst;
struct Num_lit_cst;
struct Prmflags_cst;
struct Stmt_id_cst;
struct True_cst;
struct Type_id_cst;
struct Var_id_cst;
struct Expr_cst;
struct Stmt_cst;
struct Type_spec_cst;
struct TlvBase_cst : public CSTNode_o {
ES2DFLT_XTORS(TlvBase_cst)
Array_o<CSTNode_o> children() const = delete;
index_t childCount() const = delete;
CSTNode_o childByIdx(uint32_t _chldidx) const = delete;
CSTNode_o namedChild(uint32_t _chldidx) const = delete;
uint32_t namedChildCount() const = delete;
Array_o<CSTNode_o> namedChildren() const = delete;
CSTNode_o childByFld(TSFieldId _fldid) const = delete;
Array_o<CSTNode_o> fldChildren(TSFieldId _fldid) const = delete;
CSTNode_o nxtSibling() const = delete;
CSTNode_o prvSibling() const = delete;
CSTNode_o nxtNamedSibling() const = delete;
CSTNode_o prvNamedSibling() const = delete;
TlvBase_cst(CSTNode_o _nde) : CSTNode_o(_nde) {}
template<typename CstTy>
Array_o<CstTy> namedChldrnAdaptor() const {
const index_t chldcnt = CSTNode_o::namedChildCount();
Array_o<CstTy> ret(ES2AlctrHndl, chldcnt);
for (index_t idx = 0; idx < chldcnt; ++idx) {
ES2PLCE_NEW(ret.pushUninit()){ CSTNode_o::namedChild(idx)};
}
return ret;
}
template<typename CstTy>
Array_o<CstTy> fldChldrnAdaptor(TSFieldId _fldid) const {
return CstTy(CSTNode_o::childByFld(_fldid)).template namedChldrnAdaptor<CstTy>();
}
};
template <typename FstTy, typename SndTy, typename... RestTy>
struct TlvSumt_cst : public TlvBase_cst {
using Base = TlvSumt_cst<FstTy, SndTy, RestTy...>;
static bool classof(TlvBase_cst const* _cst) {
return llvm::isa<FstTy>(_cst) || llvm::isa<SndTy>(_cst) || llvm::isa<RestTy...>(_cst);
}
ES2FRCINL() TlvSumt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(TlvSumt_cst::classof(this), "Mismatached node type");
}
};
struct Argument_list_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().argument_list_sym; }
ES2FRCINL() Argument_list_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Argument_list_cst::classof(this), "Mismatached node type");
}
Array_o<Expr_cst> childNodes() const;
};
struct Array_type_spec_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().array_type_spec_sym; }
ES2FRCINL() Array_type_spec_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Array_type_spec_cst::classof(this), "Mismatached node type");
}
Array_o<TlvBase_cst> childNodes() const;
};
struct Assignment_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().assignment_expr_sym; }
ES2FRCINL() Assignment_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Assignment_expr_cst::classof(this), "Mismatached node type");
}
TlvBase_cst leftNde() const;
Expr_cst rightNde() const;
};
struct Binary_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().binary_expr_sym; }
ES2FRCINL() Binary_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Binary_expr_cst::classof(this), "Mismatached node type");
}
Expr_cst leftNde() const;
TlvBase_cst operatorNde() const;
Expr_cst rightNde() const;
};
struct Block_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().block_stmt_sym; }
ES2FRCINL() Block_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Block_stmt_cst::classof(this), "Mismatached node type");
}
Array_o<Stmt_cst> childNodes() const;
};
struct Break_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().break_stmt_sym; }
ES2FRCINL() Break_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Break_stmt_cst::classof(this), "Mismatached node type");
}
};
struct Call_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().call_expr_sym; }
ES2FRCINL() Call_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Call_expr_cst::classof(this), "Mismatached node type");
}
Argument_list_cst argumentsNde() const;
Expr_cst functionNde() const;
};
struct Case_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().case_stmt_sym; }
ES2FRCINL() Case_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Case_stmt_cst::classof(this), "Mismatached node type");
}
Expr_cst valueNde() const;
Array_o<TlvBase_cst> childNodes() const;
};
struct Cast_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().cast_expr_sym; }
ES2FRCINL() Cast_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Cast_expr_cst::classof(this), "Mismatached node type");
}
Type_descriptor_cst typeNde() const;
Expr_cst valueNde() const;
};
struct Char_lit_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().char_lit_sym; }
ES2FRCINL() Char_lit_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Char_lit_cst::classof(this), "Mismatached node type");
}
Escape_sequence_cst childNode() const;
};
struct Comma_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().comma_expr_sym; }
ES2FRCINL() Comma_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Comma_expr_cst::classof(this), "Mismatached node type");
}
Expr_cst leftNde() const;
TlvBase_cst rightNde() const;
};
struct Compound_literal_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().compound_literal_expr_sym; }
ES2FRCINL() Compound_literal_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Compound_literal_expr_cst::classof(this), "Mismatached node type");
}
Type_descriptor_cst typeNde() const;
Initializer_list_cst valueNde() const;
};
struct Concat_str_lit_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().concat_str_lit_sym; }
ES2FRCINL() Concat_str_lit_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Concat_str_lit_cst::classof(this), "Mismatached node type");
}
Array_o<Str_lit_cst> childNodes() const;
};
struct Conditional_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().conditional_expr_sym; }
ES2FRCINL() Conditional_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Conditional_expr_cst::classof(this), "Mismatached node type");
}
Expr_cst alternativeNde() const;
Expr_cst conditionNde() const;
Expr_cst consequenceNde() const;
};
struct Continue_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().continue_stmt_sym; }
ES2FRCINL() Continue_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Continue_stmt_cst::classof(this), "Mismatached node type");
}
};
struct Do_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().do_stmt_sym; }
ES2FRCINL() Do_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Do_stmt_cst::classof(this), "Mismatached node type");
}
Stmt_cst bodyNde() const;
Parenthesized_expr_cst conditionNde() const;
};
struct Expression_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().expression_stmt_sym; }
ES2FRCINL() Expression_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Expression_stmt_cst::classof(this), "Mismatached node type");
}
TlvBase_cst childNode() const;
};
struct Field_designator_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().field_designator_sym; }
ES2FRCINL() Field_designator_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Field_designator_cst::classof(this), "Mismatached node type");
}
Field_id_cst childNode() const;
};
struct Field_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().field_expr_sym; }
ES2FRCINL() Field_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Field_expr_cst::classof(this), "Mismatached node type");
}
Expr_cst argumentNde() const;
Field_id_cst fieldNde() const;
};
struct Fld_def_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().fld_def_sym; }
ES2FRCINL() Fld_def_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Fld_def_cst::classof(this), "Mismatached node type");
}
Field_id_cst fldnameNde() const;
Type_spec_cst fldtypeNde() const;
};
struct For_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().for_stmt_sym; }
ES2FRCINL() For_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(For_stmt_cst::classof(this), "Mismatached node type");
}
Expr_cst conditionNde() const;
TlvBase_cst initializerNde() const;
TlvBase_cst updateNde() const;
Stmt_cst childNode() const;
};
struct Goto_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().goto_stmt_sym; }
ES2FRCINL() Goto_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Goto_stmt_cst::classof(this), "Mismatached node type");
}
Stmt_id_cst labelNde() const;
};
struct If_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().if_stmt_sym; }
ES2FRCINL() If_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(If_stmt_cst::classof(this), "Mismatached node type");
}
Stmt_cst alternativeNde() const;
Parenthesized_expr_cst conditionNde() const;
Stmt_cst consequenceNde() const;
};
struct Initializer_list_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().initializer_list_sym; }
ES2FRCINL() Initializer_list_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Initializer_list_cst::classof(this), "Mismatached node type");
}
Array_o<TlvBase_cst> childNodes() const;
};
struct Initializer_pair_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().initializer_pair_sym; }
ES2FRCINL() Initializer_pair_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Initializer_pair_cst::classof(this), "Mismatached node type");
}
Array_o<TlvBase_cst> designatorNde() const;
TlvBase_cst valueNde() const;
};
struct Labeled_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().labeled_stmt_sym; }
ES2FRCINL() Labeled_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Labeled_stmt_cst::classof(this), "Mismatached node type");
}
Stmt_id_cst labelNde() const;
Stmt_cst childNode() const;
};
struct Module_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().module_sym; }
ES2FRCINL() Module_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Module_cst::classof(this), "Mismatached node type");
}
Array_o<TlvBase_cst> childNodes() const;
};
struct Opdef_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().opdef_sym; }
ES2FRCINL() Opdef_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Opdef_cst::classof(this), "Mismatached node type");
}
Block_stmt_cst bodyNde() const;
Identifier_cst evalFnNde() const;
Opdef_meta_cst opdefmetaNde() const;
Oprmblk_cst oprmblkNde() const;
};
struct Opdef_meta_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().opdef_meta_sym; }
ES2FRCINL() Opdef_meta_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Opdef_meta_cst::classof(this), "Mismatached node type");
}
Identifier_cst nameNde() const;
};
struct Opimport_meta_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().opimport_meta_sym; }
ES2FRCINL() Opimport_meta_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Opimport_meta_cst::classof(this), "Mismatached node type");
}
Import_id_cst moduleNde() const;
};
struct Oprm_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().oprm_sym; }
ES2FRCINL() Oprm_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Oprm_cst::classof(this), "Mismatached node type");
}
Identifier_cst nameNde() const;
Oprm_meta_cst oprmetaNde() const;
Type_spec_cst typeNde() const;
};
struct Oprm_meta_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().oprm_meta_sym; }
ES2FRCINL() Oprm_meta_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Oprm_meta_cst::classof(this), "Mismatached node type");
}
Prmflags_cst prmflagsNde() const;
};
struct Oprmblk_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().oprmblk_sym; }
ES2FRCINL() Oprmblk_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Oprmblk_cst::classof(this), "Mismatached node type");
}
Array_o<Oprm_cst> childNodes() const;
};
struct Parenthesized_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().parenthesized_expr_sym; }
ES2FRCINL() Parenthesized_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Parenthesized_expr_cst::classof(this), "Mismatached node type");
}
TlvBase_cst childNode() const;
};
struct Pointer_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().pointer_expr_sym; }
ES2FRCINL() Pointer_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Pointer_expr_cst::classof(this), "Mismatached node type");
}
Expr_cst argumentNde() const;
TlvBase_cst operatorNde() const;
};
struct Ptr_type_spec_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().ptr_type_spec_sym; }
ES2FRCINL() Ptr_type_spec_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Ptr_type_spec_cst::classof(this), "Mismatached node type");
}
Array_o<TlvBase_cst> childNodes() const;
};
struct Ref_type_spec_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().ref_type_spec_sym; }
ES2FRCINL() Ref_type_spec_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Ref_type_spec_cst::classof(this), "Mismatached node type");
}
Array_o<TlvBase_cst> childNodes() const;
};
struct Return_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().return_stmt_sym; }
ES2FRCINL() Return_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Return_stmt_cst::classof(this), "Mismatached node type");
}
TlvBase_cst childNode() const;
};
struct Simple_type_spec_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().simple_type_spec_sym; }
ES2FRCINL() Simple_type_spec_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Simple_type_spec_cst::classof(this), "Mismatached node type");
}
};
struct Sizeof_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().sizeof_expr_sym; }
ES2FRCINL() Sizeof_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Sizeof_expr_cst::classof(this), "Mismatached node type");
}
Type_descriptor_cst typeNde() const;
Expr_cst valueNde() const;
};
struct Str_lit_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().str_lit_sym; }
ES2FRCINL() Str_lit_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Str_lit_cst::classof(this), "Mismatached node type");
}
Array_o<Escape_sequence_cst> childNodes() const;
};
struct Struct_def_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().struct_def_sym; }
ES2FRCINL() Struct_def_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Struct_def_cst::classof(this), "Mismatached node type");
}
Array_o<Fld_def_cst> flddefNde() const;
Type_id_cst nameNde() const;
};
struct Subscript_designator_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().subscript_designator_sym; }
ES2FRCINL() Subscript_designator_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Subscript_designator_cst::classof(this), "Mismatached node type");
}
Expr_cst childNode() const;
};
struct Subscript_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().subscript_expr_sym; }
ES2FRCINL() Subscript_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Subscript_expr_cst::classof(this), "Mismatached node type");
}
Expr_cst argumentNde() const;
Expr_cst indexNde() const;
};
struct Switch_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().switch_stmt_sym; }
ES2FRCINL() Switch_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Switch_stmt_cst::classof(this), "Mismatached node type");
}
Block_stmt_cst bodyNde() const;
Parenthesized_expr_cst conditionNde() const;
};
struct Type_descriptor_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().type_descriptor_sym; }
ES2FRCINL() Type_descriptor_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Type_descriptor_cst::classof(this), "Mismatached node type");
}
Type_spec_cst typeNde() const;
Array_o<Type_qualifier_cst> childNodes() const;
};
struct Type_qualifier_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().type_qualifier_sym; }
ES2FRCINL() Type_qualifier_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Type_qualifier_cst::classof(this), "Mismatached node type");
}
};
struct Unary_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().unary_expr_sym; }
ES2FRCINL() Unary_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Unary_expr_cst::classof(this), "Mismatached node type");
}
Expr_cst argumentNde() const;
TlvBase_cst operatorNde() const;
};
struct Update_expr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().update_expr_sym; }
ES2FRCINL() Update_expr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Update_expr_cst::classof(this), "Mismatached node type");
}
Expr_cst argumentNde() const;
TlvBase_cst operatorNde() const;
};
struct Var_decl_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().var_decl_sym; }
ES2FRCINL() Var_decl_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Var_decl_cst::classof(this), "Mismatached node type");
}
Type_spec_cst typeNde() const;
Array_o<TlvBase_cst> vardeclNde() const;
Array_o<Type_qualifier_cst> childNodes() const;
};
struct Varinit_decl_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().varinit_decl_sym; }
ES2FRCINL() Varinit_decl_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Varinit_decl_cst::classof(this), "Mismatached node type");
}
TlvBase_cst valueNde() const;
Var_id_cst vardeclNde() const;
};
struct While_stmt_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().while_stmt_sym; }
ES2FRCINL() While_stmt_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(While_stmt_cst::classof(this), "Mismatached node type");
}
Stmt_cst bodyNde() const;
Parenthesized_expr_cst conditionNde() const;
};
struct Comment_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().comment_sym; }
ES2FRCINL() Comment_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Comment_cst::classof(this), "Mismatached node type");
}
};
struct Escape_sequence_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().escape_sequence_sym; }
ES2FRCINL() Escape_sequence_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Escape_sequence_cst::classof(this), "Mismatached node type");
}
};
struct False_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().false_sym; }
ES2FRCINL() False_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(False_cst::classof(this), "Mismatached node type");
}
};
struct Field_id_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().field_id_sym; }
ES2FRCINL() Field_id_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Field_id_cst::classof(this), "Mismatached node type");
}
};
struct Identifier_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().identifier_sym; }
ES2FRCINL() Identifier_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Identifier_cst::classof(this), "Mismatached node type");
}
};
struct Import_id_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().import_id_sym; }
ES2FRCINL() Import_id_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Import_id_cst::classof(this), "Mismatached node type");
}
};
struct Nullptr_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().nullptr_sym; }
ES2FRCINL() Nullptr_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Nullptr_cst::classof(this), "Mismatached node type");
}
};
struct Num_lit_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().num_lit_sym; }
ES2FRCINL() Num_lit_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Num_lit_cst::classof(this), "Mismatached node type");
}
};
struct Prmflags_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().prmflags_sym; }
ES2FRCINL() Prmflags_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Prmflags_cst::classof(this), "Mismatached node type");
}
};
struct Stmt_id_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().stmt_id_sym; }
ES2FRCINL() Stmt_id_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Stmt_id_cst::classof(this), "Mismatached node type");
}
};
struct True_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().true_sym; }
ES2FRCINL() True_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(True_cst::classof(this), "Mismatached node type");
}
};
struct Type_id_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().type_id_sym; }
ES2FRCINL() Type_id_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Type_id_cst::classof(this), "Mismatached node type");
}
};
struct Var_id_cst : public TlvBase_cst {
static bool classof(TlvBase_cst const* _cst) { return _cst->kind() == TlvSymtbl::get().var_id_sym; }
ES2FRCINL() Var_id_cst(CSTNode_o _nde) : TlvBase_cst(_nde) {
grdvfy1(Var_id_cst::classof(this), "Mismatached node type");
}
};
struct Expr_cst : public TlvSumt_cst<
Assignment_expr_cst,
Binary_expr_cst,
Call_expr_cst,
Cast_expr_cst,
Char_lit_cst,
Compound_literal_expr_cst,
Concat_str_lit_cst,
Conditional_expr_cst,
False_cst,
Field_expr_cst,
Identifier_cst,
Nullptr_cst,
Num_lit_cst,
Parenthesized_expr_cst,
Pointer_expr_cst,
Sizeof_expr_cst,
Str_lit_cst,
Subscript_expr_cst,
True_cst,
Unary_expr_cst,
Update_expr_cst> {
using Base::Base;
};
struct Stmt_cst : public TlvSumt_cst<
Block_stmt_cst,
Break_stmt_cst,
Case_stmt_cst,
Continue_stmt_cst,
Do_stmt_cst,
Expression_stmt_cst,
For_stmt_cst,
Goto_stmt_cst,
If_stmt_cst,
Labeled_stmt_cst,
Return_stmt_cst,
Switch_stmt_cst,
Var_decl_cst,
While_stmt_cst> {
using Base::Base;
};
struct Type_spec_cst : public TlvSumt_cst<
Array_type_spec_cst,
Ptr_type_spec_cst,
Ref_type_spec_cst,
Simple_type_spec_cst,
Type_id_cst> {
using Base::Base;
};
ES2FRCINL() Array_o<Expr_cst> Argument_list_cst::childNodes() const { return namedChldrnAdaptor<Expr_cst>(); }
ES2FRCINL() Array_o<TlvBase_cst> Array_type_spec_cst::childNodes() const { return namedChldrnAdaptor<TlvBase_cst>(); }
ES2FRCINL() TlvBase_cst Assignment_expr_cst::leftNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().left_fld)}; }
ES2FRCINL() Expr_cst Assignment_expr_cst::rightNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().right_fld)}; }
ES2FRCINL() Expr_cst Binary_expr_cst::leftNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().left_fld)}; }
ES2FRCINL() TlvBase_cst Binary_expr_cst::operatorNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().operator_fld)}; }
ES2FRCINL() Expr_cst Binary_expr_cst::rightNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().right_fld)}; }
ES2FRCINL() Array_o<Stmt_cst> Block_stmt_cst::childNodes() const { return namedChldrnAdaptor<Stmt_cst>(); }
ES2FRCINL() Argument_list_cst Call_expr_cst::argumentsNde() const { return Argument_list_cst{CSTNode_o::childByFld(TlvSymtbl::get().arguments_fld)}; }
ES2FRCINL() Expr_cst Call_expr_cst::functionNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().function_fld)}; }
ES2FRCINL() Expr_cst Case_stmt_cst::valueNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().value_fld)}; }
ES2FRCINL() Array_o<TlvBase_cst> Case_stmt_cst::childNodes() const { return namedChldrnAdaptor<TlvBase_cst>(); }
ES2FRCINL() Type_descriptor_cst Cast_expr_cst::typeNde() const { return Type_descriptor_cst{CSTNode_o::childByFld(TlvSymtbl::get().type_fld)}; }
ES2FRCINL() Expr_cst Cast_expr_cst::valueNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().value_fld)}; }
ES2FRCINL() Escape_sequence_cst Char_lit_cst::childNode() const { return CSTNode_o::namedChild(0); }
ES2FRCINL() Expr_cst Comma_expr_cst::leftNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().left_fld)}; }
ES2FRCINL() TlvBase_cst Comma_expr_cst::rightNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().right_fld)}; }
ES2FRCINL() Type_descriptor_cst Compound_literal_expr_cst::typeNde() const { return Type_descriptor_cst{CSTNode_o::childByFld(TlvSymtbl::get().type_fld)}; }
ES2FRCINL() Initializer_list_cst Compound_literal_expr_cst::valueNde() const { return Initializer_list_cst{CSTNode_o::childByFld(TlvSymtbl::get().value_fld)}; }
ES2FRCINL() Array_o<Str_lit_cst> Concat_str_lit_cst::childNodes() const { return namedChldrnAdaptor<Str_lit_cst>(); }
ES2FRCINL() Expr_cst Conditional_expr_cst::alternativeNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().alternative_fld)}; }
ES2FRCINL() Expr_cst Conditional_expr_cst::conditionNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().condition_fld)}; }
ES2FRCINL() Expr_cst Conditional_expr_cst::consequenceNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().consequence_fld)}; }
ES2FRCINL() Stmt_cst Do_stmt_cst::bodyNde() const { return Stmt_cst{CSTNode_o::childByFld(TlvSymtbl::get().body_fld)}; }
ES2FRCINL() Parenthesized_expr_cst Do_stmt_cst::conditionNde() const { return Parenthesized_expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().condition_fld)}; }
ES2FRCINL() TlvBase_cst Expression_stmt_cst::childNode() const { return CSTNode_o::namedChild(0); }
ES2FRCINL() Field_id_cst Field_designator_cst::childNode() const { return CSTNode_o::namedChild(0); }
ES2FRCINL() Expr_cst Field_expr_cst::argumentNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().argument_fld)}; }
ES2FRCINL() Field_id_cst Field_expr_cst::fieldNde() const { return Field_id_cst{CSTNode_o::childByFld(TlvSymtbl::get().field_fld)}; }
ES2FRCINL() Field_id_cst Fld_def_cst::fldnameNde() const { return Field_id_cst{CSTNode_o::childByFld(TlvSymtbl::get().fldname_fld)}; }
ES2FRCINL() Type_spec_cst Fld_def_cst::fldtypeNde() const { return Type_spec_cst{CSTNode_o::childByFld(TlvSymtbl::get().fldtype_fld)}; }
ES2FRCINL() Expr_cst For_stmt_cst::conditionNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().condition_fld)}; }
ES2FRCINL() TlvBase_cst For_stmt_cst::initializerNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().initializer_fld)}; }
ES2FRCINL() TlvBase_cst For_stmt_cst::updateNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().update_fld)}; }
ES2FRCINL() Stmt_cst For_stmt_cst::childNode() const { return CSTNode_o::namedChild(0); }
ES2FRCINL() Stmt_id_cst Goto_stmt_cst::labelNde() const { return Stmt_id_cst{CSTNode_o::childByFld(TlvSymtbl::get().label_fld)}; }
ES2FRCINL() Stmt_cst If_stmt_cst::alternativeNde() const { return Stmt_cst{CSTNode_o::childByFld(TlvSymtbl::get().alternative_fld)}; }
ES2FRCINL() Parenthesized_expr_cst If_stmt_cst::conditionNde() const { return Parenthesized_expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().condition_fld)}; }
ES2FRCINL() Stmt_cst If_stmt_cst::consequenceNde() const { return Stmt_cst{CSTNode_o::childByFld(TlvSymtbl::get().consequence_fld)}; }
ES2FRCINL() Array_o<TlvBase_cst> Initializer_list_cst::childNodes() const { return namedChldrnAdaptor<TlvBase_cst>(); }
ES2FRCINL() Array_o<TlvBase_cst> Initializer_pair_cst::designatorNde() const { return fldChldrnAdaptor<TlvBase_cst>(TlvSymtbl::get().designator_fld); }
ES2FRCINL() TlvBase_cst Initializer_pair_cst::valueNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().value_fld)}; }
ES2FRCINL() Stmt_id_cst Labeled_stmt_cst::labelNde() const { return Stmt_id_cst{CSTNode_o::childByFld(TlvSymtbl::get().label_fld)}; }
ES2FRCINL() Stmt_cst Labeled_stmt_cst::childNode() const { return CSTNode_o::namedChild(0); }
ES2FRCINL() Array_o<TlvBase_cst> Module_cst::childNodes() const { return namedChldrnAdaptor<TlvBase_cst>(); }
ES2FRCINL() Block_stmt_cst Opdef_cst::bodyNde() const { return Block_stmt_cst{CSTNode_o::childByFld(TlvSymtbl::get().body_fld)}; }
ES2FRCINL() Identifier_cst Opdef_cst::evalFnNde() const { return Identifier_cst{CSTNode_o::childByFld(TlvSymtbl::get().evalFn_fld)}; }
ES2FRCINL() Opdef_meta_cst Opdef_cst::opdefmetaNde() const { return Opdef_meta_cst{CSTNode_o::childByFld(TlvSymtbl::get().opdefmeta_fld)}; }
ES2FRCINL() Oprmblk_cst Opdef_cst::oprmblkNde() const { return Oprmblk_cst{CSTNode_o::childByFld(TlvSymtbl::get().oprmblk_fld)}; }
ES2FRCINL() Identifier_cst Opdef_meta_cst::nameNde() const { return Identifier_cst{CSTNode_o::childByFld(TlvSymtbl::get().name_fld)}; }
ES2FRCINL() Import_id_cst Opimport_meta_cst::moduleNde() const { return Import_id_cst{CSTNode_o::childByFld(TlvSymtbl::get().module_fld)}; }
ES2FRCINL() Identifier_cst Oprm_cst::nameNde() const { return Identifier_cst{CSTNode_o::childByFld(TlvSymtbl::get().name_fld)}; }
ES2FRCINL() Oprm_meta_cst Oprm_cst::oprmetaNde() const { return Oprm_meta_cst{CSTNode_o::childByFld(TlvSymtbl::get().oprmeta_fld)}; }
ES2FRCINL() Type_spec_cst Oprm_cst::typeNde() const { return Type_spec_cst{CSTNode_o::childByFld(TlvSymtbl::get().type_fld)}; }
ES2FRCINL() Prmflags_cst Oprm_meta_cst::prmflagsNde() const { return Prmflags_cst{CSTNode_o::childByFld(TlvSymtbl::get().prmflags_fld)}; }
ES2FRCINL() Array_o<Oprm_cst> Oprmblk_cst::childNodes() const { return namedChldrnAdaptor<Oprm_cst>(); }
ES2FRCINL() TlvBase_cst Parenthesized_expr_cst::childNode() const { return CSTNode_o::namedChild(0); }
ES2FRCINL() Expr_cst Pointer_expr_cst::argumentNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().argument_fld)}; }
ES2FRCINL() TlvBase_cst Pointer_expr_cst::operatorNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().operator_fld)}; }
ES2FRCINL() Array_o<TlvBase_cst> Ptr_type_spec_cst::childNodes() const { return namedChldrnAdaptor<TlvBase_cst>(); }
ES2FRCINL() Array_o<TlvBase_cst> Ref_type_spec_cst::childNodes() const { return namedChldrnAdaptor<TlvBase_cst>(); }
ES2FRCINL() TlvBase_cst Return_stmt_cst::childNode() const { return CSTNode_o::namedChild(0); }
ES2FRCINL() Type_descriptor_cst Sizeof_expr_cst::typeNde() const { return Type_descriptor_cst{CSTNode_o::childByFld(TlvSymtbl::get().type_fld)}; }
ES2FRCINL() Expr_cst Sizeof_expr_cst::valueNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().value_fld)}; }
ES2FRCINL() Array_o<Escape_sequence_cst> Str_lit_cst::childNodes() const { return namedChldrnAdaptor<Escape_sequence_cst>(); }
ES2FRCINL() Array_o<Fld_def_cst> Struct_def_cst::flddefNde() const { return fldChldrnAdaptor<Fld_def_cst>(TlvSymtbl::get().flddef_fld); }
ES2FRCINL() Type_id_cst Struct_def_cst::nameNde() const { return Type_id_cst{CSTNode_o::childByFld(TlvSymtbl::get().name_fld)}; }
ES2FRCINL() Expr_cst Subscript_designator_cst::childNode() const { return CSTNode_o::namedChild(0); }
ES2FRCINL() Expr_cst Subscript_expr_cst::argumentNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().argument_fld)}; }
ES2FRCINL() Expr_cst Subscript_expr_cst::indexNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().index_fld)}; }
ES2FRCINL() Block_stmt_cst Switch_stmt_cst::bodyNde() const { return Block_stmt_cst{CSTNode_o::childByFld(TlvSymtbl::get().body_fld)}; }
ES2FRCINL() Parenthesized_expr_cst Switch_stmt_cst::conditionNde() const { return Parenthesized_expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().condition_fld)}; }
ES2FRCINL() Type_spec_cst Type_descriptor_cst::typeNde() const { return Type_spec_cst{CSTNode_o::childByFld(TlvSymtbl::get().type_fld)}; }
ES2FRCINL() Array_o<Type_qualifier_cst> Type_descriptor_cst::childNodes() const { return namedChldrnAdaptor<Type_qualifier_cst>(); }
ES2FRCINL() Expr_cst Unary_expr_cst::argumentNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().argument_fld)}; }
ES2FRCINL() TlvBase_cst Unary_expr_cst::operatorNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().operator_fld)}; }
ES2FRCINL() Expr_cst Update_expr_cst::argumentNde() const { return Expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().argument_fld)}; }
ES2FRCINL() TlvBase_cst Update_expr_cst::operatorNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().operator_fld)}; }
ES2FRCINL() Type_spec_cst Var_decl_cst::typeNde() const { return Type_spec_cst{CSTNode_o::childByFld(TlvSymtbl::get().type_fld)}; }
ES2FRCINL() Array_o<TlvBase_cst> Var_decl_cst::vardeclNde() const { return fldChldrnAdaptor<TlvBase_cst>(TlvSymtbl::get().vardecl_fld); }
ES2FRCINL() Array_o<Type_qualifier_cst> Var_decl_cst::childNodes() const { return namedChldrnAdaptor<Type_qualifier_cst>(); }
ES2FRCINL() TlvBase_cst Varinit_decl_cst::valueNde() const { return TlvBase_cst{CSTNode_o::childByFld(TlvSymtbl::get().value_fld)}; }
ES2FRCINL() Var_id_cst Varinit_decl_cst::vardeclNde() const { return Var_id_cst{CSTNode_o::childByFld(TlvSymtbl::get().vardecl_fld)}; }
ES2FRCINL() Stmt_cst While_stmt_cst::bodyNde() const { return Stmt_cst{CSTNode_o::childByFld(TlvSymtbl::get().body_fld)}; }
ES2FRCINL() Parenthesized_expr_cst While_stmt_cst::conditionNde() const { return Parenthesized_expr_cst{CSTNode_o::childByFld(TlvSymtbl::get().condition_fld)}; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment