[llvm-commits] [hlvm] r38016 - in /hlvm/trunk/hlvm/AST: AST.cpp AST.h Node.cpp Node.h

Reid Spencer reid at x10sys.com
Sat Jul 7 16:58:59 PDT 2007


Author: reid
Date: Sat Jul  7 18:58:59 2007
New Revision: 38016

URL: http://llvm.org/viewvc/llvm-project?rev=38016&view=rev
Log:
Add a container class to hold AS Trees.

Added:
    hlvm/trunk/hlvm/AST/AST.cpp
    hlvm/trunk/hlvm/AST/AST.h
Modified:
    hlvm/trunk/hlvm/AST/Node.cpp
    hlvm/trunk/hlvm/AST/Node.h

Added: hlvm/trunk/hlvm/AST/AST.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/AST.cpp?rev=38016&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/AST.cpp (added)
+++ hlvm/trunk/hlvm/AST/AST.cpp Sat Jul  7 18:58:59 2007
@@ -0,0 +1,43 @@
+//===-- hlvm/AST/AST.cpp - AST Container Class ------------------*- C++ -*-===//
+//
+//                      High Level Virtual Machine (HLVM)
+//
+// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
+//
+// This software is free software; you can redistribute it and/or modify it 
+// under the terms of the GNU Lesser General Public License as published by 
+// the Free Software Foundation; either version 2.1 of the License, or (at 
+// your option) any later version.
+//
+// This software 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 Lesser General Public License for 
+// more details.
+//
+// You should have received a copy of the GNU Lesser General Public License 
+// along with this library in the file named LICENSE.txt; if not, write to the 
+// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+// MA 02110-1301 USA
+//
+//===----------------------------------------------------------------------===//
+/// @file hlvm/AST/AST.cpp
+/// @author Reid Spencer <reid at hlvm.org> (original author)
+/// @date 2006/05/04
+/// @since 0.1.0
+/// @brief Implements the functions of class hlvm::AST::AST.
+//===----------------------------------------------------------------------===//
+
+#include <hlvm/AST/AST.h>
+
+namespace hlvm {
+namespace AST {
+
+AST::~AST() {
+}
+#ifndef _NDEBUG
+void 
+AST::dump() const {
+}
+#endif
+
+}}

Added: hlvm/trunk/hlvm/AST/AST.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/AST.h?rev=38016&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/AST.h (added)
+++ hlvm/trunk/hlvm/AST/AST.h Sat Jul  7 18:58:59 2007
@@ -0,0 +1,72 @@
+//===-- hlvm/AST/AST.h - AST Container Class --------------------*- C++ -*-===//
+//
+//                      High Level Virtual Machine (HLVM)
+//
+// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
+//
+// This software is free software; you can redistribute it and/or modify it 
+// under the terms of the GNU Lesser General Public License as published by 
+// the Free Software Foundation; either version 2.1 of the License, or (at 
+// your option) any later version.
+//
+// This software 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 Lesser General Public License for 
+// more details.
+//
+// You should have received a copy of the GNU Lesser General Public License 
+// along with this library in the file named LICENSE.txt; if not, write to the 
+// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+// MA 02110-1301 USA
+//
+//===----------------------------------------------------------------------===//
+/// @file hlvm/AST/AST.h
+/// @author Reid Spencer <reid at hlvm.org> (original author)
+/// @date 2006/05/04
+/// @since 0.1.0
+/// @brief Declares the class hlvm::AST::AST
+//===----------------------------------------------------------------------===//
+
+#ifndef HLVM_AST_AST_H
+#define HLVM_AST_AST_H
+
+#include <hlvm/AST/Node.h>
+
+/// This namespace is for all HLVM software. It ensures that HLVM software does
+/// not collide with any other software. Hopefully HLVM is not a namespace used
+/// elsewhere. 
+namespace hlvm
+{
+/// This namespace contains all the AST (Abstract Syntax Tree) module code. All
+/// node types of the AST are declared in this namespace.
+namespace AST
+{
+  /// This class is used to hold or contain an Abstract Syntax Tree. It provides
+  /// those aspects of the tree that are not part of the tree itself.
+  /// @brief AST Container Class
+  class AST
+  {
+    /// @name Constructors
+    /// @{
+    public:
+      AST() : tree_(0) {}
+      virtual ~AST();
+#ifndef _NDEBUG
+      virtual void dump() const;
+#endif
+
+    /// @}
+    /// @name Accessors
+    /// @{
+    public:
+
+    /// @}
+    /// @name Data
+    /// @{
+    protected:
+      Node* tree_;
+    /// @}
+  };
+} // AST
+} // hlvm
+#endif

Modified: hlvm/trunk/hlvm/AST/Node.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Node.cpp?rev=38016&r1=38015&r2=38016&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/Node.cpp (original)
+++ hlvm/trunk/hlvm/AST/Node.cpp Sat Jul  7 18:58:59 2007
@@ -34,4 +34,10 @@
 namespace hlvm {
 namespace AST {
 
+#ifndef _NDEBUG
+void 
+Node::dump() const {
+}
+#endif
+
 }}

Modified: hlvm/trunk/hlvm/AST/Node.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Node.h?rev=38016&r1=38015&r2=38016&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/Node.h (original)
+++ hlvm/trunk/hlvm/AST/Node.h Sat Jul  7 18:58:59 2007
@@ -34,15 +34,9 @@
 #include <hlvm/AST/Location.h>
 #include <vector>
 
-/// This namespace is for all HLVM software. It ensures that HLVM software does
-/// not collide with any other software. Hopefully HLVM is not a namespace used
-/// elsewhere. 
-namespace hlvm
-{
-/// This namespace contains all the AST (Abstract Syntax Tree) module code. All
-/// node types of the AST are declared in this namespace.
-namespace AST
-{
+namespace hlvm {
+namespace AST {
+
   /// This enumeration is used to identify a specific type
   enum NodeIDs {
     // Primitive Types





More information about the llvm-commits mailing list