From e0474f51443423fce3dda36ec2d063a6ccce0afe Mon Sep 17 00:00:00 2001 From: Thunder422 Date: Sat, 8 Dec 2012 17:53:27 -0500 Subject: [PATCH] prefixed 's_' to static token class members --- enums.awk | 2 +- token.cpp | 38 +++++++++++++++++++------------------- token.h | 20 ++++++++++---------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/enums.awk b/enums.awk index da1f654..9f8e91b 100644 --- a/enums.awk +++ b/enums.awk @@ -127,7 +127,7 @@ BEGIN { { if (msg_array == 0) { - if (line ~ /const QString Token::messageArray/) + if (line ~ /const QString Token::s_messageArray/) { # found start of token message array msg_array = 1 diff --git a/token.cpp b/token.cpp index 057ec74..0a1ef14 100644 --- a/token.cpp +++ b/token.cpp @@ -27,16 +27,16 @@ // static token variables -bool Token::paren[sizeof_TokenType]; -bool Token::op[sizeof_TokenType]; -int Token::prec[sizeof_TokenType]; -bool Token::table[sizeof_TokenType]; +bool Token::s_paren[sizeof_TokenType]; +bool Token::s_op[sizeof_TokenType]; +int Token::s_prec[sizeof_TokenType]; +bool Token::s_table[sizeof_TokenType]; // token status message array // (TokenStatus enumeration generated from names // in comments at the end each line by enums.awk, // lines starting with comments are ignored) -const QString Token::messageArray[sizeof_TokenStatus] = { +const QString Token::s_messageArray[sizeof_TokenStatus] = { tr("Null_TokenStatus (BUG)"), // Null tr("Good_TokenStatus (BUG)"), // Good tr("Done_TokenStatus (BUG)"), // Done @@ -105,26 +105,26 @@ const QString Token::messageArray[sizeof_TokenStatus] = { void Token::initialize(void) { // set true for types that contain an opening parentheses - paren[IntFuncP_TokenType] = true; - paren[DefFuncP_TokenType] = true; - paren[Paren_TokenType] = true; + s_paren[IntFuncP_TokenType] = true; + s_paren[DefFuncP_TokenType] = true; + s_paren[Paren_TokenType] = true; // set true for types that are considered an operator - op[Command_TokenType] = true; - op[Operator_TokenType] = true; + s_op[Command_TokenType] = true; + s_op[Operator_TokenType] = true; // set precedence for non-table token types - prec[Command_TokenType] = -1; // use table precedence if -1 - prec[Operator_TokenType] = -1; - prec[IntFuncP_TokenType] = -1; - prec[DefFuncP_TokenType] = 2; // same as open parentheses (Paren_TokenType) - prec[Paren_TokenType] = 2; + s_prec[Command_TokenType] = -1; // use table precedence if -1 + s_prec[Operator_TokenType] = -1; + s_prec[IntFuncP_TokenType] = -1; + s_prec[DefFuncP_TokenType] = 2; // same as open parentheses (Paren_TokenType) + s_prec[Paren_TokenType] = 2; // set token type has a table entry flags - table[Command_TokenType] = true; - table[Operator_TokenType] = true; - table[IntFuncN_TokenType] = true; - table[IntFuncP_TokenType] = true; + s_table[Command_TokenType] = true; + s_table[Operator_TokenType] = true; + s_table[IntFuncN_TokenType] = true; + s_table[IntFuncP_TokenType] = true; // FIXME should Remark_TokenType also have table entry flag set? } diff --git a/token.h b/token.h index d99ca1a..414f794 100644 --- a/token.h +++ b/token.h @@ -240,19 +240,19 @@ class Token // token information functions bool isOperator(void) const { - return op[m_type]; + return s_op[m_type]; } bool hasParen(void) const { - return paren[m_type]; + return s_paren[m_type]; } int precedence(void) const { - return prec[m_type]; + return s_prec[m_type]; } int hasTableEntry(void) const { - return table[m_type]; + return s_table[m_type]; } bool isNull(void) const { @@ -268,18 +268,18 @@ class Token private: // static members - static bool paren[sizeof_TokenType]; - static bool op[sizeof_TokenType]; - static int prec[sizeof_TokenType]; - static bool table[sizeof_TokenType]; - static const QString messageArray[sizeof_TokenStatus]; + static bool s_paren[sizeof_TokenType]; + static bool s_op[sizeof_TokenType]; + static int s_prec[sizeof_TokenType]; + static bool s_table[sizeof_TokenType]; + static const QString s_messageArray[sizeof_TokenStatus]; public: // static member functions static void initialize(void); static const QString message(TokenStatus status) { - return messageArray[status]; + return s_messageArray[status]; } };