36 class defNestedFuncExpr;
127 class _nout parser:
public tworker<str, pod>,
public tokenScanable {
128 typedef tworker<str, pod> __super5;
129 BY(CLASS(parser, __super5))
130 friend class coreInternal;
142 const node* getSubPod() const BY_CONST_FUNC(getSubPod())
144 srcSupplies& getSrcSupplies();
145 const srcSupplies& getSrcSupplies() const BY_CONST_FUNC(getSrcSupplies())
146 me& addSupply(const srcSupply& new1);
147 me& addSupply(const tucontainable<srcSupply>& new1);
150 tokenDispatcher& getDispatcher();
151 std::vector<ncnt>& getIndents();
153 nbool isInit() const;
160 template <typename T>
void setScan() {
161 BY_DI(
"change scanmode(%s -> %s)", _mode ? _mode->getType().getName() :
"null", T::instance);
162 _mode = &T::instance;
172 int pushState(
int newState);
181 using tokenScanable::onScan;
191 nint onScan(parser& ps, YYSTYPE* val, YYLTYPE* loc, yyscan_t scanner, nbool& isBypass)
override;
196 nint onTokenEndOfFile();
202 nint onTokenColon(nint tok);
208 nint onTokenNewLine(nint tok);
214 nint onTokenLParan(nint tok);
220 nint onTokenRParan(nint tok);
226 nint onTokenComma(nint tok);
231 nbool onTokenEndOfBraces();
236 void onTokenStartOfStrTemplateBrace();
244 void onTokenBeginStr(nchar token);
249 nchar getOpenStrToken();
256 nint onIndent(ncnt col, nint tok);
263 nint onDedent(ncnt col, nint tok);
269 nint onIgnoreIndent(nint tok);
275 nchar onScanUnexpected(
const nchar* token);
280 void onSrcArea(
const area& area);
285 node* onGet(
const std::string& name);
286 node* onGet(
const std::string& name,
const narr& args);
287 node* onGet(node& from,
const std::string& name);
288 node* onGet(node& from, node& it);
289 node* onGet(
const std::string& name,
const std::string& name2);
290 node* onCallAccess(node& it,
const narr& args);
293 FBOExpr* onUnaryMinus(
const node& it);
294 FBOExpr* onUnaryNot(
const node& it);
295 FUOExpr* onUnaryBitwiseNot(
const node& it);
296 node* onUnaryDoublePlus(node& it);
297 node* onUnaryDoubleMinus(node& it);
298 FUOExpr* onUnaryPostfixDoublePlus(
const node& it);
299 FUOExpr* onUnaryPostfixDoubleMinus(
const node& it);
302 FBOExpr* onAdd(
const node& lhs,
const node& rhs);
303 FBOExpr* onSub(
const node& lhs,
const node& rhs);
304 FBOExpr* onMul(
const node& lhs,
const node& rhs);
305 FBOExpr* onDiv(
const node& lhs,
const node& rhs);
306 FBOExpr* onMod(
const node& lhs,
const node& rhs);
308 FBOExpr* onBitwiseAnd(
const node& lhs,
const node& rhs);
309 FBOExpr* onBitwiseXor(
const node& lhs,
const node& rhs);
310 FBOExpr* onBitwiseOr(
const node& lhs,
const node& rhs);
311 FBOExpr* onLShift(
const node& lhs,
const node& rhs);
312 FBOExpr* onRShift(
const node& lhs,
const node& rhs);
314 node* onAssign(node& lhs, node& rhs);
315 node* onAddAssign(node& lhs, node& rhs);
316 node* onSubAssign(node& lhs, node& rhs);
317 node* onMulAssign(node& lhs, node& rhs);
318 node* onDivAssign(node& lhs, node& rhs);
319 node* onModAssign(node& lhs, node& rhs);
321 FBOExpr* onGt(
const node& lhs,
const node& rhs);
322 FBOExpr* onGe(
const node& lhs,
const node& rhs);
323 FBOExpr* onLt(
const node& lhs,
const node& rhs);
324 FBOExpr* onLe(
const node& lhs,
const node& rhs);
325 FBOExpr* onEq(
const node& lhs,
const node& rhs);
326 FBOExpr* onNe(
const node& lhs,
const node& rhs);
327 FBOExpr* onAnd(
const node& lhs,
const node& rhs);
328 FBOExpr* onOr(
const node& lhs,
const node& rhs);
331 node* onGetGeneric(
const std::string& orgName,
const args& typeParams);
332 node* onGetElem(
const node& arr,
const node& idx);
334 node* onGetArray(node& elemType);
337 obj* onPod(
const node& path);
338 obj* onPod(
const std::string& path);
340 obj* onSubPod(obj& subpod);
341 endExpr* onEnd(
const blockExpr& blk);
342 blockExpr* onBlock(
const node* stmt);
343 blockExpr* onBlock(blockExpr* blk,
const node* stmt);
344 blockExpr* onBlock();
345 defBlock* onDefBlock(node* stmt);
346 defBlock* onDefBlock(defBlock* blk, node* stmt);
347 defBlock* onDefBlock();
348 node* onFor(
const std::string& iterName,
const node& expr,
const blockExpr& blk);
349 node* onWhile(
const node& condition,
const blockExpr& blk);
354 node* onParanthesisAsTuple(narr& tuple);
356 args* onTuple(
const node& elem);
357 args* onTuple(args& as,
const node& elem);
358 args* onFuncCallTuple();
359 args* onFuncCallTuple(
const node& elem);
360 args* onFuncCallTuple(args& as,
const node& elem);
362 args* onTypeNames(
const node& param);
363 args* onTypeNames(args& params,
const node& param);
366 template <
typename T,
typename Arg> T* onPrimitive(
const Arg& arg) {
367 BY_DI(
"on%s(...)", ttype<T>::get());
371 template <
typename T> T* onPrimitive() {
372 BY_DI(
"on%s()", ttype<T>::get());
376 node* onDefProp(
const modifier& mod,
const std::string& name,
const node& rhs);
377 node* onDefProp(
const std::string& name,
const node& rhs);
378 node* onDefProp(
const node& rhs);
379 node* onDefProp(
const modifier& mod,
const node& rhs);
380 node* onDefAssign(
const modifier& mod,
const std::string& name,
const node* rhs);
381 node* onDefAssign(
const defPropExpr* prop,
const node* rhs);
382 node* onDefAssign(
const std::string& name,
const node* rhs);
384 obj* onDefOrigin(
const std::string& name, defBlock& blk);
385 obj* onDefOrigin(
const std::string& name,
const narr& args, defBlock& blk);
386 genericOrigin* onDefObjGeneric(
const std::string& name,
const args& typeParams, defBlock& blk);
387 genericOrigin* onDefObjGeneric(
const std::string& name,
const args& typeParams,
const narr& args,
390 node* onDefArray(
const narr& items);
391 node* onDefSeq(
const node& start,
const node& end);
393 void onCompilationUnit(obj* subpod);
394 void onCompilationUnit(obj* subpod, defBlock* blk);
396 func* onFuncSignature(
const modifier& mod,
const getExpr& access,
const node* retType);
397 func* onFuncSignature(
const getExpr& access,
const node* retType);
398 func* onFuncSignature(
const modifier& mod, node& it,
const node* retType);
399 func* onFuncSignature(node& it,
const node* retType);
400 func* onAbstractFunc(func& f);
401 node* onFunc(func& func,
const blockExpr& blk);
402 defNestedFuncExpr* onLambda(
const narr& params,
const node& retType,
const blockExpr& blk);
403 ctor* onCtor(
const modifier& mod,
const narr& args,
const blockExpr& blk);
404 ctor* onCtor(
const narr& args,
const blockExpr& blk);
405 ctor* onCtor(
const modifier& mod,
const blockExpr& blk);
406 ctor* onCtor(
const blockExpr& blk);
409 narr* onParams(
const defPropExpr* elem);
410 narr* onParams(narr& it,
const defPropExpr* elem);
412 modifier* onModifier(nbool isPublic, nbool isOverriden);
415 node* onDeclStmt(
const narr& dotnames) {
422 retExpr* onRet(node& exp);
423 breakExpr* onBreak();
426 evalExpr* onFillFromOfFuncCall(
const node& me, evalExpr& to);
427 evalExpr* onEvalExpr(node& type,
const narr& a);
428 evalExpr* onEvalExpr(node& type,
const args& a);
430 isExpr* onIs(
const node& me,
const node& to);
431 asExpr* onAs(
const node& me,
const node& as);
433 ifExpr* onIf(
const node& condition,
const blockExpr& then);
434 ifExpr* onIf(
const node& condition,
const blockExpr& then,
const blockExpr& elseBlk);
435 ifExpr* onIf(
const node& condition,
const blockExpr& then,
const ifExpr& elseIf);
437 evalExpr* onIn(
const node& it,
const node& container);
450 void onParseErr(
const std::string& msg,
const nchar* symbolName);
453 void* _scanString(
const std::string& src,
void* scanner);
455 void _prepare()
override;
456 void _onEndWork()
override;
463 str _onWork()
override;
467 nint _onTokenEndOfInlineBlock(nint
tok);
479 std::vector<std::string> _extractParamTypeNames(
const args& types);
480 std::string _joinVectorString(
const std::vector<std::string>&
container)
const;
482 std::vector<std::string> _toDotnames(
const node& path);
488 nbool _isIgnoreWhitespace;
490 std::vector<ncnt> _indents;
493 std::vector<nint> _states;
497 std::vector<func*> _funcs;
498 ncnt _strTemplateCnt;
Function or object evaluation arguments.
Definition args.hpp:22
Base class for error hierarchy.
Definition baseErr.hpp:48
Definition block for organizing object definitions.
Definition defBlock.hpp:16
Function/method call expression.
Definition evalExpr.hpp:15
Factory for creating expressions with source location information.
Definition exprMaker.hpp:18
Access modifier for type members.
Definition modifier.hpp:13
Base class for all AST nodes in the byeol language.
Definition node.hpp:195
Byeol runtime environment object.
Definition obj.hpp:62
Function parameter list container.
Definition params.hpp:16
Smart indentation management for code parsing.
Definition smartDedent.hpp:23
Token queue management for parser.
Definition tokenDispatcher.hpp:49
Base class for token scanning strategies.
Definition tokenScan.hpp:29
Core class for runtime type information in byeol language.
Definition type.hpp:100
Rich logging support with polymorphic type conversion.
Definition richLog.hpp:34