Parser.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* This software is distributed under the Lesser General Public License */
  2. #ifndef GT_PARSER_H
  3. #define GT_PARSER_H
  4. //
  5. // Parser.h
  6. //
  7. // This file dcefines the classes GT_Parser and GT_Parser_yacc.
  8. //
  9. //------------------------------------------
  10. //
  11. // $Source: /home/br/CVS/graphlet/src/gt_base/Parser.h,v $
  12. // $Author: himsolt $
  13. // $Revision: 1.2 $
  14. // $Date: 1999/03/05 20:44:33 $
  15. // $Locker: $
  16. // $State: Exp $
  17. //
  18. //------------------------------------------
  19. //
  20. // (C) University of Passau 1995-1999, graphlet Project
  21. //
  22. //////////////////////////////////////////
  23. //
  24. // class GT_Parser
  25. //
  26. // This is the pure virtual baseclass for implementing parsers.
  27. //
  28. //////////////////////////////////////////
  29. class GT_List_of_Attributes;
  30. class GT_Attribute_Base;
  31. class GT_Parser {
  32. GT_BASE_CLASS (GT_Parser);
  33. public:
  34. GT_Parser();
  35. virtual ~GT_Parser();
  36. virtual GT_List_of_Attributes* parser (const char* filename = 0);
  37. protected:
  38. GT_List_of_Attributes* the_parsed_attrs;
  39. int the_line_number;
  40. int the_column_number;
  41. string the_error_message;
  42. bool the_error_while_parsing;
  43. public:
  44. inline GT_List_of_Attributes* parsed_attrs ();
  45. inline int line_number() const;
  46. inline int column_number() const;
  47. inline const string& error_message() const;
  48. inline bool error_while_parsing() const;
  49. //void GML_to_Graphlet (struct GML_pair* list, GT_List_of_Attributes* top);
  50. };
  51. inline GT_List_of_Attributes* GT_Parser::parsed_attrs ()
  52. {
  53. return the_parsed_attrs;
  54. }
  55. inline int GT_Parser::line_number() const
  56. {
  57. return the_line_number;
  58. }
  59. inline int GT_Parser::column_number() const
  60. {
  61. return the_column_number;
  62. }
  63. inline const string& GT_Parser::error_message() const
  64. {
  65. return the_error_message;
  66. }
  67. inline bool GT_Parser::error_while_parsing() const
  68. {
  69. return the_error_while_parsing;
  70. }
  71. //////////////////////////////////////////
  72. //
  73. // class GT_Parser_yacc
  74. //
  75. // gone for good
  76. //
  77. //////////////////////////////////////////
  78. // class GT_Parser_yacc : public GT_Parser {
  79. // GT_CLASS (GT_Parser_yacc, GT_Parser);
  80. // public:
  81. // GT_Parser_yacc();
  82. // ~GT_Parser_yacc();
  83. // virtual GT_List_of_Attributes* parser (const char* filename = 0);
  84. // virtual int error (int line_number, const char *message);
  85. // };
  86. #endif