~ubuntu-branches/ubuntu/karmic/kdevelop/karmic

« back to all changes in this revision

Viewing changes to languages/perl/perlparser.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-05-25 19:34:26 UTC
  • mfrom: (1.1.11 upstream) (2.3.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090525193426-hdntv90rvflyew8g
Tags: 4:3.9.93-1ubuntu1
* Merge from Debian experimental, remaining changes:
  - Conflict/replace -kde4 packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                          perlparser.h  -  description
3
 
                             -------------------
4
 
    begin                : Sun Nov 2 2003
5
 
    copyright            : (C) 2003 by luc
6
 
    email                : luc@lieve
7
 
 ***************************************************************************/
8
 
 
9
 
/***************************************************************************
10
 
 *                                                                         *
11
 
 *   This program is free software; you can redistribute it and/or modify  *
12
 
 *   it under the terms of the GNU General Public License as published by  *
13
 
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 
 *   (at your option) any later version.                                   *
15
 
 *                                                                         *
16
 
 ***************************************************************************/
17
 
 
18
 
#ifndef PERLPARSER_H
19
 
#define PERLPARSER_H
20
 
 
21
 
#include "kdevlanguagesupport.h"
22
 
#include <codemodel.h>
23
 
 
24
 
 
25
 
/**perl source to classview parser
26
 
  *@author luc
27
 
  */
28
 
 
29
 
class perlparser {
30
 
  public: 
31
 
  perlparser(KDevCore* core,CodeModel* model, QString interpreter);
32
 
  perlparser();
33
 
  ~perlparser();
34
 
 
35
 
  void initialParse();
36
 
  void parse(const QString &fileName);
37
 
  void parseLines(QStringList* lines,const QString& fileName);
38
 
  const QStringList UseFiles();
39
 
  QString findLib( const QString& lib);
40
 
 
41
 
  private:
42
 
  //global functions to add to ClassStore
43
 
  void addPackage(const QString& fileName ,int lineNr , const QString& name);
44
 
  void addAttributetoScript(const QString& fileName ,int lineNr ,const QString& name);
45
 
  void addAttributetoPackage(const QString& fileName ,int lineNr ,const QString& name);
46
 
  void addClass(const QString& fileName ,int lineNr );
47
 
  void addConstructor(const QString& fileName ,int lineNr ,const QString& methodname);
48
 
  void addGlobalSub(const QString& fileName ,int lineNr , const QString& name, bool privatesub);
49
 
  void addScriptSub(const QString& fileName ,int lineNr , const QString& name, bool privatesub);
50
 
  void addClassMethod(const QString& fileName ,int lineNr , const QString& name , bool privatesub);
51
 
  void addPackageSub(const QString& fileName ,int lineNr , const QString& name, bool privatesub);
52
 
  void addParentClass(const QString& parent);
53
 
  void addScript(const QString& fileName ,int lineNr , const QString& name);
54
 
  void addUseLib(const QString& lib);
55
 
  void getPerlINC();
56
 
 
57
 
  bool    m_inpackage;
58
 
  bool    m_inscript;
59
 
  bool    m_inclass;
60
 
 
61
 
  QString m_lastsub;
62
 
  QString m_lastparentclass;
63
 
  QString m_lastattr;
64
 
  QString m_lastpackagename;
65
 
  QString m_lastscriptname;
66
 
 
67
 
  NamespaceDom m_lastscript;
68
 
  NamespaceDom m_lastpackage;
69
 
  ClassDom m_lastclass;
70
 
 
71
 
  //CodeModel
72
 
  CodeModel* m_model;
73
 
  KDevCore* m_core;
74
 
  FileDom m_file;
75
 
 
76
 
  //this willhav a list of INC paths
77
 
  QStringList m_INClist;
78
 
  //this will get a list off all files "use" in the perl files
79
 
  //and need additional parsing to include the classes in the classview
80
 
  QStringList m_usefiles;
81
 
 
82
 
  QString m_interpreter;
83
 
  
84
 
  
85
 
};
86
 
 
87
 
#endif