public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/libbash:master commit in: src/core/
Date: Mon, 23 May 2011 14:34:19 +0000 (UTC)	[thread overview]
Message-ID: <4b15b140c2bf80a536f1116373fad87dcee843c4.betelgeuse@gentoo> (raw)

commit:     4b15b140c2bf80a536f1116373fad87dcee843c4
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Mon May 23 14:41:45 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Mon May 23 14:41:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=4b15b140

Core: avoid abbreviations for member names

---
 src/core/bash_ast.cpp |   38 +++++++++++++++++++-------------------
 src/core/bash_ast.h   |    8 ++++----
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/core/bash_ast.cpp b/src/core/bash_ast.cpp
index 0bf8938..d70520e 100644
--- a/src/core/bash_ast.cpp
+++ b/src/core/bash_ast.cpp
@@ -52,62 +52,62 @@ bash_ast::bash_ast(std::istream& source): error_count(0)
 bash_ast::~bash_ast()
 {
   nodes->free(nodes);
-  psr->free(psr);
-  tstream->free(tstream);
-  lxr->free(lxr);
+  parser->free(parser);
+  token_stream->free(token_stream);
+  lexer->free(lexer);
   input->close(input);
 }
 
 void bash_ast::init_parser()
 {
-  lxr = libbashLexerNew(input);
-  if ( lxr == NULL )
+  lexer = libbashLexerNew(input);
+  if ( lexer == NULL )
   {
     std::cerr << "Unable to create the lexer due to malloc() failure" << std::endl;
     error_count = 1;
     return;
   }
 
-  tstream = antlr3CommonTokenStreamSourceNew(
-      ANTLR3_SIZE_HINT, lxr->pLexer->rec->state->tokSource);
-  if (tstream == NULL)
+  token_stream = antlr3CommonTokenStreamSourceNew(
+      ANTLR3_SIZE_HINT, lexer->pLexer->rec->state->tokSource);
+  if (token_stream == NULL)
   {
     std::cerr << "Out of memory trying to allocate token stream" << std::endl;
     error_count = 1;
     return;
   }
 
-  psr = libbashParserNew(tstream);
-  if (psr == NULL)
+  parser = libbashParserNew(token_stream);
+  if (parser == NULL)
   {
     std::cerr << "Out of memory trying to allocate parser" << std::endl;
     error_count = 1;
     return;
   }
 
-  langAST.reset(new libbashParser_start_return(psr->start(psr)));
-  error_count = psr->pParser->rec->getNumberOfSyntaxErrors(psr->pParser->rec);
-  nodes = antlr3CommonTreeNodeStreamNewTree(langAST->tree, ANTLR3_SIZE_HINT);
+  ast.reset(new libbashParser_start_return(parser->start(parser)));
+  error_count = parser->pParser->rec->getNumberOfSyntaxErrors(parser->pParser->rec);
+  nodes = antlr3CommonTreeNodeStreamNewTree(ast->tree, ANTLR3_SIZE_HINT);
 }
 
 void bash_ast::interpret_with(interpreter& walker)
 {
   set_interpreter(&walker);
-  plibbashWalker treePsr = libbashWalkerNew(nodes);
-  treePsr->start(treePsr);
-  treePsr->free(treePsr);
+  plibbashWalker treeparser = libbashWalkerNew(nodes);
+  treeparser->start(treeparser);
+  treeparser->free(treeparser);
 }
 
 std::string bash_ast::get_dot_graph()
 {
-  pANTLR3_STRING graph = nodes->adaptor->makeDot(nodes->adaptor, langAST->tree);
+  pANTLR3_STRING graph = nodes->adaptor->makeDot(nodes->adaptor, ast->tree);
   return std::string(reinterpret_cast<char*>(graph->chars));
 }
 
 std::string bash_ast::get_string_tree()
 {
   return std::string(reinterpret_cast<char*>(
-        langAST->tree->toStringTree(langAST->tree)->chars));
+        ast->tree->toStringTree(ast->tree)->chars));
 }
 
 namespace
@@ -131,7 +131,7 @@ std::string bash_ast::get_tokens(std::function<std::string(ANTLR3_INT32)> token_
   // output line number for the first line
   result << line_counter++ << "\t";
 
-  pANTLR3_VECTOR token_list = tstream->getTokens(tstream);
+  pANTLR3_VECTOR token_list = token_stream->getTokens(token_stream);
   unsigned token_size = token_list->size(token_list);
 
   for(unsigned i = 0; i != token_size; ++i)

diff --git a/src/core/bash_ast.h b/src/core/bash_ast.h
index e587d81..168d012 100644
--- a/src/core/bash_ast.h
+++ b/src/core/bash_ast.h
@@ -43,10 +43,10 @@ class bash_ast
 {
   pANTLR3_INPUT_STREAM input;
   std::string script;
-  libbashLexer_Ctx_struct* lxr;
-  pANTLR3_COMMON_TOKEN_STREAM tstream;
-  libbashParser_Ctx_struct* psr;
-  std::unique_ptr<libbashParser_start_return_struct> langAST;
+  libbashLexer_Ctx_struct* lexer;
+  pANTLR3_COMMON_TOKEN_STREAM token_stream;
+  libbashParser_Ctx_struct* parser;
+  std::unique_ptr<libbashParser_start_return_struct> ast;
   pANTLR3_COMMON_TREE_NODE_STREAM nodes;
   int error_count;
 



             reply	other threads:[~2011-05-23 14:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 14:34 Petteri Räty [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-04 14:24 [gentoo-commits] proj/libbash:master commit in: src/core/ Petteri Räty
2011-07-08 14:03 Petteri Räty
2011-06-11  8:52 Petteri Räty
2011-06-11  8:24 Petteri Räty
2011-06-09 11:46 Petteri Räty
2011-06-09  7:27 Petteri Räty
2011-06-03 14:48 Petteri Räty
2011-05-06 10:29 Petteri Räty
2011-04-20 14:04 Petteri Räty
2011-04-08 11:12 Petteri Räty
2011-04-06  7:43 Petteri Räty
2011-04-02 15:50 Petteri Räty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b15b140c2bf80a536f1116373fad87dcee843c4.betelgeuse@gentoo \
    --to=betelgeuse@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox