Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
ElftosbAST.h
1 /*
2  * File: ElftosbAST.h
3  *
4  * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5  * See included license file for license details.
6  */
7 #if !defined(_ElftosbAST_h_)
8 #define _ElftosbAST_h_
9 
10 #include "stdafx.h"
11 #include <string>
12 #include <list>
13 #include "smart_ptr.h"
14 #include "EvalContext.h"
15 
16 namespace elftosb
17 {
18 // forward reference
19 class SymbolASTNode;
20 
25 {
27  int m_lastLine;
28 };
29 
33 class ASTNode
34 {
35 public:
38  : m_parent(0)
39  {
40  }
41 
43  ASTNode(ASTNode *parent)
44  : m_parent(parent)
45  , m_location{ 0, 0 }
46  {
47  }
48 
50  ASTNode(const ASTNode &other)
51  : m_parent(other.m_parent)
52  , m_location(other.m_location)
53  {
54  }
55 
57  virtual ~ASTNode() {}
59  virtual ASTNode *clone() const = 0;
60 
62  virtual std::string nodeName() const { return "ASTNode"; }
64 
65  virtual ASTNode *getParent() const { return m_parent; }
66  virtual void setParent(ASTNode *newParent) { m_parent = newParent; }
68 
70 
71  virtual void printTree() const { printTree(0); }
72  virtual void printTree(int indent) const;
74 
76 
77  virtual void setLocation(token_loc_t &loc) { m_location = loc; }
78  virtual void setLocation(token_loc_t &first, token_loc_t &last);
79  virtual void setLocation(ASTNode *loc) { setLocation(loc->getLocation()); }
80  virtual void setLocation(ASTNode *first, ASTNode *last);
81 
82  virtual token_loc_t &getLocation() { return m_location; }
83  virtual const token_loc_t &getLocation() const { return m_location; }
84  virtual int getFirstLine() { return m_location.m_firstLine; }
85  virtual int getLastLine() { return m_location.m_lastLine; }
87 
88 protected:
91 
93  void printIndent(int indent) const;
94 };
95 
107 class ListASTNode : public ASTNode
108 {
109 public:
110  typedef std::list</*smart_ptr<ASTNode>*/ ASTNode *> ast_list_t;
111  typedef ast_list_t::iterator iterator;
112  typedef ast_list_t::const_iterator const_iterator;
113 
114 public:
115  ListASTNode() {}
116  ListASTNode(const ListASTNode &other);
117 
118  virtual ~ListASTNode();
119 
120  virtual ASTNode *clone() const { return new ListASTNode(*this); }
121  virtual std::string nodeName() const { return "ListASTNode"; }
122  virtual void printTree(int indent) const;
123 
125 
126  virtual void appendNode(ASTNode *node);
128 
130  virtual unsigned nodeCount() const { return static_cast<unsigned>(m_list.size()); }
132 
134 
135  inline iterator begin() { return m_list.begin(); }
136  inline iterator end() { return m_list.end(); }
137  inline const_iterator begin() const { return m_list.begin(); }
138  inline const_iterator end() const { return m_list.end(); }
140 
142 
143  virtual void updateLocation();
145 
146 protected:
147  ast_list_t m_list;
148 };
149 
154 {
155 public:
157  : ASTNode()
158  , m_options(options)
159  {
160  }
161 
162  inline ListASTNode *getOptions() { return m_options; }
163  virtual ASTNode *clone() const { return NULL; }
164 protected:
165  smart_ptr<ListASTNode> m_options;
166 };
167 
172 {
173 public:
175  : ASTNode()
176  , m_constants(constants)
177  {
178  }
179 
180  inline ListASTNode *getConstants() { return m_constants; }
181  virtual ASTNode *clone() const { return NULL; }
182 protected:
183  smart_ptr<ListASTNode> m_constants;
184 };
185 
190 {
191 public:
193  : ASTNode()
194  , m_sources(sources)
195  {
196  }
197 
198  inline ListASTNode *getSources() { return m_sources; }
199  virtual ASTNode *clone() const { return NULL; }
200 protected:
201  smart_ptr<ListASTNode> m_sources;
202 };
203 
204 class ExprASTNode;
205 
210 {
211 public:
213  : ASTNode()
214  , m_entries(entries)
215  , m_keyblobNumberExpr()
216  {
217  }
218 
219  inline ListASTNode *getEntries() { return m_entries; }
220  virtual ASTNode *clone() const { return NULL; }
221  inline void setKeyblobNumberExpr(ExprASTNode *numExpr) { m_keyblobNumberExpr = numExpr; }
222  inline ExprASTNode *getKeyblobNumberExpr() { return m_keyblobNumberExpr; }
223 protected:
224  smart_ptr<ListASTNode> m_entries;
226 };
227 
231 class ExprASTNode : public ASTNode
232 {
233 public:
234  ExprASTNode()
235  : ASTNode()
236  {
237  }
238  ExprASTNode(const ExprASTNode &other)
239  : ASTNode(other)
240  {
241  }
242 
243  virtual std::string nodeName() const { return "ExprASTNode"; }
249  virtual ExprASTNode *reduce(EvalContext &context) { return this; }
250  int_size_t resultIntSize(int_size_t a, int_size_t b);
251 };
252 
256 class ConstASTNode : public ASTNode
257 {
258 public:
259  ConstASTNode()
260  : ASTNode()
261  {
262  }
263  ConstASTNode(const ConstASTNode &other)
264  : ASTNode(other)
265  {
266  }
267 
268 protected:
269 };
270 
275 {
276 public:
278  : ConstASTNode()
279  , m_fields()
280  {
281  }
283 
284  virtual ASTNode *clone() const { return new KeyblobEntryASTNode(*this); }
285  virtual std::string nodeName() const { return "KeyblobEntryASTNode"; }
286  virtual void printTree(int indent) const;
287 
288  void setFieldAssignments(ListASTNode *fields) { m_fields = fields; }
289  ListASTNode *getFieldAssignments() { return m_fields; }
290 protected:
293 };
294 
299 {
300 public:
303 
304  virtual std::string nodeName() const { return "CommandFileASTNode"; }
305  virtual ASTNode *clone() const { return new CommandFileASTNode(*this); }
306  virtual void printTree(int indent) const;
307 
308  inline void setBlocks(ListASTNode *blocks) { m_blocks = blocks; }
309  inline void setOptions(ListASTNode *options) { m_options = options; }
310  inline void setConstants(ListASTNode *constants) { m_constants = constants; }
311  inline void setSources(ListASTNode *sources) { m_sources = sources; }
312  inline void setSections(ListASTNode *sections) { m_sections = sections; }
313  inline ListASTNode *getBlocks() { return m_blocks; }
314  inline ListASTNode *getOptions() { return m_options; }
315  inline ListASTNode *getConstants() { return m_constants; }
316  inline ListASTNode *getSources() { return m_sources; }
317  inline ListASTNode *getSections() { return m_sections; }
318 protected:
319  smart_ptr<ListASTNode> m_blocks;
320  smart_ptr<ListASTNode> m_options;
321  smart_ptr<ListASTNode> m_constants;
322  smart_ptr<ListASTNode> m_sources;
323  smart_ptr<ListASTNode> m_sections;
324 };
325 
330 {
331 public:
332  IntConstExprASTNode(uint32_t value, int_size_t size = kWordSize)
333  : ExprASTNode()
334  , m_value(value)
335  , m_size(size)
336  {
337  }
338 
340 
341  virtual std::string nodeName() const { return "IntConstExprASTNode"; }
342  virtual ASTNode *clone() const { return new IntConstExprASTNode(*this); }
343  virtual void printTree(int indent) const;
344 
345  uint32_t getValue() const { return m_value; }
346  int_size_t getSize() const { return m_size; }
347 protected:
348  uint32_t m_value;
349  int_size_t m_size;
350 };
351 
356 {
357 public:
358  VariableExprASTNode(std::string *name)
359  : ExprASTNode()
360  , m_variable(name)
361  {
362  }
364 
365  inline std::string *getVariableName() { return m_variable; }
366  virtual ASTNode *clone() const { return new VariableExprASTNode(*this); }
367  virtual std::string nodeName() const { return "VariableExprASTNode"; }
368  virtual void printTree(int indent) const;
369 
370  virtual ExprASTNode *reduce(EvalContext &context);
371 
372 protected:
373  smart_ptr<std::string> m_variable;
374 };
375 
382 {
383 public:
385  : ExprASTNode()
386  , m_symbol(sym)
387  {
388  }
390 
391  virtual ASTNode *clone() const { return new SymbolRefExprASTNode(*this); }
392  virtual std::string nodeName() const { return "SymbolRefExprASTNode"; }
393  virtual void printTree(int indent) const;
394 
395  virtual ExprASTNode *reduce(EvalContext &context);
396 
397 protected:
398  SymbolASTNode *m_symbol;
399 };
400 
405 {
406 public:
408  : ExprASTNode()
409  , m_expr(expr)
410  {
411  }
413 
414  virtual ASTNode *clone() const { return new NegativeExprASTNode(*this); }
415  virtual std::string nodeName() const { return "NegativeExprASTNode"; }
416  virtual void printTree(int indent) const;
417 
418  virtual ExprASTNode *reduce(EvalContext &context);
419 
420  ExprASTNode *getExpr() { return m_expr; }
421 protected:
422  smart_ptr<ExprASTNode> m_expr;
423 };
424 
429 {
430 public:
432  : ExprASTNode()
433  , m_expr(expr)
434  {
435  }
437 
438  virtual ASTNode *clone() const { return new BooleanNotExprASTNode(*this); }
439  virtual std::string nodeName() const { return "BooleanNotExprASTNode"; }
440  virtual void printTree(int indent) const;
441 
442  virtual ExprASTNode *reduce(EvalContext &context);
443 
444  ExprASTNode *getExpr() { return m_expr; }
445 protected:
446  smart_ptr<ExprASTNode> m_expr;
447 };
448 
453 {
454 public:
455  SourceFileFunctionASTNode(std::string *functionName, std::string *sourceFileName)
456  : ExprASTNode()
457  , m_functionName(functionName)
458  , m_sourceFile(sourceFileName)
459  {
460  }
462 
463  virtual ASTNode *clone() const { return new SourceFileFunctionASTNode(*this); }
464  virtual std::string nodeName() const { return "SourceFileFunctionASTNode"; }
465  virtual void printTree(int indent) const;
466 
467  virtual ExprASTNode *reduce(EvalContext &context);
468 
469  std::string *getFunctionName() { return m_functionName; }
470  std::string *getSourceFile() { return m_sourceFile; }
471 protected:
472  smart_ptr<std::string> m_functionName;
473  smart_ptr<std::string> m_sourceFile;
474 };
475 
480 {
481 public:
482  DefinedOperatorASTNode(std::string *constantName)
483  : ExprASTNode()
484  , m_constantName(constantName)
485  {
486  }
488 
489  virtual ASTNode *clone() const { return new DefinedOperatorASTNode(*this); }
490  virtual std::string nodeName() const { return "DefinedOperatorASTNode"; }
491  virtual void printTree(int indent) const;
492 
493  virtual ExprASTNode *reduce(EvalContext &context);
494 
495  std::string *getConstantName() { return m_constantName; }
496 protected:
498 };
499 
500 class SymbolASTNode;
501 
506 {
507 public:
508  SizeofOperatorASTNode(std::string *constantName)
509  : ExprASTNode()
510  , m_constantName(constantName)
511  , m_symbol()
512  {
513  }
515  : ExprASTNode()
516  , m_constantName()
517  , m_symbol(symbol)
518  {
519  }
521 
522  virtual ASTNode *clone() const { return new SizeofOperatorASTNode(*this); }
523  virtual std::string nodeName() const { return "SizeofOperatorASTNode"; }
524  virtual void printTree(int indent) const;
525 
526  virtual ExprASTNode *reduce(EvalContext &context);
527 
528  std::string *getConstantName() { return m_constantName; }
529  SymbolASTNode *getSymbol() { return m_symbol; }
530 protected:
534 };
535 
540 {
541 public:
542  enum operator_t
543  {
544  kAdd,
545  kSubtract,
546  kMultiply,
547  kDivide,
548  kModulus,
549  kPower,
550  kBitwiseAnd,
551  kBitwiseOr,
552  kBitwiseXor,
553  kShiftLeft,
554  kShiftRight,
555  kLessThan,
556  kGreaterThan,
557  kLessThanEqual,
558  kGreaterThanEqual,
559  kEqual,
560  kNotEqual,
561  kBooleanAnd,
562  kBooleanOr
563  };
564 
565  BinaryOpExprASTNode(ExprASTNode *left, operator_t op, ExprASTNode *right)
566  : ExprASTNode()
567  , m_left(left)
568  , m_op(op)
569  , m_right(right)
570  {
571  }
572 
574 
575  virtual ASTNode *clone() const { return new BinaryOpExprASTNode(*this); }
576  virtual std::string nodeName() const { return "BinaryOpExprASTNode"; }
577  virtual void printTree(int indent) const;
578 
579  virtual ExprASTNode *reduce(EvalContext &context);
580 
581  ExprASTNode *getLeftExpr() { return m_left; }
582  ExprASTNode *getRightExpr() { return m_right; }
583  operator_t getOp() const { return m_op; }
584 protected:
585  smart_ptr<ExprASTNode> m_left;
586  smart_ptr<ExprASTNode> m_right;
587  operator_t m_op;
588 
589  std::string getOperatorName() const;
590 };
591 
596 {
597 public:
598  IntSizeExprASTNode(ExprASTNode *expr, int_size_t intSize)
599  : ExprASTNode()
600  , m_expr(expr)
601  , m_size(intSize)
602  {
603  }
605 
606  virtual ASTNode *clone() const { return new IntSizeExprASTNode(*this); }
607  virtual std::string nodeName() const { return "IntSizeExprASTNode"; }
608  virtual void printTree(int indent) const;
609 
610  virtual ExprASTNode *reduce(EvalContext &context);
611 
612  ExprASTNode *getExpr() { return m_expr; }
613  int_size_t getIntSize() { return m_size; }
614 protected:
615  smart_ptr<ExprASTNode> m_expr;
616  int_size_t m_size;
617 };
618 
623 {
624 public:
626  : ConstASTNode()
627  , m_expr(expr)
628  {
629  }
630  ExprConstASTNode(const ExprConstASTNode &other);
631 
632  virtual ASTNode *clone() const { return new ExprConstASTNode(*this); }
633  virtual std::string nodeName() const { return "ExprConstASTNode"; }
634  virtual void printTree(int indent) const;
635 
636  ExprASTNode *getExpr() { return m_expr; }
637 protected:
638  smart_ptr<ExprASTNode> m_expr;
639 };
640 
645 {
646 public:
647  StringConstASTNode(std::string *value)
648  : ConstASTNode()
649  , m_value(value)
650  {
651  }
653 
654  virtual ASTNode *clone() const { return new StringConstASTNode(*this); }
655  virtual std::string nodeName() const { return "StringConstASTNode"; }
656  virtual void printTree(int indent) const;
657 
658  std::string *getString() { return m_value; }
659 protected:
660  smart_ptr<std::string> m_value;
661 };
662 
667 {
668 public:
669  BlobConstASTNode(Blob *value)
670  : ConstASTNode()
671  , m_blob(value)
672  {
673  }
674  BlobConstASTNode(const BlobConstASTNode &other);
675 
676  virtual ASTNode *clone() const { return new BlobConstASTNode(*this); }
677  virtual std::string nodeName() const { return "BlobConstASTNode"; }
678  virtual void printTree(int indent) const;
679 
680  Blob *getBlob() { return m_blob; }
681 protected:
682  smart_ptr<Blob> m_blob;
683 };
684 
685 // Forward declaration.
686 struct hab_ivt;
687 
692 {
693 public:
695  : ConstASTNode()
696  , m_fields()
697  {
698  }
699  IVTConstASTNode(const IVTConstASTNode &other);
700 
701  virtual ASTNode *clone() const { return new IVTConstASTNode(*this); }
702  virtual std::string nodeName() const { return "IVTConstASTNode"; }
703  virtual void printTree(int indent) const;
704 
705  void setFieldAssignments(ListASTNode *fields) { m_fields = fields; }
706  ListASTNode *getFieldAssignments() { return m_fields; }
707 protected:
710 };
711 
716 {
717 public:
718  AssignmentASTNode(std::string *ident, ASTNode *value)
719  : ASTNode()
720  , m_ident(ident)
721  , m_value(value)
722  {
723  }
724 
725  AssignmentASTNode(const AssignmentASTNode &other);
726 
727  virtual ASTNode *clone() const { return new AssignmentASTNode(*this); }
728  virtual std::string nodeName() const { return "AssignmentASTNode"; }
729  virtual void printTree(int indent) const;
730 
731  inline std::string *getIdent() { return m_ident; }
732  inline ASTNode *getValue() { return m_value; }
733 protected:
734  smart_ptr<std::string> m_ident;
735  smart_ptr<ASTNode> m_value;
736 };
737 
741 class SourceDefASTNode : public ASTNode
742 {
743 public:
744  SourceDefASTNode(std::string *name)
745  : m_name(name)
746  {
747  }
748  SourceDefASTNode(const SourceDefASTNode &other);
749 
750  inline std::string *getName() { return m_name; }
751  inline void setAttributes(ListASTNode *attributes) { m_attributes = attributes; }
752  inline ListASTNode *getAttributes() { return m_attributes; }
753 protected:
754  smart_ptr<std::string> m_name;
755  smart_ptr<ListASTNode> m_attributes;
756 };
757 
762 {
763 public:
764  PathSourceDefASTNode(std::string *name, std::string *path)
765  : SourceDefASTNode(name)
766  , m_path(path)
767  {
768  }
769 
771 
772  virtual PathSourceDefASTNode *clone() const { return new PathSourceDefASTNode(*this); }
773  virtual std::string nodeName() const { return "PathSourceDefASTNode"; }
774  virtual void printTree(int indent) const;
775 
776  std::string *getPath() { return m_path; }
777 protected:
778  smart_ptr<std::string> m_path;
779 };
780 
785 {
786 public:
787  ExternSourceDefASTNode(std::string *name, ExprASTNode *expr)
788  : SourceDefASTNode(name)
789  , m_expr(expr)
790  {
791  }
792 
794 
795  virtual ASTNode *clone() const { return new ExternSourceDefASTNode(*this); }
796  virtual std::string nodeName() const { return "ExternSourceDefASTNode"; }
797  virtual void printTree(int indent) const;
798 
799  ExprASTNode *getSourceNumberExpr() { return m_expr; }
800 protected:
801  smart_ptr<ExprASTNode> m_expr;
802 };
803 
808 {
809 public:
811  : m_sectionExpr()
812  {
813  }
815  : m_sectionExpr(section)
816  {
817  }
819 
820  virtual ASTNode *clone() const { return new SectionContentsASTNode(*this); }
821  virtual std::string nodeName() const { return "SectionContentsASTNode"; }
822  virtual void printTree(int indent) const;
823 
824  inline void setSectionNumberExpr(ExprASTNode *section) { m_sectionExpr = section; }
825  inline ExprASTNode *getSectionNumberExpr() { return m_sectionExpr; }
826  inline void setOptions(ListASTNode *options) { m_options = options; }
827  inline ListASTNode *getOptions() { return m_options; }
828 protected:
829  smart_ptr<ExprASTNode> m_sectionExpr;
830  smart_ptr<ListASTNode> m_options;
831 };
832 
837 {
838 public:
841  , m_contents(contents)
842  {
843  }
844 
846 
847  virtual ASTNode *clone() const { return new DataSectionContentsASTNode(*this); }
848  virtual std::string nodeName() const { return "DataSectionContentsASTNode"; }
849  virtual void printTree(int indent) const;
850 
851  ASTNode *getContents() { return m_contents; }
852 protected:
853  smart_ptr<ASTNode> m_contents;
854 };
855 
860 {
861 public:
864  , m_statements(statements)
865  {
866  }
867 
869 
870  virtual ASTNode *clone() const { return new BootableSectionContentsASTNode(*this); }
871  virtual std::string nodeName() const { return "BootableSectionContentsASTNode"; }
872  virtual void printTree(int indent) const;
873 
874  ListASTNode *getStatements() { return m_statements; }
875 protected:
876  smart_ptr<ListASTNode> m_statements;
877 };
878 
882 class StatementASTNode : public ASTNode
883 {
884 public:
886  : ASTNode()
887  {
888  }
889  StatementASTNode(const StatementASTNode &other)
890  : ASTNode(other)
891  {
892  }
893 
894 protected:
895 };
896 
901 {
902 public:
904  : StatementASTNode()
905  , m_ifStatements()
906  , m_nextIf()
907  , m_elseStatements()
908  {
909  }
911 
912  virtual ASTNode *clone() const { return new IfStatementASTNode(*this); }
913  void setConditionExpr(ExprASTNode *expr) { m_conditionExpr = expr; }
914  ExprASTNode *getConditionExpr() { return m_conditionExpr; }
915  void setIfStatements(ListASTNode *statements) { m_ifStatements = statements; }
916  ListASTNode *getIfStatements() { return m_ifStatements; }
917  void setNextIf(IfStatementASTNode *nextIf) { m_nextIf = nextIf; }
918  IfStatementASTNode *getNextIf() { return m_nextIf; }
919  void setElseStatements(ListASTNode *statements) { m_elseStatements = statements; }
920  ListASTNode *getElseStatements() { return m_elseStatements; }
921 protected:
927 };
928 
933 {
934 public:
936  : StatementASTNode()
937  , m_modeExpr()
938  {
939  }
941  : StatementASTNode()
942  , m_modeExpr(modeExpr)
943  {
944  }
946 
947  virtual ASTNode *clone() const { return new ModeStatementASTNode(*this); }
948  virtual std::string nodeName() const { return "ModeStatementASTNode"; }
949  virtual void printTree(int indent) const;
950 
951  inline void setModeExpr(ExprASTNode *modeExpr) { m_modeExpr = modeExpr; }
952  inline ExprASTNode *getModeExpr() { return m_modeExpr; }
953 protected:
955 };
956 
961 {
962 public:
964  : StatementASTNode()
965  , m_doEraseAll(false)
966  , m_doEraseAllUnsecure(false)
967  , m_memOption()
968  , m_rangeExpr()
969  {
970  }
971  EraseStatementASTNode(ASTNode *rangeExpr)
972  : StatementASTNode()
973  , m_doEraseAll(false)
974  , m_doEraseAllUnsecure(false)
975  , m_memOption()
976  , m_rangeExpr(rangeExpr)
977  {
978  }
980 
981  virtual ASTNode *clone() const { return new EraseStatementASTNode(*this); }
982  virtual std::string nodeName() const { return "EraseStatementASTNode"; }
983  virtual void printTree(int indent) const;
984 
985  void setEraseAll(bool doIt) { m_doEraseAll = doIt; }
986  bool getEraseAll() const { return m_doEraseAll; }
987  void setEraseAllUnsecure(bool doIt) { m_doEraseAllUnsecure = doIt; }
988  bool getEraseAllUnsecure() const { return m_doEraseAllUnsecure; }
989  inline void setRangeExpr(ASTNode *rangeExpr) { m_rangeExpr = rangeExpr; }
990  inline ASTNode *getRangeExpr() { return m_rangeExpr; }
991  inline void setMemOption(ASTNode *memOpt) { m_memOption = memOpt; }
992  inline ASTNode *getMemOption() { return m_memOption; }
993 protected:
994  bool m_doEraseAll;
995  bool m_doEraseAllUnsecure;
998 };
999 
1004 {
1005 public:
1007  {
1010  kError
1011  };
1012 
1013  typedef enum _message_type message_type_t;
1014 
1015 public:
1016  MessageStatementASTNode(message_type_t messageType, std::string *message)
1017  : StatementASTNode()
1018  , m_type(messageType)
1019  , m_message(message)
1020  {
1021  }
1023 
1024  virtual ASTNode *clone() const { return new MessageStatementASTNode(*this); }
1025  virtual std::string nodeName() const { return "MessageStatementASTNode"; }
1026  virtual void printTree(int indent) const;
1027 
1028  inline message_type_t getType() { return m_type; }
1029  inline std::string *getMessage() { return m_message; }
1030  const char *getTypeName() const;
1031 
1032 protected:
1033  message_type_t m_type;
1035 };
1036 
1041 {
1042 public:
1044  : StatementASTNode()
1045  , m_data()
1046  , m_target()
1047  , m_loadOption()
1048  {
1049  }
1050 
1051  LoadStatementASTNode(ASTNode *data, ASTNode *target)
1052  : StatementASTNode()
1053  , m_data(data)
1054  , m_target()
1055  , m_loadOption()
1056  {
1057  }
1058 
1060 
1061  virtual ASTNode *clone() const { return new LoadStatementASTNode(*this); }
1062  virtual std::string nodeName() const { return "LoadStatementASTNode"; }
1063  virtual void printTree(int indent) const;
1064 
1065  inline void setData(ASTNode *data) { m_data = data; }
1066  inline ASTNode *getData() { return m_data; }
1067  inline void setTarget(ASTNode *target) { m_target = target; }
1068  inline ASTNode *getTarget() { return m_target; }
1069  inline void setLoadOption(ASTNode *memOpt) { m_loadOption = memOpt; }
1070  inline ASTNode *getLoadOption() { return m_loadOption; }
1071 protected:
1072  smart_ptr<ASTNode> m_data;
1073  smart_ptr<ASTNode> m_target;
1075 };
1076 
1081 {
1082 public:
1084  typedef enum
1085  {
1086  kCallType,
1087  kJumpType
1088  } call_type_t;
1089 
1090 public:
1091  CallStatementASTNode(call_type_t callType = kCallType)
1092  : StatementASTNode()
1093  , m_type(callType)
1094  , m_target()
1095  , m_arg()
1096  , m_isHAB(false)
1097  , m_stackPointer()
1098  {
1099  }
1100 
1101  CallStatementASTNode(call_type_t callType, ASTNode *target, ASTNode *arg, ASTNode *sp)
1102  : StatementASTNode()
1103  , m_type(callType)
1104  , m_target(target)
1105  , m_arg(arg)
1106  , m_isHAB(false)
1107  , m_stackPointer(sp)
1108  {
1109  }
1110 
1112 
1113  virtual ASTNode *clone() const { return new CallStatementASTNode(*this); }
1114  virtual std::string nodeName() const { return "CallStatementASTNode"; }
1115  virtual void printTree(int indent) const;
1116 
1117  inline void setCallType(call_type_t callType) { m_type = callType; }
1118  inline call_type_t getCallType() { return m_type; }
1119  inline void setTarget(ASTNode *target) { m_target = target; }
1120  inline ASTNode *getTarget() { return m_target; }
1121  inline void setArgument(ASTNode *arg) { m_arg = arg; }
1122  inline ASTNode *getArgument() { return m_arg; }
1123  inline void setIsHAB(bool isHAB) { m_isHAB = isHAB; }
1124  inline bool isHAB() const { return m_isHAB; }
1125  inline void setStackPointer(ASTNode *arg) { m_stackPointer = arg; }
1126  inline ASTNode *getStackPointer() { return m_stackPointer; }
1127 protected:
1128  call_type_t m_type;
1130  smart_ptr<ASTNode> m_arg;
1131  smart_ptr<ASTNode> m_stackPointer;
1132  bool m_isHAB;
1133 };
1134 
1139 {
1140 public:
1142  : StatementASTNode()
1143  {
1144  }
1146  : StatementASTNode(other)
1147  {
1148  }
1149 
1150  virtual ASTNode *clone() const { return new ResetStatementASTNode(*this); }
1151  virtual std::string nodeName() const { return "ResetStatementASTNode"; }
1152  virtual void printTree(int indent) const;
1153 
1154 protected:
1155 };
1156 
1161 {
1162 public:
1164  : StatementASTNode()
1165  , m_memOption()
1166  , m_rangeExpr()
1167  {
1168  }
1170  : StatementASTNode()
1171  , m_memOption()
1172  , m_rangeExpr(rangeExpr)
1173  {
1174  }
1176 
1177  virtual ASTNode *clone() const { return new MemEnableStatementASTNode(*this); }
1178  virtual std::string nodeName() const { return "MemEnableStatementASTNode"; }
1179  virtual void printTree(int indent) const;
1180 
1181  inline void setRangeExpr(ASTNode *rangeExpr) { m_rangeExpr = rangeExpr; }
1182  inline ASTNode *getRangeExpr() { return m_rangeExpr; }
1183  inline void setMemOption(ASTNode *memOpt) { m_memOption = memOpt; }
1184  inline ASTNode *getMemOption() { return m_memOption; }
1185 protected:
1188 };
1189 
1193 class SourceASTNode : public ASTNode
1194 {
1195 public:
1196  SourceASTNode(std::string *name)
1197  : ASTNode()
1198  , m_name(name)
1199  {
1200  }
1201  SourceASTNode(const SourceASTNode &other);
1202 
1203  virtual ASTNode *clone() const { return new SourceASTNode(*this); }
1204  virtual std::string nodeName() const { return "SourceASTNode"; }
1205  virtual void printTree(int indent) const;
1206 
1207  inline std::string *getSourceName() { return m_name; }
1208 protected:
1209  smart_ptr<std::string> m_name;
1210 };
1211 
1216 {
1217 public:
1219  : ASTNode()
1220  , m_sections(sections)
1221  , m_source()
1222  {
1223  }
1224 
1225  SectionMatchListASTNode(ListASTNode *sections, std::string *source)
1226  : ASTNode()
1227  , m_sections(sections)
1228  , m_source(source)
1229  {
1230  }
1231 
1233 
1234  virtual ASTNode *clone() const { return new SectionMatchListASTNode(*this); }
1235  virtual std::string nodeName() const { return "SectionMatchListASTNode"; }
1236  virtual void printTree(int indent) const;
1237 
1238  inline ListASTNode *getSections() { return m_sections; }
1239  inline std::string *getSourceName() { return m_source; }
1240 protected:
1241  smart_ptr<ListASTNode> m_sections;
1242  smart_ptr<std::string> m_source;
1243 };
1244 
1251 class SectionASTNode : public ASTNode
1252 {
1253 public:
1255  typedef enum
1256  {
1258  kExclude
1259  } match_action_t;
1260 
1261 public:
1262  SectionASTNode(std::string *name)
1263  : ASTNode()
1264  , m_action(kInclude)
1265  , m_name(name)
1266  , m_source()
1267  {
1268  }
1269 
1270  SectionASTNode(std::string *name, match_action_t action)
1271  : ASTNode()
1272  , m_action(action)
1273  , m_name(name)
1274  , m_source()
1275  {
1276  }
1277 
1278  SectionASTNode(std::string *name, std::string *source)
1279  : ASTNode()
1280  , m_action(kInclude)
1281  , m_name(name)
1282  , m_source(source)
1283  {
1284  }
1285 
1286  SectionASTNode(const SectionASTNode &other);
1287 
1288  virtual ASTNode *clone() const { return new SectionASTNode(*this); }
1289  virtual std::string nodeName() const { return "SectionASTNode"; }
1290  virtual void printTree(int indent) const;
1291 
1292  inline match_action_t getAction() { return m_action; }
1293  inline std::string *getSectionName() { return m_name; }
1294  inline std::string *getSourceName() { return m_source; }
1295 protected:
1296  match_action_t m_action;
1297  smart_ptr<std::string> m_name;
1298  smart_ptr<std::string> m_source;
1299 };
1300 
1304 class SymbolASTNode : public ASTNode
1305 {
1306 public:
1307  SymbolASTNode()
1308  : ASTNode()
1309  , m_symbol()
1310  , m_source()
1311  {
1312  }
1313 
1314  SymbolASTNode(std::string *symbol, std::string *source = 0)
1315  : ASTNode()
1316  , m_symbol(symbol)
1317  , m_source(source)
1318  {
1319  }
1320 
1321  SymbolASTNode(const SymbolASTNode &other);
1322 
1323  virtual ASTNode *clone() const { return new SymbolASTNode(*this); }
1324  virtual std::string nodeName() const { return "SymbolASTNode"; }
1325  virtual void printTree(int indent) const;
1326 
1327  inline void setSymbolName(std::string *symbol) { m_symbol = symbol; }
1328  inline std::string *getSymbolName() { return m_symbol; }
1329  inline void setSource(std::string *source) { m_source = source; }
1330  inline std::string *getSource() { return m_source; }
1331 protected:
1334 };
1335 
1340 {
1341 public:
1343  : ASTNode()
1344  , m_begin()
1345  , m_end()
1346  {
1347  }
1348 
1349  AddressRangeASTNode(ASTNode *begin, ASTNode *end)
1350  : ASTNode()
1351  , m_begin(begin)
1352  , m_end(end)
1353  {
1354  }
1355 
1357 
1358  virtual ASTNode *clone() const { return new AddressRangeASTNode(*this); }
1359  virtual std::string nodeName() const { return "AddressRangeASTNode"; }
1360  virtual void printTree(int indent) const;
1361 
1362  inline void setBegin(ASTNode *begin) { m_begin = begin; }
1363  inline ASTNode *getBegin() { return m_begin; }
1364  inline void setEnd(ASTNode *end) { m_end = end; }
1365  inline ASTNode *getEnd() { return m_end; }
1366 protected:
1367  smart_ptr<ASTNode> m_begin;
1368  smart_ptr<ASTNode> m_end;
1369 };
1370 
1375 {
1376 public:
1378  : ASTNode()
1379  {
1380  }
1381 
1383  : ASTNode(other)
1384  {
1385  }
1386 
1387  virtual ASTNode *clone() const { return new NaturalLocationASTNode(*this); }
1388  virtual std::string nodeName() const { return "NaturalLocationASTNode"; }
1389 };
1390 
1395 {
1396 public:
1398  : StatementASTNode()
1399  {
1400  }
1401  FromStatementASTNode(std::string *source, ListASTNode *statements);
1403 
1404  virtual ASTNode *clone() const { return new FromStatementASTNode(*this); }
1405  virtual std::string nodeName() const { return "FromStatementASTNode"; }
1406  virtual void printTree(int indent) const;
1407 
1408  inline void setSourceName(std::string *source) { m_source = source; }
1409  inline std::string *getSourceName() { return m_source; }
1410  inline void setStatements(ListASTNode *statements) { m_statements = statements; }
1411  inline ListASTNode *getStatements() { return m_statements; }
1412 protected:
1413  smart_ptr<std::string> m_source;
1414  smart_ptr<ListASTNode> m_statements;
1415 };
1416 
1421 {
1422 public:
1425  : StatementASTNode()
1426  , m_statements(statements)
1427  , m_keyblobNumberExpr()
1428  {
1429  }
1431 
1432  virtual ASTNode *clone() const { return new EncryptStatementASTNode(*this); }
1433  virtual std::string nodeName() const { return "EncryptStatementASTNode"; }
1434  virtual void printTree(int indent) const;
1435 
1436  inline void setStatements(ListASTNode *statements) { m_statements = statements; }
1437  inline ListASTNode *getStatements() { return m_statements; }
1438  inline void setKeyblobNumberExpr(ExprASTNode *numExpr) { m_keyblobNumberExpr = numExpr; }
1439  inline ExprASTNode *getKeyblobNumberExpr() { return m_keyblobNumberExpr; }
1440 protected:
1441  smart_ptr<ListASTNode> m_statements;
1443 };
1444 
1449 {
1450 public:
1453  : StatementASTNode()
1454  , m_statements(statements)
1455  , m_keyblobNumberExpr()
1456  {
1457  }
1459 
1460  virtual ASTNode *clone() const { return new KeywrapStatementASTNode(*this); }
1461  virtual std::string nodeName() const { return "KeywrapStatementASTNode"; }
1462  virtual void printTree(int indent) const;
1463 
1464  inline void setStatements(ListASTNode *statements) { m_statements = statements; }
1465  inline ListASTNode *getStatements() { return m_statements; }
1466  inline void setKeyblobNumberExpr(ExprASTNode *numExpr) { m_keyblobNumberExpr = numExpr; }
1467  inline ExprASTNode *getKeyblobNumberExpr() { return m_keyblobNumberExpr; }
1468 protected:
1469  smart_ptr<ListASTNode> m_statements;
1471 };
1472 
1473 }; // namespace elftosb
1474 
1475 #endif // _ElftosbAST_h_
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1433
ASTNode(const ASTNode &other)
Copy constructor.
Definition: ElftosbAST.h:50
Definition: ElftosbAST.h:741
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:463
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:414
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:439
Definition: ElftosbAST.h:256
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1324
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1235
call_type_t
Possible sub-types of call statements.
Definition: ElftosbAST.h:1084
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1432
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1323
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:633
Definition: ElftosbAST.h:329
Definition: ElftosbAST.h:1420
Definition: ElftosbAST.h:1193
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:284
smart_ptr< ASTNode > m_rangeExpr
Expression that evaluates to the config block address range.
Definition: ElftosbAST.h:1186
smart_ptr< ExprASTNode > m_modeExpr
Expression that evaluates to the new boot mode.
Definition: ElftosbAST.h:954
List of section matches for a particular source name.
Definition: ElftosbAST.h:1215
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:795
Definition: ElftosbAST.h:1374
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:947
Definition: ElftosbAST.h:882
Definition: ElftosbAST.h:209
smart_ptr< ExprASTNode > m_conditionExpr
Boolean expression.
Definition: ElftosbAST.h:922
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:871
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1460
Prints an informational messag to the user.
Definition: ElftosbAST.h:1008
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:490
smart_ptr< ListASTNode > m_elseStatements
Statements for the "else" part of the statements.
Definition: ElftosbAST.h:926
Node for a constant IVT structure as used by HAB4.
Definition: ElftosbAST.h:691
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:676
Returns true or false depending on whether a constant is defined.
Definition: ElftosbAST.h:479
Node for a keyblob entry.
Definition: ElftosbAST.h:274
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1025
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1288
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:438
int m_lastLine
Ending line of the token.
Definition: ElftosbAST.h:27
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:948
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:489
smart_ptr< std::string > m_constantName
Name of the constant.
Definition: ElftosbAST.h:531
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1061
Expression node for a symbol reference.
Definition: ElftosbAST.h:381
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1114
smart_ptr< IfStatementASTNode > m_nextIf
Link to next "else if". If this is non-NULL then m_elseStatements must be NULL and vice-versa...
Definition: ElftosbAST.h:925
smart_ptr< ASTNode > m_loadOption
Load option identifier.
Definition: ElftosbAST.h:1074
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:848
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1387
Definition: ElftosbAST.h:153
Definition: ElftosbAST.h:622
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:243
Definition: ElftosbAST.h:666
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1150
Definition: ElftosbAST.h:1394
smart_ptr< ListASTNode > m_fields
Fields are set through assignment statements.
Definition: ElftosbAST.h:292
Definition: ElftosbAST.h:900
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:728
Include sections matched by this node.
Definition: ElftosbAST.h:1257
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1358
smart_ptr< ExprASTNode > m_keyblobNumberExpr
Expression that evaluates to the keyblob instance number.
Definition: ElftosbAST.h:1442
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:870
Context for evaluating AST tree and expressions.
Definition: EvalContext.h:28
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:523
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:285
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1203
Performa a boolean inversion.
Definition: ElftosbAST.h:428
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1388
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1177
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:632
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1024
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:773
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1359
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:727
ASTNode()
Default constructor.
Definition: ElftosbAST.h:37
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1178
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:677
Simple, standard smart pointer class.
Definition: apps/elftosb/common/smart_ptr.h:18
smart_ptr< std::string > m_symbol
Required.
Definition: ElftosbAST.h:1332
Statement to print a message to the elftosb user.
Definition: ElftosbAST.h:1003
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:981
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:912
Prints a warning to the user.
Definition: ElftosbAST.h:1009
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:606
smart_ptr< ListASTNode > m_ifStatements
List of "if" section statements.
Definition: ElftosbAST.h:923
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1289
smart_ptr< ASTNode > m_memOption
Memory option identifier.
Definition: ElftosbAST.h:997
smart_ptr< SymbolASTNode > m_symbol
Symbol reference. If this is non-NULL then the constant name is used instead.
Definition: ElftosbAST.h:533
Definition: BootImage.h:13
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1404
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1151
Definition: ElftosbAST.h:1448
match_action_t
Possible actions for a section match list.
Definition: ElftosbAST.h:1255
Returns an integer that is the size in bytes of the operand.
Definition: ElftosbAST.h:505
smart_ptr< std::string > m_message
Message to report.
Definition: ElftosbAST.h:1034
smart_ptr< ASTNode > m_target
This becomes the IVT address in HAB mode.
Definition: ElftosbAST.h:1129
Token location in the source file.
Definition: ElftosbAST.h:24
bool m_isHAB
Stack pointer node for "jump sp" command.
Definition: ElftosbAST.h:1132
ASTNode * m_parent
Pointer to parent node of this object. May be NULL.
Definition: ElftosbAST.h:89
virtual ExprASTNode * reduce(EvalContext &context)
Evaluate the expression and produce a result node to replace this one.
Definition: ElftosbAST.h:249
Definition: ElftosbAST.h:859
smart_ptr< std::string > m_constantName
Name of the constant.
Definition: ElftosbAST.h:497
AST node for a section glob.
Definition: ElftosbAST.h:1251
AST node for a call statement.
Definition: ElftosbAST.h:1080
Statement to insert a ROM_ERASE_CMD command.
Definition: ElftosbAST.h:960
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1405
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:121
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:220
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:415
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:305
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:367
smart_ptr< ListASTNode > m_fields
Fields of the IVT are set through assignment statements.
Definition: ElftosbAST.h:709
Node representing a raw binary section definition.
Definition: ElftosbAST.h:836
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:654
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:199
Definition: ElftosbAST.h:784
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:120
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:575
Definition: IVTDataSource.h:91
Root node for the entire file.
Definition: ElftosbAST.h:298
Negates an expression.
Definition: ElftosbAST.h:595
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:847
virtual PathSourceDefASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:772
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1204
Definition: ElftosbAST.h:355
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:702
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1062
token_loc_t m_location
Location of this node in the source file.
Definition: ElftosbAST.h:90
smart_ptr< ASTNode > m_rangeExpr
Expression that evaluates to the erase address range.
Definition: ElftosbAST.h:996
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1113
Definition: ElftosbAST.h:807
_message_type
Definition: ElftosbAST.h:1006
smart_ptr< ASTNode > m_memOption
Memory option identifier.
Definition: ElftosbAST.h:1187
ast_list_t m_list
Ordered list of child nodes.
Definition: ElftosbAST.h:147
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:701
smart_ptr< ExprASTNode > m_keyblobNumberExpr
Expression that evaluates to the keyblob instance number.
Definition: ElftosbAST.h:1470
Negates an expression.
Definition: ElftosbAST.h:404
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:522
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:366
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:341
Statement to insert a ROM_MEM_ENABLE_CMD command.
Definition: ElftosbAST.h:1160
Calls a built-in function with a source as the parameter.
Definition: ElftosbAST.h:452
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:181
ASTNode(ASTNode *parent)
Constructor taking a parent node.
Definition: ElftosbAST.h:43
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:342
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:820
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:655
Definition: ElftosbAST.h:715
Abstract base class for all expression AST nodes.
Definition: ElftosbAST.h:231
Definition: ElftosbAST.h:1339
Statement to insert a ROM_MODE_CMD command.
Definition: ElftosbAST.h:932
smart_ptr< ExprASTNode > m_keyblobNumberExpr
Expression that evaluates to the keyblob instance number.
Definition: ElftosbAST.h:225
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:576
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:607
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:62
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:982
Manages a binary object of arbitrary length.
Definition: apps/elftosb/common/Blob.h:18
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:304
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:796
AST node for a load statement.
Definition: ElftosbAST.h:1040
Definition: ElftosbAST.h:189
AST node that contains other AST nodes.
Definition: ElftosbAST.h:107
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:392
virtual unsigned nodeCount() const
Returns the number of nodes in this list.
Definition: ElftosbAST.h:130
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:464
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:821
Statement to insert a ROM_RESET_CMD command.
Definition: ElftosbAST.h:1138
smart_ptr< std::string > m_source
Optional, may be NULL;.
Definition: ElftosbAST.h:1333
Definition: ElftosbAST.h:761
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:163
virtual std::string nodeName() const
Returns the name of the object&#39;s class.
Definition: ElftosbAST.h:1461
Definition: ElftosbAST.h:171
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:391
Definition: ElftosbAST.h:644
The base class for all AST node classes.
Definition: ElftosbAST.h:33
Definition: ElftosbAST.h:539
virtual ~ASTNode()
Destructor.
Definition: ElftosbAST.h:57
virtual ASTNode * clone() const
Returns an exact duplicate of this object.
Definition: ElftosbAST.h:1234
Definition: ElftosbAST.h:1304
int m_firstLine
Starting line of the token.
Definition: ElftosbAST.h:26