Skip to content

Commit

Permalink
restructured table class files and changed naming
Browse files Browse the repository at this point in the history
all private table definitions (constants and structures) that are only
used in table.cpp to table.cpp; the code for the table access functions
were also moved to table.cpp since the structure definitions were moved;
renamed table variables and functions to Qt style naming; changed the
rest of the char* to QString
  • Loading branch information
thunder422 committed Nov 4, 2012
1 parent fc32a47 commit e8ddccc
Show file tree
Hide file tree
Showing 9 changed files with 522 additions and 499 deletions.
10 changes: 5 additions & 5 deletions commandhandlers.cpp
Expand Up @@ -260,7 +260,7 @@ TokenStatus Input_CmdHandler(Translator &t, CmdItem *cmd_item, Token *token)
return ExpOpSemiOrComma_TokenStatus;
}
// change token to InputBeginStr and set sub-code
t.table->set_token(token, InputBeginStr_Code);
t.table->setToken(token, InputBeginStr_Code);
switch (code)
{
case Comma_Code:
Expand Down Expand Up @@ -295,7 +295,7 @@ TokenStatus Input_CmdHandler(Translator &t, CmdItem *cmd_item, Token *token)
// create new token for InputBegin
// insert at begin of command before first variable
t.output->insert(t.cmd_stack.top().index++,
new RpnItem(t.table->new_token(InputBegin_Code)));
new RpnItem(t.table->newToken(InputBegin_Code)));
}
// if no variable on done stack, error will be reported below
// now continue with input variable
Expand All @@ -311,7 +311,7 @@ TokenStatus Input_CmdHandler(Translator &t, CmdItem *cmd_item, Token *token)
}

// set token for data type specific input assign token
t.table->set_token(token, InputAssign_Code);
t.table->setToken(token, InputAssign_Code);
// set reference flag to be handled correctly in find_code
token->setReference();
// find appropriate input assign code and append to output
Expand All @@ -328,8 +328,8 @@ TokenStatus Input_CmdHandler(Translator &t, CmdItem *cmd_item, Token *token)
// insert input parse token into list at current index (update index)

t.output->insert(t.cmd_stack.top().index++,
new RpnItem(t.table->new_token(
t.table->assoc2_code(token->code()))));
new RpnItem(t.table->newToken(
t.table->assoc2Code(token->code()))));

// now process code
if (code == Comma_Code)
Expand Down
2 changes: 1 addition & 1 deletion enums.awk
Expand Up @@ -84,7 +84,7 @@ BEGIN {
{
if (code_enum == 0)
{
if (line ~ /static TableEntry table_entries/)
if (line ~ /static TableEntry tableEntries/)
{
# found start of table entries
code_enum = 1
Expand Down
10 changes: 5 additions & 5 deletions parser.cpp
Expand Up @@ -99,7 +99,7 @@ Token *Parser::getToken(void)
{
// 2010-03-17: changed to return special end-of-line (last) token
// 2010-03-18: replaced code with function call
m_table->set_token(m_token, EOL_Code);
m_table->setToken(m_token, EOL_Code);
return m_token;
}

Expand Down Expand Up @@ -198,7 +198,7 @@ bool Parser::getIdentifier(void)

// setup token in case this is only one word
m_token->setType(m_table->type(code));
m_token->setDataType(m_table->datatype(code));
m_token->setDataType(m_table->dataType(code));
m_token->setCode(code);
m_token->setLength(len);

Expand Down Expand Up @@ -234,7 +234,7 @@ bool Parser::getIdentifier(void)
}
// get information from two word command
m_token->setType(m_table->type(code));
m_token->setDataType(m_table->datatype(code));
m_token->setDataType(m_table->dataType(code));
m_token->setCode(code);
m_token->setLength(len2 + 1);

Expand Down Expand Up @@ -544,7 +544,7 @@ bool Parser::getOperator(void)

// setup token in case this is only one character
m_token->setType(m_table->type(code));
m_token->setDataType(m_table->datatype(code));
m_token->setDataType(m_table->dataType(code));
m_token->setCode(code);
m_token->setLength(1);

Expand Down Expand Up @@ -581,7 +581,7 @@ bool Parser::getOperator(void)
m_pos += 2; // move past two characters
// get information from two character operator
m_token->setType(m_table->type(code2));
m_token->setDataType(m_table->datatype(code2));
m_token->setDataType(m_table->dataType(code2));
m_token->setCode(code2);
m_token->setLength(2);
return true;
Expand Down

0 comments on commit e8ddccc

Please sign in to comment.