[anjuta/cxxparser] cxxparser: some more refactoring in the naming of the fields/methods.



commit 49a87eff453743f4b7ff1e96d5206e3e858dabd9
Author: Massimo Corà <mcora src gnome org>
Date:   Sun Jul 26 22:05:57 2009 +0200

    cxxparser: some more refactoring in the naming of the fields/methods.

 plugins/symbol-db/cxxparser/cpp-flex-tokenizer.cpp |    3 +-
 plugins/symbol-db/cxxparser/cpp-flex-tokenizer.h   |    6 +-
 plugins/symbol-db/cxxparser/engine-parser.cpp      |    6 +-
 plugins/symbol-db/cxxparser/expression-parser.cpp  |    4 +-
 plugins/symbol-db/cxxparser/expression-parser.h    |    5 +--
 plugins/symbol-db/cxxparser/expression-result.cpp  |   10 ++--
 plugins/symbol-db/cxxparser/expression-result.h    |    6 +-
 plugins/symbol-db/cxxparser/function-parser.cpp    |    4 +-
 plugins/symbol-db/cxxparser/function-result.cpp    |   10 ++--
 plugins/symbol-db/cxxparser/function-result.h      |   10 ++--
 plugins/symbol-db/cxxparser/scope-parser.h         |    4 +-
 plugins/symbol-db/cxxparser/variable-parser.cpp    |   12 ++--
 plugins/symbol-db/cxxparser/variable-result.cpp    |   10 ++--
 plugins/symbol-db/cxxparser/variable-result.h      |   52 +++++++++++++++-----
 14 files changed, 84 insertions(+), 58 deletions(-)
---
diff --git a/plugins/symbol-db/cxxparser/cpp-flex-tokenizer.cpp b/plugins/symbol-db/cxxparser/cpp-flex-tokenizer.cpp
index 4d44689..e3a6c85 100644
--- a/plugins/symbol-db/cxxparser/cpp-flex-tokenizer.cpp
+++ b/plugins/symbol-db/cxxparser/cpp-flex-tokenizer.cpp
@@ -49,8 +49,7 @@
 #include <string.h>
 
 
-CppTokenizer::CppTokenizer()
-: m_curr(0)
+CppTokenizer::CppTokenizer() : m_curr(0)
 {
 	m_data = NULL;
 	m_pcurr = NULL;
diff --git a/plugins/symbol-db/cxxparser/cpp-flex-tokenizer.h b/plugins/symbol-db/cxxparser/cpp-flex-tokenizer.h
index 9b17adf..3af8511 100644
--- a/plugins/symbol-db/cxxparser/cpp-flex-tokenizer.h
+++ b/plugins/symbol-db/cxxparser/cpp-flex-tokenizer.h
@@ -42,8 +42,8 @@
 //                                                                          
 //////////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////
-#ifndef _CPPTOKENIZER_H
-#define _CPPTOKENIZER_H
+#ifndef _CPPTOKENIZER_H_
+#define _CPPTOKENIZER_H_
 
 #include "flex-lexer-klass.h"
 
@@ -77,4 +77,4 @@ private:
 	int   m_curr;
 };
 
-#endif // _CPPTOKENIZER_H
+#endif // _CPPTOKENIZER_H_
diff --git a/plugins/symbol-db/cxxparser/engine-parser.cpp b/plugins/symbol-db/cxxparser/engine-parser.cpp
index c1a7cc2..eff7783 100644
--- a/plugins/symbol-db/cxxparser/engine-parser.cpp
+++ b/plugins/symbol-db/cxxparser/engine-parser.cpp
@@ -140,7 +140,7 @@ EngineParser::testParseExpression (const string &str)
 		// fill up ExpressionResult
 		result = parseExpression (word);
 
-		result.Print ();
+		result.print ();
 
 		word.clear ();
 	}
@@ -215,7 +215,7 @@ EngineParser::processExpression(const string& stmt, const string& above_text,
 			break;
 		}
 		
-		result.Print ();
+		result.print ();
 
 		// no tokens before this, what we need to do now, is find the TagEntry
 		// that corresponds to the result
@@ -322,7 +322,7 @@ EngineParser::processExpression(const string& stmt, const string& above_text,
 			cout << "variables found are..." << endl;
 			for (VariableList::iterator iter = li.begin(); iter != li.end(); iter++) {
 				Variable var = (*iter);
-				var.Print ();				
+				var.print ();				
 				
 				if (word == var.m_name) {
 					cout << "wh0a! we found the variable type to parse... it's ->" << 
diff --git a/plugins/symbol-db/cxxparser/expression-parser.cpp b/plugins/symbol-db/cxxparser/expression-parser.cpp
index 49cac84..8eae6b0 100644
--- a/plugins/symbol-db/cxxparser/expression-parser.cpp
+++ b/plugins/symbol-db/cxxparser/expression-parser.cpp
@@ -513,7 +513,7 @@ void expr_syncParser(){
 // return the scope name at the end of the input string
 ExpressionResult &parse_expression(const std::string &in)
 {
-	result.Reset();
+	result.reset();
 	//provide the lexer with new input
 	if( !setExprLexerInput(in) ){
 		return result;
@@ -669,7 +669,7 @@ yyreduce:
     switch (yyn)
     {
 case 3:
-{result.Reset();}
+{result.reset();}
 break;
 case 5:
 { 
diff --git a/plugins/symbol-db/cxxparser/expression-parser.h b/plugins/symbol-db/cxxparser/expression-parser.h
index 347d9d8..9078f2a 100644
--- a/plugins/symbol-db/cxxparser/expression-parser.h
+++ b/plugins/symbol-db/cxxparser/expression-parser.h
@@ -29,7 +29,4 @@
  */
 ExpressionResult &parse_expression(const std::string &in);
 
-
-
-
-#endif 
+#endif  /* _EXPRESSION_PARSER_H_ */
diff --git a/plugins/symbol-db/cxxparser/expression-result.cpp b/plugins/symbol-db/cxxparser/expression-result.cpp
index fea2272..2d2706b 100644
--- a/plugins/symbol-db/cxxparser/expression-result.cpp
+++ b/plugins/symbol-db/cxxparser/expression-result.cpp
@@ -24,19 +24,19 @@
 
 ExpressionResult::ExpressionResult()
 {
-	Reset();
+	reset();
 }
 
 ExpressionResult::~ExpressionResult()
 {
 }
 
-void ExpressionResult::Print()
+void ExpressionResult::print()
 {
-	printf("%s\n", ToString().c_str());
+	printf("%s\n", toString().c_str());
 }
 
-std::string ExpressionResult::ToString() const
+std::string ExpressionResult::toString() const
 {
 	char tmp[256];
 	sprintf(tmp, "{m_name:%s, m_isFunc:%s, m_isTemplate:%s, m_isThis:%s, m_isaType:%s, m_isPtr:%s, m_scope:%s, m_templateInitList:%s}", 
@@ -51,7 +51,7 @@ std::string ExpressionResult::ToString() const
 	return tmp;
 }
 
-void ExpressionResult::Reset()
+void ExpressionResult::reset()
 {
 	m_isFunc = false;
 	m_name = "";
diff --git a/plugins/symbol-db/cxxparser/expression-result.h b/plugins/symbol-db/cxxparser/expression-result.h
index 9e799fc..eb64ced 100644
--- a/plugins/symbol-db/cxxparser/expression-result.h
+++ b/plugins/symbol-db/cxxparser/expression-result.h
@@ -40,8 +40,8 @@ public:
 public:
 	ExpressionResult();
 	virtual ~ExpressionResult();
-	void Reset();
-	void Print();
-	std::string ToString() const;
+	void reset();
+	void print();
+	std::string toString() const;
 };
 #endif //EXPRESSION_RESULT_H
diff --git a/plugins/symbol-db/cxxparser/function-parser.cpp b/plugins/symbol-db/cxxparser/function-parser.cpp
index b985761..9f854c7 100644
--- a/plugins/symbol-db/cxxparser/function-parser.cpp
+++ b/plugins/symbol-db/cxxparser/function-parser.cpp
@@ -779,7 +779,7 @@ case 14:
 { yyval = yyvsp[0]; }
 break;
 case 17:
-{curr_func.Reset();}
+{curr_func.reset();}
 break;
 case 19:
 {
@@ -858,7 +858,7 @@ case 69:
 						{
 							g_funcs->push_back(curr_func);
 						}
-						curr_func.Reset();
+						curr_func.reset();
 					}
 break;
 case 70:
diff --git a/plugins/symbol-db/cxxparser/function-result.cpp b/plugins/symbol-db/cxxparser/function-result.cpp
index 3d51cd0..f57cc08 100644
--- a/plugins/symbol-db/cxxparser/function-result.cpp
+++ b/plugins/symbol-db/cxxparser/function-result.cpp
@@ -22,18 +22,18 @@
 
 clFunction::clFunction()
 {
-	Reset();
+	reset();
 }
 
 clFunction::~clFunction()
 {
 }
 
-void clFunction::Reset()
+void clFunction::reset()
 {
 	m_name = "";
 	m_scope = "";
-	m_returnValue.Reset();
+	m_returnValue.reset();
 	m_name = "";
 	m_signature = "";
 	m_lineno = 0;
@@ -43,7 +43,7 @@ void clFunction::Reset()
 	m_isConst = false;
 }
 
-void clFunction::Print()
+void clFunction::print()
 {
 	fprintf(	
 				stdout, "{m_name=%s, m_isConst=%s, m_lineno=%d, m_scope=%s, m_signature=%s, m_isVirtual=%s, m_isPureVirtual=%s, m_retrunValusConst=%s\nm_returnValue=", 
@@ -57,7 +57,7 @@ void clFunction::Print()
 				m_retrunValusConst.c_str()
 			);
 				
-	m_returnValue.Print();
+	m_returnValue.print();
 	fprintf(stdout, "}\n");
 	fflush(stdout);
 }
diff --git a/plugins/symbol-db/cxxparser/function-result.h b/plugins/symbol-db/cxxparser/function-result.h
index 3004494..77d8c6a 100644
--- a/plugins/symbol-db/cxxparser/function-result.h
+++ b/plugins/symbol-db/cxxparser/function-result.h
@@ -18,8 +18,8 @@
  * with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef FUNCTION_H
-#define FUNCTION_H
+#ifndef _FUNCTION_H_
+#define _FUNCTION_H_
 
 #include "string"
 #include "list"
@@ -44,11 +44,11 @@ public:
 	virtual ~clFunction();
 
 	//clear the class content
-	void Reset();
+	void reset();
 
 	//print the variable to stdout
-	void Print();
+	void print();
 };
 
 typedef std::list<clFunction> FunctionList;
-#endif //FUNCTION_H
+#endif // _FUNCTION_H_
diff --git a/plugins/symbol-db/cxxparser/scope-parser.h b/plugins/symbol-db/cxxparser/scope-parser.h
index e129028..e893e2d 100644
--- a/plugins/symbol-db/cxxparser/scope-parser.h
+++ b/plugins/symbol-db/cxxparser/scope-parser.h
@@ -27,8 +27,8 @@
 using namespace std;
 
 
-std::string get_scope_name(	const std::string &in,
+std::string get_scope_name (const std::string &in,
 							std::vector<std::string> &additionalNS,
-							const std::map<std::string, std::string> &ignoreTokens);
+							const std::map <std::string, std::string> &ignoreTokens);
 
 #endif
diff --git a/plugins/symbol-db/cxxparser/variable-parser.cpp b/plugins/symbol-db/cxxparser/variable-parser.cpp
index de8c7a1..a7a55b3 100644
--- a/plugins/symbol-db/cxxparser/variable-parser.cpp
+++ b/plugins/symbol-db/cxxparser/variable-parser.cpp
@@ -769,7 +769,7 @@ case 14:
 { yyval = yyvsp[0]; }
 break;
 case 17:
-{curr_var.Reset(); gs_names.clear(); s_tmpString.clear();}
+{curr_var.reset(); gs_names.clear(); s_tmpString.clear();}
 break;
 case 19:
 {
@@ -820,7 +820,7 @@ case 26:
 									var.m_name = gs_names.at(i);
 									gs_vars->push_back(var);
 								}
-								curr_var.Reset();
+								curr_var.reset();
 								gs_names.clear();
 							}
 						}
@@ -841,7 +841,7 @@ case 27:
 								var = curr_var;
 								var.m_name = yyvsp[-1];;
 								gs_vars->push_back(var);
-								curr_var.Reset();
+								curr_var.reset();
 								gs_names.clear();
 							}
 						}
@@ -864,7 +864,7 @@ case 28:
 								var.m_name = yyvsp[-1];
 								gs_vars->push_back(var);
 
-								curr_var.Reset();
+								curr_var.reset();
 								gs_names.clear();
 							}
 						}
@@ -886,7 +886,7 @@ case 29:
 								var.m_name = "";
 								gs_vars->push_back(var);
 
-								curr_var.Reset();
+								curr_var.reset();
 								gs_names.clear();
 							}
 							if(yyvsp[0] == ",") {
@@ -911,7 +911,7 @@ case 30:
 								var.m_name = "";
 								gs_vars->push_back(var);
 
-								curr_var.Reset();
+								curr_var.reset();
 								gs_names.clear();
 							}
 							if(yyvsp[0] == ",") {
diff --git a/plugins/symbol-db/cxxparser/variable-result.cpp b/plugins/symbol-db/cxxparser/variable-result.cpp
index 8bf1346..386dd50 100644
--- a/plugins/symbol-db/cxxparser/variable-result.cpp
+++ b/plugins/symbol-db/cxxparser/variable-result.cpp
@@ -22,7 +22,7 @@
 
 Variable::Variable()
 {
-	Reset();
+	reset();
 }
 
 Variable::~Variable()
@@ -51,7 +51,7 @@ Variable & Variable::operator =(const Variable &src)
 	return *this;
 }
 
-void Variable::Reset()
+void Variable::reset()
 {
 	m_type = "";
 	m_templateDecl = "";
@@ -67,9 +67,11 @@ void Variable::Reset()
 	m_arrayBrackets = "";
 }
 
-void Variable::Print()
+void Variable::print()
 {
-	fprintf(    stdout, "{m_name=%s, m_defaultValue=%s, m_lineno=%d, m_starAmp=%s, m_type=%s, m_isConst=%s, m_typeScope=%s, m_templateDecl=%s, m_arrayBrackets=%s, m_isPtr=%s, m_isTemplate=%s }\n",
+	fprintf(    stdout, "{m_name=%s, m_defaultValue=%s, m_lineno=%d, m_starAmp=%s, "
+	    "m_type=%s, m_isConst=%s, m_typeScope=%s, m_templateDecl=%s, m_arrayBrackets=%s, "
+	    "m_isPtr=%s, m_isTemplate=%s }\n",		
 				m_name.c_str(),
 				m_defaultValue.c_str(),
 				m_lineno,
diff --git a/plugins/symbol-db/cxxparser/variable-result.h b/plugins/symbol-db/cxxparser/variable-result.h
index b595fed..9fd6efe 100644
--- a/plugins/symbol-db/cxxparser/variable-result.h
+++ b/plugins/symbol-db/cxxparser/variable-result.h
@@ -1,5 +1,25 @@
-#ifndef VARIABLE_H
-#define VARIABLE_H
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * anjuta
+ * Copyright (C) Eran Ifrah (Main file for CodeLite www.codelite.org/ )
+ * Copyright (C) Massimo Cora' 2009 <maxcvs email it> (Customizations for Anjuta)
+ * 
+ * anjuta is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * anjuta is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _VARIABLE_H_
+#define _VARIABLE_H_
 
 #include "string"
 #include "list"
@@ -12,31 +32,39 @@ public:
 	bool            m_isTemplate;
 	std::string     m_templateDecl;
 	bool            m_isPtr;
-	std::string     m_type;		//as in 'int a;' -> type=int
-	std::string     m_typeScope;//as in 'std::string a;' -> typeScope = std, type=string
+	std::string     m_type;		/* as in 'int a;' -> type=int */
+	
+	std::string     m_typeScope;/* as in 'std::string a;' -> typeScope = std, 
+	 							 * type=string 
+	 							 */
 	std::string     m_pattern;
 	std::string     m_starAmp;
 	int             m_lineno;
 	bool            m_isConst;
-	std::string     m_defaultValue;	// used mainly for function arguments with default values foo(int = 0);
+	std::string     m_defaultValue;	/* used mainly for function arguments with 
+	 							     * default values foo (int = 0);
+									 */
 	std::string     m_arrayBrackets;
 
 public:
 	Variable();
 	virtual ~Variable();
 
-	//copy ctor
+	/* copy ctor */
 	Variable(const Variable& src);
 
-	//operator =
+	/* operator = */
 	Variable& operator=(const Variable& src);
 
-	//clear the class content
-	void Reset();
+	/* clear the class content */
+	void reset();
 
-	//print the variable to stdout
-	void Print();
+	/* print the variable to stdout */
+	void print();
 };
 
 typedef std::list<Variable> VariableList;
-#endif //VARIABLE_H
+
+#endif // _VARIABLE_H_
+
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]