[cfe-commits] r38913 - in /cfe/cfe/trunk: Driver/clang.cpp Parse/Parser.cpp clang.xcodeproj/project.pbxproj include/clang/Parse/Action.h include/clang/Parse/Parser.h

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:25:42 PDT 2007


Author: sabre
Date: Wed Jul 11 11:25:42 2007
New Revision: 38913

URL: http://llvm.org/viewvc/llvm-project?rev=38913&view=rev
Log:
Rename Parse/ParserActions.h -> Parse/Action.h

Modified:
    cfe/cfe/trunk/Driver/clang.cpp
    cfe/cfe/trunk/Parse/Parser.cpp
    cfe/cfe/trunk/clang.xcodeproj/project.pbxproj
    cfe/cfe/trunk/include/clang/Parse/Action.h
    cfe/cfe/trunk/include/clang/Parse/Parser.h

Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=38913&r1=38912&r2=38913&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:25:42 2007
@@ -616,7 +616,7 @@
 // Parser driver
 //===----------------------------------------------------------------------===//
 
-static void ParseFile(Preprocessor &PP, ParserActions *PA, unsigned MainFileID){
+static void ParseFile(Preprocessor &PP, Action *PA, unsigned MainFileID) {
   Parser P(PP, *PA);
 
   PP.EnterSourceFile(MainFileID, 0, true);
@@ -752,7 +752,7 @@
     //ParseFile(PP, new ParserPrintActions(PP), MainFileID);
     break;
   case ParseSyntaxOnly:              // -fsyntax-only
-    ParseFile(PP, new ParserActions(), MainFileID);
+    ParseFile(PP, new Action(), MainFileID);
     break;
   }
   

Modified: cfe/cfe/trunk/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/Parser.cpp?rev=38913&r1=38912&r2=38913&view=diff

==============================================================================
--- cfe/cfe/trunk/Parse/Parser.cpp (original)
+++ cfe/cfe/trunk/Parse/Parser.cpp Wed Jul 11 11:25:42 2007
@@ -17,7 +17,7 @@
 using namespace llvm;
 using namespace clang;
 
-Parser::Parser(Preprocessor &pp, ParserActions &actions)
+Parser::Parser(Preprocessor &pp, Action &actions)
   : PP(pp), Actions(actions), Diags(PP.getDiagnostics()) {
   Tok.SetKind(tok::eof);
   CurScope = 0;
@@ -30,8 +30,8 @@
   delete CurScope;
 }
 
-///  Out-of-line virtual destructor to provide home for ParserActions class.
-ParserActions::~ParserActions() {}
+///  Out-of-line virtual destructor to provide home for Action class.
+Action::~Action() {}
 
 
 void Parser::Diag(SourceLocation Loc, unsigned DiagID,
@@ -166,7 +166,6 @@
 
 /// EnterScope - Start a new scope.
 void Parser::EnterScope() {
-  // TODO: Inform actions?
   CurScope = new Scope(CurScope);
 }
 

Modified: cfe/cfe/trunk/clang.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/clang.xcodeproj/project.pbxproj?rev=38913&r1=38912&r2=38913&view=diff

==============================================================================
--- cfe/cfe/trunk/clang.xcodeproj/project.pbxproj (original)
+++ cfe/cfe/trunk/clang.xcodeproj/project.pbxproj Wed Jul 11 11:25:42 2007
@@ -17,8 +17,8 @@
 		DE06D4310A8BB52D0050E87E /* Parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE06D42F0A8BB52D0050E87E /* Parser.cpp */; };
 		DE06D4410A8BB55C0050E87E /* Declaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE06D4400A8BB55C0050E87E /* Declaration.cpp */; };
 		DE06E4D70A8FBF7A0050E87E /* Initializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE06E4D60A8FBF7A0050E87E /* Initializer.cpp */; };
+		DE06E8140A8FF9330050E87E /* Action.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE06E8130A8FF9330050E87E /* Action.h */; };
 		DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE1F22020A7D852A00FBF588 /* Parser.h */; };
-		DE1F22200A7D879000FBF588 /* ParserActions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE1F221F0A7D879000FBF588 /* ParserActions.h */; };
 		DE1F24820A7DCD3800FBF588 /* Declarations.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE1F24810A7DCD3800FBF588 /* Declarations.h */; };
 		DEAEE98B0A5A2B970045101B /* MultipleIncludeOpt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */; };
 		DEAEECAD0A5AF0E30045101B /* clang.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEECAC0A5AF0E30045101B /* clang.h */; };
@@ -100,11 +100,11 @@
 				DEAEECAD0A5AF0E30045101B /* clang.h in CopyFiles */,
 				DEAEED4B0A5AF89A0045101B /* NOTES.txt in CopyFiles */,
 				DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */,
-				DE1F22200A7D879000FBF588 /* ParserActions.h in CopyFiles */,
 				DE1F24820A7DCD3800FBF588 /* Declarations.h in CopyFiles */,
 				DE06B73E0A8307640050E87E /* LangOptions.h in CopyFiles */,
 				DE06BECB0A854E4B0050E87E /* Scope.h in CopyFiles */,
 				DE06BEF40A8558200050E87E /* Decl.h in CopyFiles */,
+				DE06E8140A8FF9330050E87E /* Action.h in CopyFiles */,
 			);
 			runOnlyForDeploymentPostprocessing = 1;
 		};
@@ -122,8 +122,8 @@
 		DE06D42F0A8BB52D0050E87E /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Parser.cpp; path = Parse/Parser.cpp; sourceTree = "<group>"; };
 		DE06D4400A8BB55C0050E87E /* Declaration.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Declaration.cpp; path = Parse/Declaration.cpp; sourceTree = "<group>"; };
 		DE06E4D60A8FBF7A0050E87E /* Initializer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Initializer.cpp; path = Parse/Initializer.cpp; sourceTree = "<group>"; };
+		DE06E8130A8FF9330050E87E /* Action.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Action.h; path = clang/Parse/Action.h; sourceTree = "<group>"; };
 		DE1F22020A7D852A00FBF588 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Parser.h; path = clang/Parse/Parser.h; sourceTree = "<group>"; };
-		DE1F221F0A7D879000FBF588 /* ParserActions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ParserActions.h; path = clang/Parse/ParserActions.h; sourceTree = "<group>"; };
 		DE1F24810A7DCD3800FBF588 /* Declarations.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Declarations.h; path = clang/Parse/Declarations.h; sourceTree = "<group>"; };
 		DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultipleIncludeOpt.h; sourceTree = "<group>"; };
 		DEAEECAC0A5AF0E30045101B /* clang.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = clang.h; sourceTree = "<group>"; };
@@ -215,10 +215,10 @@
 		DE1F21F20A7D84E800FBF588 /* Parse */ = {
 			isa = PBXGroup;
 			children = (
+				DE06E8130A8FF9330050E87E /* Action.h */,
 				DE1F24810A7DCD3800FBF588 /* Declarations.h */,
 				DE06BEF30A8558200050E87E /* Decl.h */,
 				DE1F22020A7D852A00FBF588 /* Parser.h */,
-				DE1F221F0A7D879000FBF588 /* ParserActions.h */,
 				DE06BECA0A854E4B0050E87E /* Scope.h */,
 			);
 			name = Parse;

Modified: cfe/cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Action.h?rev=38913&r1=38912&r2=38913&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Action.h Wed Jul 11 11:25:42 2007
@@ -1,4 +1,4 @@
-//===--- ParserActions.h - Parser Actions Interface -------------*- C++ -*-===//
+//===--- Action.h - Parser Action Interface ---------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,12 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 //
-//  This file defines the ParserActions interface.
+//  This file defines the Action interface.
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_PARSE_PARSERACTIONS_H
-#define LLVM_CLANG_PARSE_PARSERACTIONS_H
+#ifndef LLVM_CLANG_PARSE_ACTION_H
+#define LLVM_CLANG_PARSE_ACTION_H
 
 #include "clang/Basic/SourceLocation.h"
 
@@ -23,9 +23,9 @@
   // Semantic.
   class Declarator;
 
-/// ParserActions - As the parser reads the input file and recognizes the
-/// productions of the grammar, it invokes methods on this class to turn the
-/// parsed input into something useful: e.g. a parse tree.
+/// Action - As the parser reads the input file and recognizes the productions
+/// of the grammar, it invokes methods on this class to turn the parsed input
+/// into something useful: e.g. a parse tree.
 ///
 /// The callback methods that this class provides are phrased as actions that
 /// the parser has just done or is about to do when the method is called.  They
@@ -33,12 +33,11 @@
 ///
 /// All of the methods here are optional, but you must specify information about
 /// whether something is a typedef or not in order for the parse to complete
-/// accurately.  The EmptyParserActions class does this bare-minimum of
-/// tracking.
-class ParserActions {
+/// accurately.  The EmptyAction class does this bare-minimum of tracking.
+class Action {
 public:
   /// Out-of-line virtual destructor to provide home for this class.
-  virtual ~ParserActions();
+  virtual ~Action();
   
   // Types - Though these don't actually enforce strong typing, they document
   // what types are required to be identical for the actions.

Modified: cfe/cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Parser.h?rev=38913&r1=38912&r2=38913&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Parser.h Wed Jul 11 11:25:42 2007
@@ -15,11 +15,10 @@
 #define LLVM_CLANG_PARSE_PARSER_H
 
 #include "clang/Lex/Preprocessor.h"
-#include "clang/Parse/ParserActions.h"
+#include "clang/Parse/Action.h"
 
 namespace llvm {
 namespace clang {
-  class ParserActions;
   class DeclSpec;
   class Declarator;
   class Scope;
@@ -30,7 +29,7 @@
 ///
 class Parser {
   Preprocessor &PP;
-  ParserActions &Actions;
+  Action &Actions;
   Diagnostic &Diags;
   Scope *CurScope;
   unsigned short ParenCount, BracketCount, BraceCount;
@@ -39,14 +38,14 @@
   /// that this is valid.
   LexerToken Tok;
 public:
-  Parser(Preprocessor &PP, ParserActions &Actions);
+  Parser(Preprocessor &PP, Action &Actions);
   ~Parser();
 
   const LangOptions &getLang() const { return PP.getLangOptions(); }
   
   // Type forwarding.  All of these are statically 'void*', but they may all be
   // different actual classes based on the actions in place.
-  typedef ParserActions::ExprTy ExprTy;
+  typedef Action::ExprTy ExprTy;
   
   // Parsing methods.
   void ParseTranslationUnit();





More information about the cfe-commits mailing list