User Guide
ast.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2023 Blue Brain Project, EPFL.
3  * See the top-level LICENSE file for details.
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 ///
9 /// THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
10 ///
11 
12 #pragma once
13 
14 /**
15  * \dir
16  * \brief Auto generated AST Implementations
17  *
18  * \file
19  * \brief Auto generated AST classes declaration
20  */
21 
22 #include <string>
23 #include <vector>
24 #include <unordered_set>
25 
26 #include "ast/ast_decl.hpp"
27 #include "ast/ast_common.hpp"
28 #include "lexer/modtoken.hpp"
29 #include "utils/common_utils.hpp"
30 #include "visitors/visitor.hpp"
31 
32 namespace nmodl::ast {
33 
34 /**
35  * \page ast_design Design of Abstract Syntax Tree (AST)
36  *
37  * This page describes the AST design aspects.
38  *
39  * \tableofcontents
40  *
41  * \section sec_1 AST Class Hierarchy
42  * This section describes the AST design
43  *
44  * \section sec_2 Block Scoped Nodes
45  * This section describes block scoped nodes.
46  *
47  * \section sec_3 Symbol Table Nodes
48  * This section describes nodes with symbol table.
49  */
50 
51 /**
52  * \defgroup ast_class AST Classes
53  * \ingroup ast
54  * \brief Classes for implementing Abstract Syntax Tree (AST)
55  * \{
56  */
57 
58 /**
59  * \brief Base class for all Abstract Syntax Tree node types
60  *
61  * Every node in the Abstract Syntax Tree is inherited from base class
62  * ast::Ast. This class provides base properties and pure virtual
63  * functions that must be implemented by base classes. We inherit from
64  * std::enable_shared_from_this to get a `shared_ptr` from `this` pointer.
65  *
66  * \todo With the ast::Node as another top level node, this can be removed
67  * in the future.
68  */
69 struct Ast: public std::enable_shared_from_this<Ast> {
70  private:
71  /**
72  * \brief Generic pointer to the parent
73  *
74  * Children types can be known at compile time. Conversely, many parents
75  * can have the same children type. Thus, this is just a pointer to
76  * the base class. The pointer to the parent cannot have ownership
77  * (circular ownership problem). weak_ptr you say? Yes, however weak_ptr
78  * can be instantiated from shared_ptr (not this). Whys is this a problem?
79  * In bison things must be passed around as raw pointers (because it uses
80  * unions etc.) and there are cases where the shared_ptr to the parent
81  * was not yet created while the child is added (throwing a bad_weak_ptr
82  * exception).
83  *
84  * i.e. in bison the lines:
85  *
86  * ast::WatchStatement* a = new ast::WatchStatement();
87  * yylhs.value.as< ast::WatchStatement* > ()->add_watch(a);
88  *
89  * would throw a bad_weak_ptr exception because when you call add_watch
90  * the shared_ptr_from_this to "a" is not yet created.
91  */
92  Ast* parent = nullptr;
93 
94  public:
95 
96  /// \name Ctor & dtor
97  /// \{
98 
99  Ast() = default;
100 
101  virtual ~Ast() = default;
102 
103  /// \}
104 
105 
106  /// \name Pure Virtual Functions
107  /// \{
108 
109  /**
110  * \brief Return type (ast::AstNodeType) of AST node
111  *
112  * Every node in the ast has a type defined in ast::AstNodeType.
113  * This type is can be used to check/compare node types.
114  */
115  virtual AstNodeType get_node_type() const = 0;
116 
117  /**
118  * \brief Return type (ast::AstNodeType) of ast node as std::string
119  *
120  * Every node in the ast has a type defined in ast::AstNodeType.
121  * This type name can be returned as a std::string for printing
122  * ast to text/json form.
123  *
124  * \return name of the node type as a string
125  *
126  * \sa Ast::get_node_name
127  */
128  virtual std::string get_node_type_name() const = 0;
129 
130  /**
131  * \brief Return NMODL statement of ast node as std::string
132  *
133  * Every node is related to a special statement in the NMODL. This
134  * statement can be returned as a std::string for printing to
135  * text/json form.
136  *
137  * \return name of the statement as a string
138  *
139  * \sa Ast::get_nmodl_name
140  */
141  virtual std::string get_nmodl_name() const {
142  throw std::runtime_error("get_nmodl_name not implemented");
143  }
144 
145  /**
146  * \brief Accept (or visit) the AST node using current visitor
147  *
148  * Instead of visiting children of AST node, like Ast::visit_children,
149  * accept allows to visit the current node itself using the concrete
150  * visitor provided.
151  *
152  * \param v Concrete visitor that will be used to recursively visit children
153  *
154  * \note Below is an example of `accept` method implementation which shows how
155  * visitor method corresponding to ast::IndexedName node is called allowing
156  * to visit the node itself in the visitor.
157  *
158  * \code{.cpp}
159  * void IndexedName::accept(visitor::Visitor& v) override {
160  * v.visit_indexed_name(this);
161  * }
162  * \endcode
163  *
164  */
165  virtual void accept(visitor::Visitor& v) = 0;
166 
167  /**
168  * \brief Accept (or visit) the AST node using a given visitor
169  * \param v constant visitor visiting the AST node
170  * \ref accept(visitor::Visitor&);
171  */
172  virtual void accept(visitor::ConstVisitor& v) const = 0;
173 
174  /**
175  * \brief Visit children i.e. member of AST node using provided visitor
176  *
177  * Different nodes in the AST have different members (i.e. children). This method
178  * recursively visits children using provided concrete visitor.
179  *
180  * \param v Concrete visitor that will be used to recursively visit node
181  *
182  * \note Below is an example of `visit_children` method implementation which shows
183  * ast::IndexedName node children are visited instead of node itself.
184  *
185  * \code{.cpp}
186  * void IndexedName::visit_children(visitor::Visitor& v) {
187  * name->accept(v);
188  * length->accept(v);
189  * }
190  * \endcode
191  */
192  virtual void visit_children(visitor::Visitor& v) = 0;
193 
194  /**
195  * \copydoc visit_children(visitor::Visitor& v)
196  */
197  virtual void visit_children(visitor::ConstVisitor& v) const = 0;
198 
199  /**
200  * \brief Create a copy of the current node
201  *
202  * Recursively make a new copy/clone of the current node including
203  * all members and return a pointer to the node. This is used for
204  * passes like nmodl::visitor::InlineVisitor where nodes are cloned in the
205  * ast.
206  *
207  * \return pointer to the clone/copy of the current node
208  */
209  virtual Ast* clone() const;
210 
211  /// \}
212 
213  /// \name Not implemented
214  /// \{
215 
216  /**
217  * \brief Return name of of the node
218  *
219  * Some ast nodes have a member marked designated as node name. For example,
220  * in case of ast::FunctionCall, name of the function is returned as a node
221  * name. Note that this is different from ast node type name and not every
222  * ast node has name.
223  *
224  * \return name of the node as std::string
225  *
226  * \sa Ast::get_node_type_name
227  */
228  virtual std::string get_node_name() const;
229 
230  /**
231  * \brief Return associated token for the AST node
232  *
233  * Not all ast nodes have token information. For example, nmodl::visitor::NeuronSolveVisitor
234  * can insert new nodes in the ast as a solution of ODEs. In this case, we return
235  * nullptr to store in the nmodl::symtab::SymbolTable.
236  *
237  * \return pointer to token if exist otherwise nullptr
238  */
239  virtual const ModToken* get_token() const;
240 
241  /**
242  * \brief Return associated symbol table for the AST node
243  *
244  * Certain ast nodes (e.g. inherited from ast::Block) have associated
245  * symbol table. These nodes have nmodl::symtab::SymbolTable as member
246  * and it can be accessed using this method.
247  *
248  * \return pointer to the symbol table
249  *
250  * \sa nmodl::symtab::SymbolTable nmodl::visitor::SymtabVisitor
251  */
252  virtual symtab::SymbolTable* get_symbol_table() const;
253 
254  /**
255  * \brief Return associated statement block for the AST node
256  *
257  * Top level block nodes encloses all statements in the ast::StatementBlock.
258  * For example, ast::BreakpointBlock has all statements in curly brace (`{ }`)
259  * stored in ast::StatementBlock :
260  *
261  * \code
262  * BREAKPOINT {
263  * SOLVE states METHOD cnexp
264  * gNaTs2_t = gNaTs2_tbar*m*m*m*h
265  * ina = gNaTs2_t*(v-ena)
266  * }
267  * \endcode
268  *
269  * This method return enclosing statement block.
270  *
271  * \return pointer to the statement block if exist
272  *
273  * \sa ast::StatementBlock
274  */
275  virtual std::shared_ptr<StatementBlock> get_statement_block() const;
276 
277  /**
278  * \brief Set symbol table for the AST node
279  *
280  * Top level, block scoped nodes store symbol table in the ast node.
281  * nmodl::visitor::SymtabVisitor then used this method to setup symbol table
282  * for every node in the ast.
283  *
284  * \sa nmodl::visitor::SymtabVisitor
285  */
286  virtual void set_symbol_table(symtab::SymbolTable* symtab);
287 
288  /**
289  * \brief Set name for the AST node
290  *
291  * Some ast nodes have a member marked designated as node name (e.g. nodes
292  * derived from ast::Identifier). This method is used to set new name for those
293  * nodes. This useful for passes like nmodl::visitor::RenameVisitor.
294  *
295  * \sa Ast::get_node_type_name Ast::get_node_name
296  */
297  virtual void set_name(const std::string& name);
298 
299  /**
300  * \brief Negate the value of AST node
301  *
302  * Parser parse `-x` in two parts : `x` and then `-`. Once second token
303  * `-` is encountered, the corresponding value of ast node needs to be
304  * multiplied by `-1` for ast::Number node types or apply `!` operator
305  for the nodes of type ast::Boolean.
306  */
307  virtual void negate();
308  /// \}
309 
310  /// get std::shared_ptr from `this` pointer of the AST node
311  virtual std::shared_ptr<Ast> get_shared_ptr();
312 
313  /// get std::shared_ptr from `this` pointer of the AST node
314  virtual std::shared_ptr<const Ast> get_shared_ptr() const;
315 
316  /**
317  *\brief Check if the ast node is an instance of ast::Ast
318  * \return true if object of type ast::Ast
319  */
320  virtual bool is_ast() const noexcept;
321 
322  /**
323  * \brief Check if the ast node is an instance of ast::Node
324  * \return true if object of type ast::OntologyStatement
325  */
326  virtual bool is_node () const noexcept;
327 
328  /**
329  * \brief Check if the ast node is an instance of ast::Statement
330  * \return true if object of type ast::OntologyStatement
331  */
332  virtual bool is_statement () const noexcept;
333 
334  /**
335  * \brief Check if the ast node is an instance of ast::Expression
336  * \return true if object of type ast::OntologyStatement
337  */
338  virtual bool is_expression () const noexcept;
339 
340  /**
341  * \brief Check if the ast node is an instance of ast::Block
342  * \return true if object of type ast::OntologyStatement
343  */
344  virtual bool is_block () const noexcept;
345 
346  /**
347  * \brief Check if the ast node is an instance of ast::Identifier
348  * \return true if object of type ast::OntologyStatement
349  */
350  virtual bool is_identifier () const noexcept;
351 
352  /**
353  * \brief Check if the ast node is an instance of ast::Number
354  * \return true if object of type ast::OntologyStatement
355  */
356  virtual bool is_number () const noexcept;
357 
358  /**
359  * \brief Check if the ast node is an instance of ast::String
360  * \return true if object of type ast::OntologyStatement
361  */
362  virtual bool is_string () const noexcept;
363 
364  /**
365  * \brief Check if the ast node is an instance of ast::Integer
366  * \return true if object of type ast::OntologyStatement
367  */
368  virtual bool is_integer () const noexcept;
369 
370  /**
371  * \brief Check if the ast node is an instance of ast::Float
372  * \return true if object of type ast::OntologyStatement
373  */
374  virtual bool is_float () const noexcept;
375 
376  /**
377  * \brief Check if the ast node is an instance of ast::Double
378  * \return true if object of type ast::OntologyStatement
379  */
380  virtual bool is_double () const noexcept;
381 
382  /**
383  * \brief Check if the ast node is an instance of ast::Boolean
384  * \return true if object of type ast::OntologyStatement
385  */
386  virtual bool is_boolean () const noexcept;
387 
388  /**
389  * \brief Check if the ast node is an instance of ast::Name
390  * \return true if object of type ast::OntologyStatement
391  */
392  virtual bool is_name () const noexcept;
393 
394  /**
395  * \brief Check if the ast node is an instance of ast::PrimeName
396  * \return true if object of type ast::OntologyStatement
397  */
398  virtual bool is_prime_name () const noexcept;
399 
400  /**
401  * \brief Check if the ast node is an instance of ast::IndexedName
402  * \return true if object of type ast::OntologyStatement
403  */
404  virtual bool is_indexed_name () const noexcept;
405 
406  /**
407  * \brief Check if the ast node is an instance of ast::VarName
408  * \return true if object of type ast::OntologyStatement
409  */
410  virtual bool is_var_name () const noexcept;
411 
412  /**
413  * \brief Check if the ast node is an instance of ast::Argument
414  * \return true if object of type ast::OntologyStatement
415  */
416  virtual bool is_argument () const noexcept;
417 
418  /**
419  * \brief Check if the ast node is an instance of ast::ReactVarName
420  * \return true if object of type ast::OntologyStatement
421  */
422  virtual bool is_react_var_name () const noexcept;
423 
424  /**
425  * \brief Check if the ast node is an instance of ast::ReadIonVar
426  * \return true if object of type ast::OntologyStatement
427  */
428  virtual bool is_read_ion_var () const noexcept;
429 
430  /**
431  * \brief Check if the ast node is an instance of ast::WriteIonVar
432  * \return true if object of type ast::OntologyStatement
433  */
434  virtual bool is_write_ion_var () const noexcept;
435 
436  /**
437  * \brief Check if the ast node is an instance of ast::NonspecificCurVar
438  * \return true if object of type ast::OntologyStatement
439  */
440  virtual bool is_nonspecific_cur_var () const noexcept;
441 
442  /**
443  * \brief Check if the ast node is an instance of ast::ElectrodeCurVar
444  * \return true if object of type ast::OntologyStatement
445  */
446  virtual bool is_electrode_cur_var () const noexcept;
447 
448  /**
449  * \brief Check if the ast node is an instance of ast::RangeVar
450  * \return true if object of type ast::OntologyStatement
451  */
452  virtual bool is_range_var () const noexcept;
453 
454  /**
455  * \brief Check if the ast node is an instance of ast::GlobalVar
456  * \return true if object of type ast::OntologyStatement
457  */
458  virtual bool is_global_var () const noexcept;
459 
460  /**
461  * \brief Check if the ast node is an instance of ast::PointerVar
462  * \return true if object of type ast::OntologyStatement
463  */
464  virtual bool is_pointer_var () const noexcept;
465 
466  /**
467  * \brief Check if the ast node is an instance of ast::RandomVar
468  * \return true if object of type ast::OntologyStatement
469  */
470  virtual bool is_random_var () const noexcept;
471 
472  /**
473  * \brief Check if the ast node is an instance of ast::BbcorePointerVar
474  * \return true if object of type ast::OntologyStatement
475  */
476  virtual bool is_bbcore_pointer_var () const noexcept;
477 
478  /**
479  * \brief Check if the ast node is an instance of ast::ExternVar
480  * \return true if object of type ast::OntologyStatement
481  */
482  virtual bool is_extern_var () const noexcept;
483 
484  /**
485  * \brief Check if the ast node is an instance of ast::ParamBlock
486  * \return true if object of type ast::OntologyStatement
487  */
488  virtual bool is_param_block () const noexcept;
489 
490  /**
491  * \brief Check if the ast node is an instance of ast::IndependentBlock
492  * \return true if object of type ast::OntologyStatement
493  */
494  virtual bool is_independent_block () const noexcept;
495 
496  /**
497  * \brief Check if the ast node is an instance of ast::AssignedBlock
498  * \return true if object of type ast::OntologyStatement
499  */
500  virtual bool is_assigned_block () const noexcept;
501 
502  /**
503  * \brief Check if the ast node is an instance of ast::StateBlock
504  * \return true if object of type ast::OntologyStatement
505  */
506  virtual bool is_state_block () const noexcept;
507 
508  /**
509  * \brief Check if the ast node is an instance of ast::InitialBlock
510  * \return true if object of type ast::OntologyStatement
511  */
512  virtual bool is_initial_block () const noexcept;
513 
514  /**
515  * \brief Check if the ast node is an instance of ast::ConstructorBlock
516  * \return true if object of type ast::OntologyStatement
517  */
518  virtual bool is_constructor_block () const noexcept;
519 
520  /**
521  * \brief Check if the ast node is an instance of ast::DestructorBlock
522  * \return true if object of type ast::OntologyStatement
523  */
524  virtual bool is_destructor_block () const noexcept;
525 
526  /**
527  * \brief Check if the ast node is an instance of ast::StatementBlock
528  * \return true if object of type ast::OntologyStatement
529  */
530  virtual bool is_statement_block () const noexcept;
531 
532  /**
533  * \brief Check if the ast node is an instance of ast::DerivativeBlock
534  * \return true if object of type ast::OntologyStatement
535  */
536  virtual bool is_derivative_block () const noexcept;
537 
538  /**
539  * \brief Check if the ast node is an instance of ast::LinearBlock
540  * \return true if object of type ast::OntologyStatement
541  */
542  virtual bool is_linear_block () const noexcept;
543 
544  /**
545  * \brief Check if the ast node is an instance of ast::NonLinearBlock
546  * \return true if object of type ast::OntologyStatement
547  */
548  virtual bool is_non_linear_block () const noexcept;
549 
550  /**
551  * \brief Check if the ast node is an instance of ast::DiscreteBlock
552  * \return true if object of type ast::OntologyStatement
553  */
554  virtual bool is_discrete_block () const noexcept;
555 
556  /**
557  * \brief Check if the ast node is an instance of ast::FunctionTableBlock
558  * \return true if object of type ast::OntologyStatement
559  */
560  virtual bool is_function_table_block () const noexcept;
561 
562  /**
563  * \brief Check if the ast node is an instance of ast::FunctionBlock
564  * \return true if object of type ast::OntologyStatement
565  */
566  virtual bool is_function_block () const noexcept;
567 
568  /**
569  * \brief Check if the ast node is an instance of ast::ProcedureBlock
570  * \return true if object of type ast::OntologyStatement
571  */
572  virtual bool is_procedure_block () const noexcept;
573 
574  /**
575  * \brief Check if the ast node is an instance of ast::NetReceiveBlock
576  * \return true if object of type ast::OntologyStatement
577  */
578  virtual bool is_net_receive_block () const noexcept;
579 
580  /**
581  * \brief Check if the ast node is an instance of ast::SolveBlock
582  * \return true if object of type ast::OntologyStatement
583  */
584  virtual bool is_solve_block () const noexcept;
585 
586  /**
587  * \brief Check if the ast node is an instance of ast::BreakpointBlock
588  * \return true if object of type ast::OntologyStatement
589  */
590  virtual bool is_breakpoint_block () const noexcept;
591 
592  /**
593  * \brief Check if the ast node is an instance of ast::BeforeBlock
594  * \return true if object of type ast::OntologyStatement
595  */
596  virtual bool is_before_block () const noexcept;
597 
598  /**
599  * \brief Check if the ast node is an instance of ast::AfterBlock
600  * \return true if object of type ast::OntologyStatement
601  */
602  virtual bool is_after_block () const noexcept;
603 
604  /**
605  * \brief Check if the ast node is an instance of ast::BABlock
606  * \return true if object of type ast::OntologyStatement
607  */
608  virtual bool is_ba_block () const noexcept;
609 
610  /**
611  * \brief Check if the ast node is an instance of ast::ForNetcon
612  * \return true if object of type ast::OntologyStatement
613  */
614  virtual bool is_for_netcon () const noexcept;
615 
616  /**
617  * \brief Check if the ast node is an instance of ast::KineticBlock
618  * \return true if object of type ast::OntologyStatement
619  */
620  virtual bool is_kinetic_block () const noexcept;
621 
622  /**
623  * \brief Check if the ast node is an instance of ast::UnitBlock
624  * \return true if object of type ast::OntologyStatement
625  */
626  virtual bool is_unit_block () const noexcept;
627 
628  /**
629  * \brief Check if the ast node is an instance of ast::ConstantBlock
630  * \return true if object of type ast::OntologyStatement
631  */
632  virtual bool is_constant_block () const noexcept;
633 
634  /**
635  * \brief Check if the ast node is an instance of ast::NeuronBlock
636  * \return true if object of type ast::OntologyStatement
637  */
638  virtual bool is_neuron_block () const noexcept;
639 
640  /**
641  * \brief Check if the ast node is an instance of ast::Unit
642  * \return true if object of type ast::OntologyStatement
643  */
644  virtual bool is_unit () const noexcept;
645 
646  /**
647  * \brief Check if the ast node is an instance of ast::DoubleUnit
648  * \return true if object of type ast::OntologyStatement
649  */
650  virtual bool is_double_unit () const noexcept;
651 
652  /**
653  * \brief Check if the ast node is an instance of ast::LocalVar
654  * \return true if object of type ast::OntologyStatement
655  */
656  virtual bool is_local_var () const noexcept;
657 
658  /**
659  * \brief Check if the ast node is an instance of ast::Limits
660  * \return true if object of type ast::OntologyStatement
661  */
662  virtual bool is_limits () const noexcept;
663 
664  /**
665  * \brief Check if the ast node is an instance of ast::NumberRange
666  * \return true if object of type ast::OntologyStatement
667  */
668  virtual bool is_number_range () const noexcept;
669 
670  /**
671  * \brief Check if the ast node is an instance of ast::ConstantVar
672  * \return true if object of type ast::OntologyStatement
673  */
674  virtual bool is_constant_var () const noexcept;
675 
676  /**
677  * \brief Check if the ast node is an instance of ast::BinaryOperator
678  * \return true if object of type ast::OntologyStatement
679  */
680  virtual bool is_binary_operator () const noexcept;
681 
682  /**
683  * \brief Check if the ast node is an instance of ast::UnaryOperator
684  * \return true if object of type ast::OntologyStatement
685  */
686  virtual bool is_unary_operator () const noexcept;
687 
688  /**
689  * \brief Check if the ast node is an instance of ast::ReactionOperator
690  * \return true if object of type ast::OntologyStatement
691  */
692  virtual bool is_reaction_operator () const noexcept;
693 
694  /**
695  * \brief Check if the ast node is an instance of ast::ParenExpression
696  * \return true if object of type ast::OntologyStatement
697  */
698  virtual bool is_paren_expression () const noexcept;
699 
700  /**
701  * \brief Check if the ast node is an instance of ast::BinaryExpression
702  * \return true if object of type ast::OntologyStatement
703  */
704  virtual bool is_binary_expression () const noexcept;
705 
706  /**
707  * \brief Check if the ast node is an instance of ast::DiffEqExpression
708  * \return true if object of type ast::OntologyStatement
709  */
710  virtual bool is_diff_eq_expression () const noexcept;
711 
712  /**
713  * \brief Check if the ast node is an instance of ast::UnaryExpression
714  * \return true if object of type ast::OntologyStatement
715  */
716  virtual bool is_unary_expression () const noexcept;
717 
718  /**
719  * \brief Check if the ast node is an instance of ast::NonLinEquation
720  * \return true if object of type ast::OntologyStatement
721  */
722  virtual bool is_non_lin_equation () const noexcept;
723 
724  /**
725  * \brief Check if the ast node is an instance of ast::LinEquation
726  * \return true if object of type ast::OntologyStatement
727  */
728  virtual bool is_lin_equation () const noexcept;
729 
730  /**
731  * \brief Check if the ast node is an instance of ast::FunctionCall
732  * \return true if object of type ast::OntologyStatement
733  */
734  virtual bool is_function_call () const noexcept;
735 
736  /**
737  * \brief Check if the ast node is an instance of ast::Watch
738  * \return true if object of type ast::OntologyStatement
739  */
740  virtual bool is_watch () const noexcept;
741 
742  /**
743  * \brief Check if the ast node is an instance of ast::BABlockType
744  * \return true if object of type ast::OntologyStatement
745  */
746  virtual bool is_ba_block_type () const noexcept;
747 
748  /**
749  * \brief Check if the ast node is an instance of ast::UnitDef
750  * \return true if object of type ast::OntologyStatement
751  */
752  virtual bool is_unit_def () const noexcept;
753 
754  /**
755  * \brief Check if the ast node is an instance of ast::FactorDef
756  * \return true if object of type ast::OntologyStatement
757  */
758  virtual bool is_factor_def () const noexcept;
759 
760  /**
761  * \brief Check if the ast node is an instance of ast::Valence
762  * \return true if object of type ast::OntologyStatement
763  */
764  virtual bool is_valence () const noexcept;
765 
766  /**
767  * \brief Check if the ast node is an instance of ast::UnitState
768  * \return true if object of type ast::OntologyStatement
769  */
770  virtual bool is_unit_state () const noexcept;
771 
772  /**
773  * \brief Check if the ast node is an instance of ast::LocalListStatement
774  * \return true if object of type ast::OntologyStatement
775  */
776  virtual bool is_local_list_statement () const noexcept;
777 
778  /**
779  * \brief Check if the ast node is an instance of ast::Model
780  * \return true if object of type ast::OntologyStatement
781  */
782  virtual bool is_model () const noexcept;
783 
784  /**
785  * \brief Check if the ast node is an instance of ast::Define
786  * \return true if object of type ast::OntologyStatement
787  */
788  virtual bool is_define () const noexcept;
789 
790  /**
791  * \brief Check if the ast node is an instance of ast::Include
792  * \return true if object of type ast::OntologyStatement
793  */
794  virtual bool is_include () const noexcept;
795 
796  /**
797  * \brief Check if the ast node is an instance of ast::ParamAssign
798  * \return true if object of type ast::OntologyStatement
799  */
800  virtual bool is_param_assign () const noexcept;
801 
802  /**
803  * \brief Check if the ast node is an instance of ast::AssignedDefinition
804  * \return true if object of type ast::OntologyStatement
805  */
806  virtual bool is_assigned_definition () const noexcept;
807 
808  /**
809  * \brief Check if the ast node is an instance of ast::ConductanceHint
810  * \return true if object of type ast::OntologyStatement
811  */
812  virtual bool is_conductance_hint () const noexcept;
813 
814  /**
815  * \brief Check if the ast node is an instance of ast::ExpressionStatement
816  * \return true if object of type ast::OntologyStatement
817  */
818  virtual bool is_expression_statement () const noexcept;
819 
820  /**
821  * \brief Check if the ast node is an instance of ast::ProtectStatement
822  * \return true if object of type ast::OntologyStatement
823  */
824  virtual bool is_protect_statement () const noexcept;
825 
826  /**
827  * \brief Check if the ast node is an instance of ast::FromStatement
828  * \return true if object of type ast::OntologyStatement
829  */
830  virtual bool is_from_statement () const noexcept;
831 
832  /**
833  * \brief Check if the ast node is an instance of ast::WhileStatement
834  * \return true if object of type ast::OntologyStatement
835  */
836  virtual bool is_while_statement () const noexcept;
837 
838  /**
839  * \brief Check if the ast node is an instance of ast::IfStatement
840  * \return true if object of type ast::OntologyStatement
841  */
842  virtual bool is_if_statement () const noexcept;
843 
844  /**
845  * \brief Check if the ast node is an instance of ast::ElseIfStatement
846  * \return true if object of type ast::OntologyStatement
847  */
848  virtual bool is_else_if_statement () const noexcept;
849 
850  /**
851  * \brief Check if the ast node is an instance of ast::ElseStatement
852  * \return true if object of type ast::OntologyStatement
853  */
854  virtual bool is_else_statement () const noexcept;
855 
856  /**
857  * \brief Check if the ast node is an instance of ast::WatchStatement
858  * \return true if object of type ast::OntologyStatement
859  */
860  virtual bool is_watch_statement () const noexcept;
861 
862  /**
863  * \brief Check if the ast node is an instance of ast::MutexLock
864  * \return true if object of type ast::OntologyStatement
865  */
866  virtual bool is_mutex_lock () const noexcept;
867 
868  /**
869  * \brief Check if the ast node is an instance of ast::MutexUnlock
870  * \return true if object of type ast::OntologyStatement
871  */
872  virtual bool is_mutex_unlock () const noexcept;
873 
874  /**
875  * \brief Check if the ast node is an instance of ast::Conserve
876  * \return true if object of type ast::OntologyStatement
877  */
878  virtual bool is_conserve () const noexcept;
879 
880  /**
881  * \brief Check if the ast node is an instance of ast::Compartment
882  * \return true if object of type ast::OntologyStatement
883  */
884  virtual bool is_compartment () const noexcept;
885 
886  /**
887  * \brief Check if the ast node is an instance of ast::LonDiffuse
888  * \return true if object of type ast::OntologyStatement
889  */
890  virtual bool is_lon_diffuse () const noexcept;
891 
892  /**
893  * \brief Check if the ast node is an instance of ast::ReactionStatement
894  * \return true if object of type ast::OntologyStatement
895  */
896  virtual bool is_reaction_statement () const noexcept;
897 
898  /**
899  * \brief Check if the ast node is an instance of ast::LagStatement
900  * \return true if object of type ast::OntologyStatement
901  */
902  virtual bool is_lag_statement () const noexcept;
903 
904  /**
905  * \brief Check if the ast node is an instance of ast::ConstantStatement
906  * \return true if object of type ast::OntologyStatement
907  */
908  virtual bool is_constant_statement () const noexcept;
909 
910  /**
911  * \brief Check if the ast node is an instance of ast::TableStatement
912  * \return true if object of type ast::OntologyStatement
913  */
914  virtual bool is_table_statement () const noexcept;
915 
916  /**
917  * \brief Check if the ast node is an instance of ast::Suffix
918  * \return true if object of type ast::OntologyStatement
919  */
920  virtual bool is_suffix () const noexcept;
921 
922  /**
923  * \brief Check if the ast node is an instance of ast::Useion
924  * \return true if object of type ast::OntologyStatement
925  */
926  virtual bool is_useion () const noexcept;
927 
928  /**
929  * \brief Check if the ast node is an instance of ast::Nonspecific
930  * \return true if object of type ast::OntologyStatement
931  */
932  virtual bool is_nonspecific () const noexcept;
933 
934  /**
935  * \brief Check if the ast node is an instance of ast::ElectrodeCurrent
936  * \return true if object of type ast::OntologyStatement
937  */
938  virtual bool is_electrode_current () const noexcept;
939 
940  /**
941  * \brief Check if the ast node is an instance of ast::Range
942  * \return true if object of type ast::OntologyStatement
943  */
944  virtual bool is_range () const noexcept;
945 
946  /**
947  * \brief Check if the ast node is an instance of ast::Global
948  * \return true if object of type ast::OntologyStatement
949  */
950  virtual bool is_global () const noexcept;
951 
952  /**
953  * \brief Check if the ast node is an instance of ast::RandomVarList
954  * \return true if object of type ast::OntologyStatement
955  */
956  virtual bool is_random_var_list () const noexcept;
957 
958  /**
959  * \brief Check if the ast node is an instance of ast::Pointer
960  * \return true if object of type ast::OntologyStatement
961  */
962  virtual bool is_pointer () const noexcept;
963 
964  /**
965  * \brief Check if the ast node is an instance of ast::BbcorePointer
966  * \return true if object of type ast::OntologyStatement
967  */
968  virtual bool is_bbcore_pointer () const noexcept;
969 
970  /**
971  * \brief Check if the ast node is an instance of ast::External
972  * \return true if object of type ast::OntologyStatement
973  */
974  virtual bool is_external () const noexcept;
975 
976  /**
977  * \brief Check if the ast node is an instance of ast::ThreadSafe
978  * \return true if object of type ast::OntologyStatement
979  */
980  virtual bool is_thread_safe () const noexcept;
981 
982  /**
983  * \brief Check if the ast node is an instance of ast::Verbatim
984  * \return true if object of type ast::OntologyStatement
985  */
986  virtual bool is_verbatim () const noexcept;
987 
988  /**
989  * \brief Check if the ast node is an instance of ast::LineComment
990  * \return true if object of type ast::OntologyStatement
991  */
992  virtual bool is_line_comment () const noexcept;
993 
994  /**
995  * \brief Check if the ast node is an instance of ast::BlockComment
996  * \return true if object of type ast::OntologyStatement
997  */
998  virtual bool is_block_comment () const noexcept;
999 
1000  /**
1001  * \brief Check if the ast node is an instance of ast::OntologyStatement
1002  * \return true if object of type ast::OntologyStatement
1003  */
1004  virtual bool is_ontology_statement () const noexcept;
1005 
1006  /**
1007  * \brief Check if the ast node is an instance of ast::Program
1008  * \return true if object of type ast::OntologyStatement
1009  */
1010  virtual bool is_program () const noexcept;
1011 
1012  /**
1013  * \brief Check if the ast node is an instance of ast::NrnStateBlock
1014  * \return true if object of type ast::OntologyStatement
1015  */
1016  virtual bool is_nrn_state_block () const noexcept;
1017 
1018  /**
1019  * \brief Check if the ast node is an instance of ast::EigenNewtonSolverBlock
1020  * \return true if object of type ast::OntologyStatement
1021  */
1022  virtual bool is_eigen_newton_solver_block () const noexcept;
1023 
1024  /**
1025  * \brief Check if the ast node is an instance of ast::EigenLinearSolverBlock
1026  * \return true if object of type ast::OntologyStatement
1027  */
1028  virtual bool is_eigen_linear_solver_block () const noexcept;
1029 
1030  /**
1031  * \brief Check if the ast node is an instance of ast::CvodeBlock
1032  * \return true if object of type ast::OntologyStatement
1033  */
1034  virtual bool is_cvode_block () const noexcept;
1035 
1036  /**
1037  * \brief Check if the ast node is an instance of ast::LongitudinalDiffusionBlock
1038  * \return true if object of type ast::OntologyStatement
1039  */
1040  virtual bool is_longitudinal_diffusion_block () const noexcept;
1041 
1042  /**
1043  * \brief Check if the ast node is an instance of ast::WrappedExpression
1044  * \return true if object of type ast::OntologyStatement
1045  */
1046  virtual bool is_wrapped_expression () const noexcept;
1047 
1048  /**
1049  * \brief Check if the ast node is an instance of ast::DerivimplicitCallback
1050  * \return true if object of type ast::OntologyStatement
1051  */
1052  virtual bool is_derivimplicit_callback () const noexcept;
1053 
1054  /**
1055  * \brief Check if the ast node is an instance of ast::SolutionExpression
1056  * \return true if object of type ast::OntologyStatement
1057  */
1058  virtual bool is_solution_expression () const noexcept;
1059 
1060  /**
1061  * \brief Check if the ast node is an instance of ast::UpdateDt
1062  * \return true if object of type ast::OntologyStatement
1063  */
1064  virtual bool is_update_dt () const noexcept;
1065 
1066 
1067  /**
1068  *\brief Parent getter
1069  *
1070  * returning a raw pointer may create less problems that the
1071  * shared_from_this from the parent.
1072  *
1073  * Check \ref Ast::parent for more information
1074  */
1075  virtual Ast* get_parent() const;
1076 
1077  /**
1078  *\brief Parent setter
1079  *
1080  * Usually, the parent pointer cannot be set in the constructor
1081  * because children are generally build BEFORE the parent. Conversely,
1082  * we set children parents directly in the parent constructor using
1083  * set_parent_in_children()
1084  *
1085  * Check \ref Ast::parent for more information
1086  */
1087  virtual void set_parent(Ast* p);
1088 };
1089 
1090 } // namespace nmodl::ast
nmodl::ast::Ast::get_nmodl_name
virtual std::string get_nmodl_name() const
Return NMODL statement of ast node as std::string.
Definition: ast.hpp:141
nmodl::ast::Ast::is_argument
virtual bool is_argument() const noexcept
Check if the ast node is an instance of ast::Argument.
Definition: ast.cpp:92
nmodl::visitor::ConstVisitor
Abstract base class for all constant visitors implementation.
Definition: visitor.hpp:302
nmodl::ast::Ast::is_external
virtual bool is_external() const noexcept
Check if the ast node is an instance of ast::External.
Definition: ast.cpp:278
nmodl::ast::Ast::is_double_unit
virtual bool is_double_unit() const noexcept
Check if the ast node is an instance of ast::DoubleUnit.
Definition: ast.cpp:170
nmodl::ast::Ast::is_kinetic_block
virtual bool is_kinetic_block() const noexcept
Check if the ast node is an instance of ast::KineticBlock.
Definition: ast.cpp:160
nmodl::ast::Ast::is_local_list_statement
virtual bool is_local_list_statement() const noexcept
Check if the ast node is an instance of ast::LocalListStatement.
Definition: ast.cpp:212
nmodl::ast::Ast::is_statement
virtual bool is_statement() const noexcept
Check if the ast node is an instance of ast::Statement.
Definition: ast.cpp:64
nmodl::ast::Ast::is_block
virtual bool is_block() const noexcept
Check if the ast node is an instance of ast::Block.
Definition: ast.cpp:68
nmodl::ast::Ast::is_unit_block
virtual bool is_unit_block() const noexcept
Check if the ast node is an instance of ast::UnitBlock.
Definition: ast.cpp:162
nmodl::ast::Ast::is_range
virtual bool is_range() const noexcept
Check if the ast node is an instance of ast::Range.
Definition: ast.cpp:268
nmodl::ast::Ast::is_net_receive_block
virtual bool is_net_receive_block() const noexcept
Check if the ast node is an instance of ast::NetReceiveBlock.
Definition: ast.cpp:146
nmodl::ast::Ast
Base class for all Abstract Syntax Tree node types.
Definition: ast.hpp:69
nmodl::ast::Ast::is_paren_expression
virtual bool is_paren_expression() const noexcept
Check if the ast node is an instance of ast::ParenExpression.
Definition: ast.cpp:186
nmodl::ast::Ast::is_string
virtual bool is_string() const noexcept
Check if the ast node is an instance of ast::String.
Definition: ast.cpp:74
nmodl::ast::Ast::is_non_linear_block
virtual bool is_non_linear_block() const noexcept
Check if the ast node is an instance of ast::NonLinearBlock.
Definition: ast.cpp:136
nmodl::ast::Ast::is_eigen_newton_solver_block
virtual bool is_eigen_newton_solver_block() const noexcept
Check if the ast node is an instance of ast::EigenNewtonSolverBlock.
Definition: ast.cpp:294
nmodl::ast::Ast::is_local_var
virtual bool is_local_var() const noexcept
Check if the ast node is an instance of ast::LocalVar.
Definition: ast.cpp:172
nmodl::ast::Ast::is_ontology_statement
virtual bool is_ontology_statement() const noexcept
Check if the ast node is an instance of ast::OntologyStatement.
Definition: ast.cpp:288
nmodl::ast::Ast::is_global
virtual bool is_global() const noexcept
Check if the ast node is an instance of ast::Global.
Definition: ast.cpp:270
nmodl::ast::Ast::is_conserve
virtual bool is_conserve() const noexcept
Check if the ast node is an instance of ast::Conserve.
Definition: ast.cpp:246
nmodl::ast::Ast::is_destructor_block
virtual bool is_destructor_block() const noexcept
Check if the ast node is an instance of ast::DestructorBlock.
Definition: ast.cpp:128
nmodl::ast::Ast::is_conductance_hint
virtual bool is_conductance_hint() const noexcept
Check if the ast node is an instance of ast::ConductanceHint.
Definition: ast.cpp:224
nmodl::ast::Ast::is_function_call
virtual bool is_function_call() const noexcept
Check if the ast node is an instance of ast::FunctionCall.
Definition: ast.cpp:198
nmodl::ast::Ast::is_suffix
virtual bool is_suffix() const noexcept
Check if the ast node is an instance of ast::Suffix.
Definition: ast.cpp:260
ast_decl.hpp
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
nmodl::ast::Ast::is_assigned_block
virtual bool is_assigned_block() const noexcept
Check if the ast node is an instance of ast::AssignedBlock.
Definition: ast.cpp:120
nmodl::ast::Ast::is_integer
virtual bool is_integer() const noexcept
Check if the ast node is an instance of ast::Integer.
Definition: ast.cpp:76
nmodl::ast::Ast::is_bbcore_pointer
virtual bool is_bbcore_pointer() const noexcept
Check if the ast node is an instance of ast::BbcorePointer.
Definition: ast.cpp:276
nmodl::ast::Ast::is_pointer
virtual bool is_pointer() const noexcept
Check if the ast node is an instance of ast::Pointer.
Definition: ast.cpp:274
nmodl::ast::Ast::is_procedure_block
virtual bool is_procedure_block() const noexcept
Check if the ast node is an instance of ast::ProcedureBlock.
Definition: ast.cpp:144
nmodl::ast::Ast::is_protect_statement
virtual bool is_protect_statement() const noexcept
Check if the ast node is an instance of ast::ProtectStatement.
Definition: ast.cpp:228
nmodl::ast::Ast::is_var_name
virtual bool is_var_name() const noexcept
Check if the ast node is an instance of ast::VarName.
Definition: ast.cpp:90
nmodl::ast
Abstract Syntax Tree (AST) related implementations.
Definition: ast_common.hpp:29
nmodl::ast::Ast::is_expression_statement
virtual bool is_expression_statement() const noexcept
Check if the ast node is an instance of ast::ExpressionStatement.
Definition: ast.cpp:226
nmodl::ast::Ast::is_extern_var
virtual bool is_extern_var() const noexcept
Check if the ast node is an instance of ast::ExternVar.
Definition: ast.cpp:114
nmodl::ast::Ast::is_function_block
virtual bool is_function_block() const noexcept
Check if the ast node is an instance of ast::FunctionBlock.
Definition: ast.cpp:142
visitor.hpp
nmodl::ast::Ast::is_constant_var
virtual bool is_constant_var() const noexcept
Check if the ast node is an instance of ast::ConstantVar.
Definition: ast.cpp:178
nmodl::ast::Ast::is_reaction_statement
virtual bool is_reaction_statement() const noexcept
Check if the ast node is an instance of ast::ReactionStatement.
Definition: ast.cpp:252
nmodl::ast::Ast::~Ast
virtual ~Ast()=default
nmodl::ast::Ast::is_global_var
virtual bool is_global_var() const noexcept
Check if the ast node is an instance of ast::GlobalVar.
Definition: ast.cpp:106
nmodl::ast::AstNodeType
AstNodeType
Enum type for every AST node type.
Definition: ast_decl.hpp:166
ast_common.hpp
Implementation of AST base class and it's properties.
nmodl::ast::Ast::is_nrn_state_block
virtual bool is_nrn_state_block() const noexcept
Check if the ast node is an instance of ast::NrnStateBlock.
Definition: ast.cpp:292
nmodl::ast::Ast::is_assigned_definition
virtual bool is_assigned_definition() const noexcept
Check if the ast node is an instance of ast::AssignedDefinition.
Definition: ast.cpp:222
nmodl::ast::Ast::set_parent
virtual void set_parent(Ast *p)
Parent setter.
Definition: ast.cpp:315
nmodl::ast::Ast::is_random_var_list
virtual bool is_random_var_list() const noexcept
Check if the ast node is an instance of ast::RandomVarList.
Definition: ast.cpp:272
nmodl::ast::Ast::is_function_table_block
virtual bool is_function_table_block() const noexcept
Check if the ast node is an instance of ast::FunctionTableBlock.
Definition: ast.cpp:140
nmodl::ast::Ast::is_mutex_lock
virtual bool is_mutex_lock() const noexcept
Check if the ast node is an instance of ast::MutexLock.
Definition: ast.cpp:242
nmodl::ast::Ast::is_lag_statement
virtual bool is_lag_statement() const noexcept
Check if the ast node is an instance of ast::LagStatement.
Definition: ast.cpp:254
nmodl::ast::Ast::is_ba_block_type
virtual bool is_ba_block_type() const noexcept
Check if the ast node is an instance of ast::BABlockType.
Definition: ast.cpp:202
nmodl::ast::Ast::is_if_statement
virtual bool is_if_statement() const noexcept
Check if the ast node is an instance of ast::IfStatement.
Definition: ast.cpp:234
nmodl::ast::Ast::set_name
virtual void set_name(const std::string &name)
Set name for the AST node.
Definition: ast.cpp:46
nmodl::ast::Ast::is_diff_eq_expression
virtual bool is_diff_eq_expression() const noexcept
Check if the ast node is an instance of ast::DiffEqExpression.
Definition: ast.cpp:190
nmodl::ast::Ast::is_discrete_block
virtual bool is_discrete_block() const noexcept
Check if the ast node is an instance of ast::DiscreteBlock.
Definition: ast.cpp:138
nmodl::ast::Ast::is_name
virtual bool is_name() const noexcept
Check if the ast node is an instance of ast::Name.
Definition: ast.cpp:84
nmodl::ast::Ast::is_verbatim
virtual bool is_verbatim() const noexcept
Check if the ast node is an instance of ast::Verbatim.
Definition: ast.cpp:282
nmodl::ast::Ast::get_node_type_name
virtual std::string get_node_type_name() const =0
Return type (ast::AstNodeType) of ast node as std::string.
nmodl::ast::Ast::get_symbol_table
virtual symtab::SymbolTable * get_symbol_table() const
Return associated symbol table for the AST node.
Definition: ast.cpp:38
nmodl::ast::Ast::is_update_dt
virtual bool is_update_dt() const noexcept
Check if the ast node is an instance of ast::UpdateDt.
Definition: ast.cpp:308
nmodl::visitor::Visitor
Abstract base class for all visitors implementation.
Definition: visitor.hpp:39
nmodl::ast::Ast::is_pointer_var
virtual bool is_pointer_var() const noexcept
Check if the ast node is an instance of ast::PointerVar.
Definition: ast.cpp:108
nmodl::ast::Ast::is_valence
virtual bool is_valence() const noexcept
Check if the ast node is an instance of ast::Valence.
Definition: ast.cpp:208
nmodl::ast::Ast::is_else_if_statement
virtual bool is_else_if_statement() const noexcept
Check if the ast node is an instance of ast::ElseIfStatement.
Definition: ast.cpp:236
nmodl::ast::Ast::is_table_statement
virtual bool is_table_statement() const noexcept
Check if the ast node is an instance of ast::TableStatement.
Definition: ast.cpp:258
nmodl::ast::Ast::is_unit
virtual bool is_unit() const noexcept
Check if the ast node is an instance of ast::Unit.
Definition: ast.cpp:168
nmodl::ast::Ast::is_thread_safe
virtual bool is_thread_safe() const noexcept
Check if the ast node is an instance of ast::ThreadSafe.
Definition: ast.cpp:280
nmodl::ast::Ast::is_longitudinal_diffusion_block
virtual bool is_longitudinal_diffusion_block() const noexcept
Check if the ast node is an instance of ast::LongitudinalDiffusionBlock.
Definition: ast.cpp:300
nmodl::ast::Ast::is_double
virtual bool is_double() const noexcept
Check if the ast node is an instance of ast::Double.
Definition: ast.cpp:80
nmodl::ast::Ast::clone
virtual Ast * clone() const
Create a copy of the current node.
Definition: ast.cpp:26
nmodl::ast::Ast::is_number
virtual bool is_number() const noexcept
Check if the ast node is an instance of ast::Number.
Definition: ast.cpp:72
nmodl::ast::Ast::is_model
virtual bool is_model() const noexcept
Check if the ast node is an instance of ast::Model.
Definition: ast.cpp:214
nmodl::ast::Ast::negate
virtual void negate()
Negate the value of AST node.
Definition: ast.cpp:50
nmodl::ast::Ast::is_ast
virtual bool is_ast() const noexcept
Check if the ast node is an instance of ast::Ast.
Definition: ast.cpp:60
nmodl::ast::Ast::is_block_comment
virtual bool is_block_comment() const noexcept
Check if the ast node is an instance of ast::BlockComment.
Definition: ast.cpp:286
nmodl::ast::Ast::is_initial_block
virtual bool is_initial_block() const noexcept
Check if the ast node is an instance of ast::InitialBlock.
Definition: ast.cpp:124
nmodl::ast::Ast::is_write_ion_var
virtual bool is_write_ion_var() const noexcept
Check if the ast node is an instance of ast::WriteIonVar.
Definition: ast.cpp:98
nmodl::ast::Ast::is_bbcore_pointer_var
virtual bool is_bbcore_pointer_var() const noexcept
Check if the ast node is an instance of ast::BbcorePointerVar.
Definition: ast.cpp:112
nmodl::ast::Ast::is_electrode_cur_var
virtual bool is_electrode_cur_var() const noexcept
Check if the ast node is an instance of ast::ElectrodeCurVar.
Definition: ast.cpp:102
nmodl::ast::Ast::is_watch_statement
virtual bool is_watch_statement() const noexcept
Check if the ast node is an instance of ast::WatchStatement.
Definition: ast.cpp:240
nmodl::ast::Ast::is_random_var
virtual bool is_random_var() const noexcept
Check if the ast node is an instance of ast::RandomVar.
Definition: ast.cpp:110
nmodl::ast::Ast::is_constant_statement
virtual bool is_constant_statement() const noexcept
Check if the ast node is an instance of ast::ConstantStatement.
Definition: ast.cpp:256
nmodl::ast::Ast::is_from_statement
virtual bool is_from_statement() const noexcept
Check if the ast node is an instance of ast::FromStatement.
Definition: ast.cpp:230
nmodl::ast::Ast::Ast
Ast()=default
nmodl::ast::Ast::is_state_block
virtual bool is_state_block() const noexcept
Check if the ast node is an instance of ast::StateBlock.
Definition: ast.cpp:122
nmodl::ast::Ast::get_token
virtual const ModToken * get_token() const
Return associated token for the AST node.
Definition: ast.cpp:36
nmodl::ast::Ast::is_neuron_block
virtual bool is_neuron_block() const noexcept
Check if the ast node is an instance of ast::NeuronBlock.
Definition: ast.cpp:166
nmodl::ast::Ast::accept
virtual void accept(visitor::Visitor &v)=0
Accept (or visit) the AST node using current visitor.
nmodl::ast::Ast::is_watch
virtual bool is_watch() const noexcept
Check if the ast node is an instance of ast::Watch.
Definition: ast.cpp:200
nmodl::symtab::SymbolTable
Represent symbol table for a NMODL block.
Definition: symbol_table.hpp:57
nmodl::ast::Ast::is_mutex_unlock
virtual bool is_mutex_unlock() const noexcept
Check if the ast node is an instance of ast::MutexUnlock.
Definition: ast.cpp:244
nmodl::ast::Ast::is_breakpoint_block
virtual bool is_breakpoint_block() const noexcept
Check if the ast node is an instance of ast::BreakpointBlock.
Definition: ast.cpp:150
nmodl::ast::Ast::is_wrapped_expression
virtual bool is_wrapped_expression() const noexcept
Check if the ast node is an instance of ast::WrappedExpression.
Definition: ast.cpp:302
nmodl::ast::Ast::is_binary_expression
virtual bool is_binary_expression() const noexcept
Check if the ast node is an instance of ast::BinaryExpression.
Definition: ast.cpp:188
nmodl::ast::Ast::is_expression
virtual bool is_expression() const noexcept
Check if the ast node is an instance of ast::Expression.
Definition: ast.cpp:66
nmodl::ast::Ast::is_react_var_name
virtual bool is_react_var_name() const noexcept
Check if the ast node is an instance of ast::ReactVarName.
Definition: ast.cpp:94
nmodl::ast::Ast::is_compartment
virtual bool is_compartment() const noexcept
Check if the ast node is an instance of ast::Compartment.
Definition: ast.cpp:248
nmodl::ast::Ast::is_factor_def
virtual bool is_factor_def() const noexcept
Check if the ast node is an instance of ast::FactorDef.
Definition: ast.cpp:206
nmodl::ast::Ast::is_reaction_operator
virtual bool is_reaction_operator() const noexcept
Check if the ast node is an instance of ast::ReactionOperator.
Definition: ast.cpp:184
nmodl::ast::Ast::set_symbol_table
virtual void set_symbol_table(symtab::SymbolTable *symtab)
Set symbol table for the AST node.
Definition: ast.cpp:42
nmodl::ast::Ast::is_lin_equation
virtual bool is_lin_equation() const noexcept
Check if the ast node is an instance of ast::LinEquation.
Definition: ast.cpp:196
nmodl::ast::Ast::is_define
virtual bool is_define() const noexcept
Check if the ast node is an instance of ast::Define.
Definition: ast.cpp:216
nmodl::ast::Ast::is_statement_block
virtual bool is_statement_block() const noexcept
Check if the ast node is an instance of ast::StatementBlock.
Definition: ast.cpp:130
nmodl::ast::Ast::is_non_lin_equation
virtual bool is_non_lin_equation() const noexcept
Check if the ast node is an instance of ast::NonLinEquation.
Definition: ast.cpp:194
nmodl::ast::Ast::is_indexed_name
virtual bool is_indexed_name() const noexcept
Check if the ast node is an instance of ast::IndexedName.
Definition: ast.cpp:88
nmodl::ast::Ast::get_shared_ptr
virtual std::shared_ptr< Ast > get_shared_ptr()
get std::shared_ptr from this pointer of the AST node
Definition: ast.cpp:52
nmodl::ast::Ast::is_unit_state
virtual bool is_unit_state() const noexcept
Check if the ast node is an instance of ast::UnitState.
Definition: ast.cpp:210
nmodl::ast::Ast::is_include
virtual bool is_include() const noexcept
Check if the ast node is an instance of ast::Include.
Definition: ast.cpp:218
nmodl::ast::Ast::is_param_assign
virtual bool is_param_assign() const noexcept
Check if the ast node is an instance of ast::ParamAssign.
Definition: ast.cpp:220
nmodl::ast::Ast::is_node
virtual bool is_node() const noexcept
Check if the ast node is an instance of ast::Node.
Definition: ast.cpp:62
nmodl::ast::Ast::parent
Ast * parent
Generic pointer to the parent.
Definition: ast.hpp:92
nmodl::ast::Ast::is_lon_diffuse
virtual bool is_lon_diffuse() const noexcept
Check if the ast node is an instance of ast::LonDiffuse.
Definition: ast.cpp:250
nmodl::ast::Ast::is_ba_block
virtual bool is_ba_block() const noexcept
Check if the ast node is an instance of ast::BABlock.
Definition: ast.cpp:156
nmodl::ast::Ast::is_number_range
virtual bool is_number_range() const noexcept
Check if the ast node is an instance of ast::NumberRange.
Definition: ast.cpp:176
nmodl::ast::Ast::is_unary_expression
virtual bool is_unary_expression() const noexcept
Check if the ast node is an instance of ast::UnaryExpression.
Definition: ast.cpp:192
nmodl::ast::Ast::is_unit_def
virtual bool is_unit_def() const noexcept
Check if the ast node is an instance of ast::UnitDef.
Definition: ast.cpp:204
nmodl::ast::Ast::is_linear_block
virtual bool is_linear_block() const noexcept
Check if the ast node is an instance of ast::LinearBlock.
Definition: ast.cpp:134
nmodl::ast::Ast::is_param_block
virtual bool is_param_block() const noexcept
Check if the ast node is an instance of ast::ParamBlock.
Definition: ast.cpp:116
nmodl::ast::Ast::is_prime_name
virtual bool is_prime_name() const noexcept
Check if the ast node is an instance of ast::PrimeName.
Definition: ast.cpp:86
modtoken.hpp
nmodl::ast::Ast::is_solution_expression
virtual bool is_solution_expression() const noexcept
Check if the ast node is an instance of ast::SolutionExpression.
Definition: ast.cpp:306
nmodl::ast::Ast::is_limits
virtual bool is_limits() const noexcept
Check if the ast node is an instance of ast::Limits.
Definition: ast.cpp:174
nmodl::ast::Ast::is_eigen_linear_solver_block
virtual bool is_eigen_linear_solver_block() const noexcept
Check if the ast node is an instance of ast::EigenLinearSolverBlock.
Definition: ast.cpp:296
nmodl::ast::Ast::is_program
virtual bool is_program() const noexcept
Check if the ast node is an instance of ast::Program.
Definition: ast.cpp:290
nmodl::ast::Ast::is_cvode_block
virtual bool is_cvode_block() const noexcept
Check if the ast node is an instance of ast::CvodeBlock.
Definition: ast.cpp:298
nmodl::ast::Ast::is_independent_block
virtual bool is_independent_block() const noexcept
Check if the ast node is an instance of ast::IndependentBlock.
Definition: ast.cpp:118
nmodl::ast::Ast::is_solve_block
virtual bool is_solve_block() const noexcept
Check if the ast node is an instance of ast::SolveBlock.
Definition: ast.cpp:148
nmodl::ast::Ast::is_identifier
virtual bool is_identifier() const noexcept
Check if the ast node is an instance of ast::Identifier.
Definition: ast.cpp:70
nmodl::ast::Ast::is_line_comment
virtual bool is_line_comment() const noexcept
Check if the ast node is an instance of ast::LineComment.
Definition: ast.cpp:284
nmodl::ast::Ast::is_while_statement
virtual bool is_while_statement() const noexcept
Check if the ast node is an instance of ast::WhileStatement.
Definition: ast.cpp:232
nmodl::ast::Ast::get_statement_block
virtual std::shared_ptr< StatementBlock > get_statement_block() const
Return associated statement block for the AST node.
Definition: ast.cpp:32
nmodl::ast::Ast::is_else_statement
virtual bool is_else_statement() const noexcept
Check if the ast node is an instance of ast::ElseStatement.
Definition: ast.cpp:238
nmodl::ast::Ast::is_nonspecific_cur_var
virtual bool is_nonspecific_cur_var() const noexcept
Check if the ast node is an instance of ast::NonspecificCurVar.
Definition: ast.cpp:100
nmodl::ast::Ast::is_derivimplicit_callback
virtual bool is_derivimplicit_callback() const noexcept
Check if the ast node is an instance of ast::DerivimplicitCallback.
Definition: ast.cpp:304
nmodl::ast::Ast::is_before_block
virtual bool is_before_block() const noexcept
Check if the ast node is an instance of ast::BeforeBlock.
Definition: ast.cpp:152
nmodl::ast::Ast::is_electrode_current
virtual bool is_electrode_current() const noexcept
Check if the ast node is an instance of ast::ElectrodeCurrent.
Definition: ast.cpp:266
nmodl::ast::Ast::is_binary_operator
virtual bool is_binary_operator() const noexcept
Check if the ast node is an instance of ast::BinaryOperator.
Definition: ast.cpp:180
nmodl::ast::Ast::is_constant_block
virtual bool is_constant_block() const noexcept
Check if the ast node is an instance of ast::ConstantBlock.
Definition: ast.cpp:164
nmodl::ast::Ast::visit_children
virtual void visit_children(visitor::Visitor &v)=0
Visit children i.e.
nmodl::ast::Ast::get_node_type
virtual AstNodeType get_node_type() const =0
Return type (ast::AstNodeType) of AST node.
nmodl::ast::Ast::is_nonspecific
virtual bool is_nonspecific() const noexcept
Check if the ast node is an instance of ast::Nonspecific.
Definition: ast.cpp:264
nmodl::ast::Ast::is_after_block
virtual bool is_after_block() const noexcept
Check if the ast node is an instance of ast::AfterBlock.
Definition: ast.cpp:154
nmodl::ast::Ast::is_for_netcon
virtual bool is_for_netcon() const noexcept
Check if the ast node is an instance of ast::ForNetcon.
Definition: ast.cpp:158
nmodl::ast::Ast::is_float
virtual bool is_float() const noexcept
Check if the ast node is an instance of ast::Float.
Definition: ast.cpp:78
nmodl::ModToken
Represent token returned by scanner.
Definition: modtoken.hpp:50
nmodl::ast::Ast::is_derivative_block
virtual bool is_derivative_block() const noexcept
Check if the ast node is an instance of ast::DerivativeBlock.
Definition: ast.cpp:132
nmodl::ast::Ast::is_boolean
virtual bool is_boolean() const noexcept
Check if the ast node is an instance of ast::Boolean.
Definition: ast.cpp:82
nmodl::ast::Ast::get_parent
virtual Ast * get_parent() const
Parent getter.
Definition: ast.cpp:311
nmodl::ast::Ast::is_unary_operator
virtual bool is_unary_operator() const noexcept
Check if the ast node is an instance of ast::UnaryOperator.
Definition: ast.cpp:182
nmodl::ast::Ast::get_node_name
virtual std::string get_node_name() const
Return name of of the node.
Definition: ast.cpp:28
common_utils.hpp
Common utility functions for file/dir manipulation.
nmodl::ast::Ast::is_range_var
virtual bool is_range_var() const noexcept
Check if the ast node is an instance of ast::RangeVar.
Definition: ast.cpp:104
nmodl::ast::Ast::is_useion
virtual bool is_useion() const noexcept
Check if the ast node is an instance of ast::Useion.
Definition: ast.cpp:262
nmodl::ast::Ast::is_read_ion_var
virtual bool is_read_ion_var() const noexcept
Check if the ast node is an instance of ast::ReadIonVar.
Definition: ast.cpp:96
nmodl::ast::Ast::is_constructor_block
virtual bool is_constructor_block() const noexcept
Check if the ast node is an instance of ast::ConstructorBlock.
Definition: ast.cpp:126