Update copyright header

This commit is contained in:
David Rose 2001-05-25 21:27:38 +00:00
parent 97d53f23b3
commit 2f4e207edb
2452 changed files with 43254 additions and 11628 deletions

View File

@ -1,6 +1,19 @@
// Filename: cppArrayType.C
// Filename: cppArrayType.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -10,7 +23,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPArrayType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPArrayType::
CPPArrayType(CPPType *element_type, CPPExpression *bounds) :
@ -30,7 +43,7 @@ CPPArrayType(CPPType *element_type, CPPExpression *bounds) :
////////////////////////////////////////////////////////////////////
bool CPPArrayType::
is_fully_specified() const {
return CPPType::is_fully_specified() &&
return CPPType::is_fully_specified() &&
_element_type->is_fully_specified();
}
@ -89,7 +102,7 @@ is_equivalent(const CPPType &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPArrayType::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPArrayType::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -100,12 +113,12 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
}
CPPArrayType *rep = new CPPArrayType(*this);
rep->_element_type =
rep->_element_type =
_element_type->substitute_decl(subst, current_scope, global_scope)
->as_type();
if (_bounds != NULL) {
rep->_bounds =
rep->_bounds =
_bounds->substitute_decl(subst, current_scope, global_scope)
->as_expression();
}
@ -123,7 +136,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPArrayType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPArrayType::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -155,14 +168,14 @@ output_instance(ostream &out, int indent_level, CPPScope *scope,
brackets << "]";
string bracketsstr = brackets.str();
_element_type->output_instance(out, indent_level, scope, complete,
_element_type->output_instance(out, indent_level, scope, complete,
prename, name + bracketsstr);
}
////////////////////////////////////////////////////////////////////
// Function: CPPArrayType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPArrayType::
get_subtype() const {
@ -172,7 +185,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPArrayType::as_array_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPArrayType *CPPArrayType::
as_array_type() {

View File

@ -2,6 +2,19 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPARRAYTYPE_H
#define CPPARRAYTYPE_H

View File

@ -1,7 +1,20 @@
// Filename: cppBison.h
// Filename: cppBisonDefs.h
// Created by: drose (17Jan99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPBISON_H
#define CPPBISON_H

View File

@ -1,6 +1,19 @@
// Filename: cppClassTemplateParameter.C
// Filename: cppClassTemplateParameter.cxx
// Created by: drose (28Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -10,7 +23,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPClassTemplateParameter::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPClassTemplateParameter::
CPPClassTemplateParameter(CPPIdentifier *ident, CPPType *default_type) :
@ -36,7 +49,7 @@ is_fully_specified() const {
////////////////////////////////////////////////////////////////////
// Function: CPPClassTemplateParameter::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPClassTemplateParameter::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -56,7 +69,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
////////////////////////////////////////////////////////////////////
// Function: CPPClassTemplateParameter::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPClassTemplateParameter::
get_subtype() const {
@ -66,7 +79,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPClassTemplateParameter::as_classTemplateParameter
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPClassTemplateParameter *CPPClassTemplateParameter::
as_class_template_parameter() {

View File

@ -2,6 +2,19 @@
// Created by: drose (28Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPCLASSTEMPLATEPARAMETER_H
#define CPPCLASSTEMPLATEPARAMETER_H

View File

@ -1,6 +1,19 @@
// Filename: cppCommentBlock.C
// Filename: cppCommentBlock.cxx
// Created by: drose (15Aug00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "cppCommentBlock.h"

View File

@ -1,6 +1,19 @@
// Filename: cppCommentBlock.h
// Created by: drose (15Aug00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPCOMMENTBLOCK_H

View File

@ -1,6 +1,19 @@
// Filename: cppConstType.C
// Filename: cppConstType.cxx
// Created by: drose (28Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -9,7 +22,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPConstType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPConstType::
CPPConstType(CPPType *wrapped_around) :
@ -28,17 +41,17 @@ CPPConstType(CPPType *wrapped_around) :
////////////////////////////////////////////////////////////////////
bool CPPConstType::
is_fully_specified() const {
return CPPType::is_fully_specified() &&
return CPPType::is_fully_specified() &&
_wrapped_around->is_fully_specified();
}
////////////////////////////////////////////////////////////////////
// Function: CPPConstType::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPConstType::
substitute_decl(CPPDeclaration::SubstDecl &subst,
substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPScope *current_scope, CPPScope *global_scope) {
SubstDecl::const_iterator si = subst.find(this);
if (si != subst.end()) {
@ -46,7 +59,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
}
CPPConstType *rep = new CPPConstType(*this);
rep->_wrapped_around =
rep->_wrapped_around =
_wrapped_around->substitute_decl(subst, current_scope, global_scope)
->as_type();
@ -114,7 +127,7 @@ is_equivalent(const CPPType &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPConstType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPConstType::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -134,14 +147,14 @@ void CPPConstType::
output_instance(ostream &out, int indent_level, CPPScope *scope,
bool complete, const string &prename,
const string &name) const {
_wrapped_around->output_instance(out, indent_level, scope, complete,
_wrapped_around->output_instance(out, indent_level, scope, complete,
"const " + prename, name);
}
////////////////////////////////////////////////////////////////////
// Function: CPPConstType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPConstType::
get_subtype() const {
@ -151,7 +164,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPConstType::as_const_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPConstType *CPPConstType::
as_const_type() {

View File

@ -2,6 +2,19 @@
// Created by: drose (28Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPCONSTTYPE_H
#define CPPCONSTTYPE_H

View File

@ -1,6 +1,19 @@
// Filename: cppDeclaration.C
// Filename: cppDeclaration.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -10,7 +23,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::
CPPDeclaration(const CPPFile &file) :
@ -24,7 +37,7 @@ CPPDeclaration(const CPPFile &file) :
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::Copy Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::
CPPDeclaration(const CPPDeclaration &copy) :
@ -38,7 +51,7 @@ CPPDeclaration(const CPPDeclaration &copy) :
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::
~CPPDeclaration() {
@ -47,7 +60,7 @@ CPPDeclaration::
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::Equivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPDeclaration::
operator == (const CPPDeclaration &other) const {
@ -60,7 +73,7 @@ operator == (const CPPDeclaration &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::Nonequivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPDeclaration::
operator != (const CPPDeclaration &other) const {
@ -70,7 +83,7 @@ operator != (const CPPDeclaration &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::Ordering Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPDeclaration::
operator < (const CPPDeclaration &other) const {
@ -121,10 +134,10 @@ is_fully_specified() const {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::instantiate
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPDeclaration::
instantiate(const CPPTemplateParameterList *,
instantiate(const CPPTemplateParameterList *,
CPPScope *, CPPScope *,
CPPPreprocessor *error_sink) const {
if (error_sink != NULL) {
@ -136,7 +149,7 @@ instantiate(const CPPTemplateParameterList *,
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPDeclaration::
substitute_decl(SubstDecl &subst, CPPScope *, CPPScope *) {
@ -150,7 +163,7 @@ substitute_decl(SubstDecl &subst, CPPScope *, CPPScope *) {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_instance
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstance *CPPDeclaration::
as_instance() {
@ -160,7 +173,7 @@ as_instance() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_class_template_parameter
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPClassTemplateParameter *CPPDeclaration::
as_class_template_parameter() {
@ -170,7 +183,7 @@ as_class_template_parameter() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_typedef
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTypedef *CPPDeclaration::
as_typedef() {
@ -180,7 +193,7 @@ as_typedef() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_type_declaration
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTypeDeclaration *CPPDeclaration::
as_type_declaration() {
@ -190,7 +203,7 @@ as_type_declaration() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_expression
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression *CPPDeclaration::
as_expression() {
@ -200,7 +213,7 @@ as_expression() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPType *CPPDeclaration::
as_type() {
@ -210,7 +223,7 @@ as_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_namespace
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPNamespace *CPPDeclaration::
as_namespace() {
@ -220,7 +233,7 @@ as_namespace() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_using
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPUsing *CPPDeclaration::
as_using() {
@ -230,7 +243,7 @@ as_using() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_simple_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPSimpleType *CPPDeclaration::
as_simple_type() {
@ -240,7 +253,7 @@ as_simple_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_pointer_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPPointerType *CPPDeclaration::
as_pointer_type() {
@ -250,7 +263,7 @@ as_pointer_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_reference_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPReferenceType *CPPDeclaration::
as_reference_type() {
@ -260,7 +273,7 @@ as_reference_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_array_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPArrayType *CPPDeclaration::
as_array_type() {
@ -270,7 +283,7 @@ as_array_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_const_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPConstType *CPPDeclaration::
as_const_type() {
@ -280,7 +293,7 @@ as_const_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_function_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFunctionType *CPPDeclaration::
as_function_type() {
@ -290,7 +303,7 @@ as_function_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_function_group
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFunctionGroup *CPPDeclaration::
as_function_group() {
@ -300,7 +313,7 @@ as_function_group() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_extension_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExtensionType *CPPDeclaration::
as_extension_type() {
@ -310,7 +323,7 @@ as_extension_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_struct_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPStructType *CPPDeclaration::
as_struct_type() {
@ -320,7 +333,7 @@ as_struct_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_enum_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPEnumType *CPPDeclaration::
as_enum_type() {
@ -330,7 +343,7 @@ as_enum_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_tbd_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTBDType *CPPDeclaration::
as_tbd_type() {
@ -340,7 +353,7 @@ as_tbd_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPDeclaration::as_type_proxy
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTypeProxy *CPPDeclaration::
as_type_proxy() {

View File

@ -2,6 +2,19 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPDECLARATION_H
#define CPPDECLARATION_H

View File

@ -1,6 +1,19 @@
// Filename: cppEnumType.C
// Filename: cppEnumType.cxx
// Created by: drose (25Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -15,7 +28,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPEnumType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPEnumType::
CPPEnumType(CPPIdentifier *ident, CPPScope *current_scope,
@ -27,11 +40,11 @@ CPPEnumType(CPPIdentifier *ident, CPPScope *current_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPEnumType::add_element
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPEnumType::
add_element(const string &name, CPPScope *scope, CPPExpression *value) {
CPPType *type =
CPPType *type =
CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int,
CPPSimpleType::F_unsigned));
CPPIdentifier *ident = new CPPIdentifier(name);
@ -55,7 +68,7 @@ is_incomplete() const {
////////////////////////////////////////////////////////////////////
// Function: CPPEnumType::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPEnumType::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -67,7 +80,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPEnumType *rep = new CPPEnumType(*this);
if (_ident != NULL) {
rep->_ident =
rep->_ident =
_ident->substitute_decl(subst, current_scope, global_scope);
}
@ -84,7 +97,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPEnumType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPEnumType::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -104,7 +117,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
if (_ident != NULL) {
out << " " << _ident->get_local_name(scope);
}
out << " {\n";
Elements::const_iterator ei;
for (ei = _elements.begin(); ei != _elements.end(); ++ei) {
@ -121,7 +134,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
////////////////////////////////////////////////////////////////////
// Function: CPPEnumType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPEnumType::
get_subtype() const {
@ -131,7 +144,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPEnumType::as_enum_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPEnumType *CPPEnumType::
as_enum_type() {

View File

@ -2,6 +2,19 @@
// Created by: drose (25Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPENUMTYPE_H
#define CPPENUMTYPE_H
@ -40,7 +53,7 @@ public:
virtual SubType get_subtype() const;
virtual CPPEnumType *as_enum_type();
typedef vector<CPPInstance *> Elements;
Elements _elements;
};

View File

@ -1,6 +1,19 @@
// Filename: cppExpression.C
// Filename: cppExpression.cxx
// Created by: drose (25Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -23,7 +36,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPExpresion::Result::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::Result::
Result() {
@ -33,7 +46,7 @@ Result() {
////////////////////////////////////////////////////////////////////
// Function: CPPExpresion::Result::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::Result::
Result(int value) {
@ -44,7 +57,7 @@ Result(int value) {
////////////////////////////////////////////////////////////////////
// Function: CPPExpresion::Result::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::Result::
Result(double value) {
@ -55,7 +68,7 @@ Result(double value) {
////////////////////////////////////////////////////////////////////
// Function: CPPExpresion::Result::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::Result::
Result(void *value) {
@ -67,7 +80,7 @@ Result(void *value) {
////////////////////////////////////////////////////////////////////
// Function: CPPExpresion::Result::as_integer
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPExpression::Result::
as_integer() const {
@ -91,7 +104,7 @@ as_integer() const {
////////////////////////////////////////////////////////////////////
// Function: CPPExpresion::Result::as_real
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
double CPPExpression::Result::
as_real() const {
@ -115,7 +128,7 @@ as_real() const {
////////////////////////////////////////////////////////////////////
// Function: CPPExpresion::Result::as_pointer
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void *CPPExpression::Result::
as_pointer() const {
@ -139,7 +152,7 @@ as_pointer() const {
////////////////////////////////////////////////////////////////////
// Function: CPPExpresion::Result::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPExpression::Result::
output(ostream &out) const {
@ -168,11 +181,11 @@ output(ostream &out) const {
////////////////////////////////////////////////////////////////////
// Function: CPPExpresion::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::
CPPExpression(int value) :
CPPDeclaration(CPPFile())
CPPDeclaration(CPPFile())
{
_type = T_integer;
_u._integer = value;
@ -181,11 +194,11 @@ CPPExpression(int value) :
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::
CPPExpression(double value) :
CPPDeclaration(CPPFile())
CPPDeclaration(CPPFile())
{
_type = T_real;
_u._real = value;
@ -194,11 +207,11 @@ CPPExpression(double value) :
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::
CPPExpression(const string &value) :
CPPDeclaration(CPPFile())
CPPDeclaration(CPPFile())
{
_type = T_string;
_str = value;
@ -207,14 +220,14 @@ CPPExpression(const string &value) :
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::
CPPExpression(CPPIdentifier *ident, CPPScope *current_scope,
CPPExpression(CPPIdentifier *ident, CPPScope *current_scope,
CPPScope *global_scope, CPPPreprocessor *error_sink) :
CPPDeclaration(CPPFile())
CPPDeclaration(CPPFile())
{
CPPDeclaration *decl =
CPPDeclaration *decl =
ident->find_symbol(current_scope, global_scope, error_sink);
if (decl != NULL) {
@ -239,11 +252,11 @@ CPPExpression(CPPIdentifier *ident, CPPScope *current_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::
CPPExpression(int unary_operator, CPPExpression *op1) :
CPPDeclaration(CPPFile())
CPPDeclaration(CPPFile())
{
_type = T_unary_operation;
_u._op._operator = unary_operator;
@ -255,11 +268,11 @@ CPPExpression(int unary_operator, CPPExpression *op1) :
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::
CPPExpression(int binary_operator, CPPExpression *op1, CPPExpression *op2) :
CPPDeclaration(CPPFile())
CPPDeclaration(CPPFile())
{
_type = T_binary_operation;
_u._op._operator = binary_operator;
@ -271,12 +284,12 @@ CPPExpression(int binary_operator, CPPExpression *op1, CPPExpression *op2) :
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::
CPPExpression(int trinary_operator, CPPExpression *op1, CPPExpression *op2,
CPPExpression(int trinary_operator, CPPExpression *op1, CPPExpression *op2,
CPPExpression *op3) :
CPPDeclaration(CPPFile())
CPPDeclaration(CPPFile())
{
_type = T_trinary_operation;
_u._op._operator = trinary_operator;
@ -349,7 +362,7 @@ new_op(CPPType *type, CPPExpression *op1) {
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::named sizeof_func constructor
// Access: Public, Static
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression CPPExpression::
sizeof_func(CPPType *type) {
@ -363,7 +376,7 @@ sizeof_func(CPPType *type) {
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::
~CPPExpression() {
@ -372,7 +385,7 @@ CPPExpression::
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::evaluate
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression::Result CPPExpression::
evaluate() const {
@ -432,7 +445,7 @@ evaluate() const {
// In all other cases, both operands must be valid in order for
// the operation to be valid.
if (r2._type == RT_error &&
if (r2._type == RT_error &&
(_u._op._operator != OROR && _u._op._operator != ANDAND)) {
return r2;
}
@ -459,7 +472,7 @@ evaluate() const {
case UNARY_NEGATE:
return Result(~r1.as_integer());
case UNARY_MINUS:
return (r1._type == RT_real) ? Result(-r1.as_real()) : Result(-r1.as_integer());
@ -567,7 +580,7 @@ evaluate() const {
return Result(r1.as_integer() >> r2.as_integer());
case '?':
return r1.as_integer() ?
return r1.as_integer() ?
_u._op._op2->evaluate() : _u._op._op3->evaluate();
case '.':
@ -606,19 +619,19 @@ CPPType *CPPExpression::
determine_type() const {
CPPType *t1, *t2;
CPPType *int_type =
CPPType *int_type =
CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int));
CPPType *bool_type =
CPPType *bool_type =
CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_bool));
CPPType *float_type =
CPPType *float_type =
CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_double));
CPPType *char_type =
CPPType *char_type =
CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char));
CPPType *const_char_type =
CPPType *const_char_type =
CPPType::new_type(new CPPConstType(char_type));
CPPType *char_star_type =
@ -678,7 +691,7 @@ determine_type() const {
case UNARY_NEGATE:
return int_type;
case UNARY_MINUS:
return t1;
@ -765,12 +778,12 @@ determine_type() const {
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPExpression::
substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPScope *current_scope, CPPScope *global_scope) {
CPPDeclaration *top =
CPPDeclaration *top =
CPPDeclaration::substitute_decl(subst, current_scope, global_scope);
if (top != this) {
return top;
@ -800,7 +813,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
case T_typecast:
case T_construct:
case T_new:
rep->_u._typecast._op1 =
rep->_u._typecast._op1 =
_u._typecast._op1->substitute_decl(subst, current_scope, global_scope)
->as_expression();
any_changed = any_changed || (rep->_u._typecast._op1 != _u._typecast._op1);
@ -809,21 +822,21 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
case T_default_construct:
case T_default_new:
case T_sizeof:
rep->_u._typecast._to =
rep->_u._typecast._to =
_u._typecast._to->substitute_decl(subst, current_scope, global_scope)
->as_type();
any_changed = any_changed || (rep->_u._typecast._to != _u._typecast._to);
break;
case T_trinary_operation:
rep->_u._op._op3 =
rep->_u._op._op3 =
_u._op._op3->substitute_decl(subst, current_scope, global_scope)
->as_expression();
any_changed = any_changed || (rep->_u._op._op3 != _u._op._op3);
// fall through
case T_binary_operation:
rep->_u._op._op2 =
rep->_u._op._op2 =
_u._op._op2->substitute_decl(subst, current_scope, global_scope)
->as_expression();
any_changed = any_changed || (rep->_u._op._op2 != _u._op._op2);
@ -896,7 +909,7 @@ is_tbd() const {
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPExpression::
output(ostream &out, int indent_level, CPPScope *scope, bool) const {
@ -967,7 +980,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const {
break;
case T_construct:
out << "(" << _u._typecast._to->get_typedef_name(scope)
out << "(" << _u._typecast._to->get_typedef_name(scope)
<< "(" << *_u._typecast._op1 << "))";
break;
@ -999,7 +1012,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const {
case UNARY_NEGATE:
out << "(~ " << *_u._op._op1 << ")";
break;
case UNARY_MINUS:
out << "(- " << *_u._op._op1 << ")";
break;
@ -1027,31 +1040,31 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const {
case OROR:
out << "(" << *_u._op._op1 << " || " << *_u._op._op2 << ")";
break;
case ANDAND:
out << "(" << *_u._op._op1 << " && " << *_u._op._op2 << ")";
break;
case EQCOMPARE:
out << "(" << *_u._op._op1 << " == " << *_u._op._op2 << ")";
break;
case NECOMPARE:
out << "(" << *_u._op._op1 << " != " << *_u._op._op2 << ")";
break;
case LECOMPARE:
out << "(" << *_u._op._op1 << " <= " << *_u._op._op2 << ")";
break;
case GECOMPARE:
out << "(" << *_u._op._op1 << " >= " << *_u._op._op2 << ")";
break;
case LSHIFT:
out << "(" << *_u._op._op1 << " << " << *_u._op._op2 << ")";
break;
case RSHIFT:
out << "(" << *_u._op._op1 << " >> " << *_u._op._op2 << ")";
break;
@ -1075,7 +1088,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const {
case ',': // Comma, no parens are used
out << *_u._op._op1 << ", " << *_u._op._op2;
break;
default:
out << "(" << *_u._op._op1 << " " << (char)_u._op._operator
<< " " << *_u._op._op2 << ")";
@ -1095,7 +1108,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const {
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPExpression::
get_subtype() const {
@ -1105,7 +1118,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPExpression::as_expression
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpression *CPPExpression::
as_expression() {

View File

@ -2,6 +2,19 @@
// Created by: drose (25Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPEXPRESSION_H
#define CPPEXPRESSION_H
@ -79,7 +92,7 @@ public:
virtual CPPExpression *as_expression();
enum Type {
T_integer,
T_real,
@ -97,7 +110,7 @@ public:
T_binary_operation,
T_trinary_operation,
};
Type _type;
string _str;
union {
@ -136,4 +149,4 @@ operator << (ostream &out, const CPPExpression::Result &result) {
#endif

View File

@ -1,6 +1,19 @@
// Filename: cppExpressionParser.C
// Filename: cppExpressionParser.cxx
// Created by: drose (25Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -10,7 +23,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPExpressionParser::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpressionParser::
CPPExpressionParser(CPPScope *current_scope, CPPScope *global_scope) :
@ -23,7 +36,7 @@ CPPExpressionParser(CPPScope *current_scope, CPPScope *global_scope) :
////////////////////////////////////////////////////////////////////
// Function: CPPExpressionParser::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExpressionParser::
~CPPExpressionParser() {
@ -32,7 +45,7 @@ CPPExpressionParser::
////////////////////////////////////////////////////////////////////
// Function: CPPExpressionParser::parse_expr
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPExpressionParser::
parse_expr(const string &expr) {
@ -49,7 +62,7 @@ parse_expr(const string &expr) {
////////////////////////////////////////////////////////////////////
// Function: CPPExpressionParser::parse_expr
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPExpressionParser::
parse_expr(const string &expr, const CPPPreprocessor &filepos) {
@ -68,7 +81,7 @@ parse_expr(const string &expr, const CPPPreprocessor &filepos) {
////////////////////////////////////////////////////////////////////
// Function: CPPExpressionParser::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPExpressionParser::
output(ostream &out) const {

View File

@ -2,6 +2,19 @@
// Created by: drose (25Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPEXPRESSIONPARSER_H
#define CPPEXPRESSIONPARSER_H
@ -40,4 +53,4 @@ operator << (ostream &out, const CPPExpressionParser &ep) {
#endif

View File

@ -1,6 +1,19 @@
// Filename: cppExtensionType.C
// Filename: cppExtensionType.cxx
// Created by: drose (21Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -13,10 +26,10 @@
////////////////////////////////////////////////////////////////////
// Function: CPPExtensionType::Conextensionor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExtensionType::
CPPExtensionType(CPPExtensionType::Type type,
CPPExtensionType(CPPExtensionType::Type type,
CPPIdentifier *ident, CPPScope *current_scope,
const CPPFile &file) :
CPPType(file),
@ -30,7 +43,7 @@ CPPExtensionType(CPPExtensionType::Type type,
////////////////////////////////////////////////////////////////////
// Function: CPPExtensionType::get_simple_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPExtensionType::
get_simple_name() const {
@ -43,7 +56,7 @@ get_simple_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPExtensionType::get_local_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPExtensionType::
get_local_name(CPPScope *scope) const {
@ -56,7 +69,7 @@ get_local_name(CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPExtensionType::get_fully_scoped_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPExtensionType::
get_fully_scoped_name() const {
@ -96,7 +109,7 @@ is_tbd() const {
////////////////////////////////////////////////////////////////////
// Function: CPPExtensionType::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPExtensionType::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -108,7 +121,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPExtensionType *rep = new CPPExtensionType(*this);
if (_ident != NULL) {
rep->_ident =
rep->_ident =
_ident->substitute_decl(subst, current_scope, global_scope);
}
@ -147,7 +160,7 @@ is_equivalent(const CPPType &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPExtensionType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPExtensionType::
output(ostream &out, int, CPPScope *scope, bool) const {
@ -170,7 +183,7 @@ output(ostream &out, int, CPPScope *scope, bool) const {
////////////////////////////////////////////////////////////////////
// Function: CPPExtensionType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPExtensionType::
get_subtype() const {
@ -180,7 +193,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPExtensionType::as_extension_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExtensionType *CPPExtensionType::
as_extension_type() {

View File

@ -2,6 +2,19 @@
// Created by: drose (21Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPEXTENSIONTYPE_H
#define CPPEXTENSIONTYPE_H

View File

@ -1,6 +1,19 @@
// Filename: cppFile.C
// Filename: cppFile.cxx
// Created by: drose (11Nov99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -11,7 +24,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPFile::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFile::
CPPFile(const Filename &filename, const Filename &filename_as_referenced,
@ -27,12 +40,12 @@ CPPFile(const Filename &filename, const Filename &filename_as_referenced,
////////////////////////////////////////////////////////////////////
// Function: CPPFile::Copy Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFile::
CPPFile(const CPPFile &copy) :
_filename(copy._filename),
_filename_as_referenced(copy._filename_as_referenced),
_filename(copy._filename),
_filename_as_referenced(copy._filename_as_referenced),
_source(copy._source)
{
}
@ -40,7 +53,7 @@ CPPFile(const CPPFile &copy) :
////////////////////////////////////////////////////////////////////
// Function: CPPFile::Copy Assignment Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPFile::
operator = (const CPPFile &copy) {
@ -52,7 +65,7 @@ operator = (const CPPFile &copy) {
////////////////////////////////////////////////////////////////////
// Function: CPPFile::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFile::
~CPPFile() {
@ -83,13 +96,13 @@ bool CPPFile::
is_c_or_i_file(const Filename &filename) {
string extension = filename.get_extension();
// downcase the extension.
for (string::iterator ei = extension.begin();
for (string::iterator ei = extension.begin();
ei != extension.end();
++ei) {
(*ei) = tolower(*ei);
}
return (extension == "c" || extension == "cc" ||
return (extension == "c" || extension == "cc" ||
extension == "cpp" || extension == "c++" || extension == "cxx" ||
extension == "i" || extension == "t");
}
@ -119,13 +132,13 @@ bool CPPFile::
is_c_file(const Filename &filename) {
string extension = filename.get_extension();
// downcase the extension.
for (string::iterator ei = extension.begin();
for (string::iterator ei = extension.begin();
ei != extension.end();
++ei) {
(*ei) = tolower(*ei);
}
return (extension == "c" || extension == "cc" ||
return (extension == "c" || extension == "cc" ||
extension == "cpp" || extension == "c++" || extension == "cxx");
}
@ -148,7 +161,7 @@ replace_nearer(const CPPFile &other) {
////////////////////////////////////////////////////////////////////
// Function: CPPFile::Ordering Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPFile::
operator < (const CPPFile &other) const {
@ -158,7 +171,7 @@ operator < (const CPPFile &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPFile::Equality Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPFile::
operator == (const CPPFile &other) const {
@ -168,7 +181,7 @@ operator == (const CPPFile &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPFile::Inequality Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPFile::
operator != (const CPPFile &other) const {
@ -178,7 +191,7 @@ operator != (const CPPFile &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPFile::c_str
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
const char *CPPFile::
c_str() const {
@ -188,7 +201,7 @@ c_str() const {
////////////////////////////////////////////////////////////////////
// Function: CPPFile::empty
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPFile::
empty() const {

View File

@ -2,6 +2,19 @@
// Created by: drose (11Nov99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPFILE_H
#define CPPFILE_H
@ -25,8 +38,8 @@ public:
S_none, // File is internally generated
};
CPPFile(const Filename &filename = "",
const Filename &filename_as_referenced = "",
CPPFile(const Filename &filename = "",
const Filename &filename_as_referenced = "",
Source source = S_none);
CPPFile(const CPPFile &copy);
void operator = (const CPPFile &copy);

View File

@ -1,6 +1,19 @@
// Filename: cppFunctionGroup.C
// Filename: cppFunctionGroup.cxx
// Created by: drose (11Nov99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -12,7 +25,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionGroup::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFunctionGroup::
CPPFunctionGroup(const string &name) :
@ -24,7 +37,7 @@ CPPFunctionGroup(const string &name) :
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionGroup::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFunctionGroup::
~CPPFunctionGroup() {
@ -60,7 +73,7 @@ get_return_type() const {
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionGroup::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPFunctionGroup::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -80,7 +93,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionGroup::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPFunctionGroup::
get_subtype() const {
@ -90,7 +103,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionGroup::as_function_group
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFunctionGroup *CPPFunctionGroup::
as_function_group() {

View File

@ -2,6 +2,19 @@
// Created by: drose (11Nov99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPFUNCTIONGROUP_H
#define CPPFUNCTIONGROUP_H
@ -41,4 +54,4 @@ public:
#endif

View File

@ -1,6 +1,19 @@
// Filename: cppFunctionType.C
// Filename: cppFunctionType.cxx
// Created by: drose (21Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -12,13 +25,13 @@
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFunctionType::
CPPFunctionType(CPPType *return_type, CPPParameterList *parameters,
int flags) :
CPPType(CPPFile()),
_return_type(return_type),
_return_type(return_type),
_parameters(parameters),
_flags(flags)
{
@ -38,10 +51,10 @@ CPPFunctionType(CPPType *return_type, CPPParameterList *parameters,
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionType::Copy Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFunctionType::
CPPFunctionType(const CPPFunctionType &copy) :
CPPFunctionType(const CPPFunctionType &copy) :
CPPType(copy),
_return_type(copy._return_type),
_parameters(copy._parameters),
@ -53,7 +66,7 @@ CPPFunctionType(const CPPFunctionType &copy) :
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionType::Copy Assignment Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPFunctionType::
operator = (const CPPFunctionType &copy) {
@ -74,7 +87,7 @@ operator = (const CPPFunctionType &copy) {
////////////////////////////////////////////////////////////////////
bool CPPFunctionType::
is_fully_specified() const {
return CPPType::is_fully_specified() &&
return CPPType::is_fully_specified() &&
_return_type->is_fully_specified() &&
_parameters->is_fully_specified();
}
@ -82,7 +95,7 @@ is_fully_specified() const {
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionType::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPFunctionType::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -93,11 +106,11 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
}
CPPFunctionType *rep = new CPPFunctionType(*this);
rep->_return_type =
rep->_return_type =
_return_type->substitute_decl(subst, current_scope, global_scope)
->as_type();
rep->_parameters =
rep->_parameters =
_parameters->substitute_decl(subst, current_scope, global_scope);
if (rep->_return_type == _return_type &&
@ -122,7 +135,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPType *CPPFunctionType::
resolve_type(CPPScope *current_scope, CPPScope *global_scope) {
CPPType *rtype = _return_type->resolve_type(current_scope, global_scope);
CPPParameterList *params =
CPPParameterList *params =
_parameters->resolve_type(current_scope, global_scope);
if (rtype != _return_type || params != _parameters) {
@ -153,7 +166,7 @@ is_tbd() const {
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPFunctionType::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -223,10 +236,10 @@ output_instance(ostream &out, int indent_level, CPPScope *scope,
} else {
if (prename.empty()) {
_return_type->output_instance(out, indent_level, scope, complete,
_return_type->output_instance(out, indent_level, scope, complete,
"", prename + name + str);
} else {
_return_type->output_instance(out, indent_level, scope, complete,
_return_type->output_instance(out, indent_level, scope, complete,
"", "(" + prename + name + ")" + str);
}
}
@ -251,8 +264,8 @@ get_num_default_parameters() const {
const CPPParameterList::Parameters &params = _parameters->_parameters;
CPPParameterList::Parameters::const_reverse_iterator pi;
int count = 0;
for (pi = params.rbegin();
pi != params.rend() && (*pi)->_initializer != (CPPExpression *)NULL;
for (pi = params.rbegin();
pi != params.rend() && (*pi)->_initializer != (CPPExpression *)NULL;
++pi) {
count++;
}
@ -263,7 +276,7 @@ get_num_default_parameters() const {
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPFunctionType::
get_subtype() const {
@ -273,7 +286,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPFunctionType::as_function_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFunctionType *CPPFunctionType::
as_function_type() {

View File

@ -2,6 +2,19 @@
// Created by: drose (21Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPFUNCTIONTYPE_H
#define CPPFUNCTIONTYPE_H

View File

@ -1,6 +1,19 @@
// Filename: cppGlobals.C
// Filename: cppGlobals.cxx
// Created by: drose (16May00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "cppGlobals.h"

View File

@ -1,6 +1,19 @@
// Filename: cppGlobals.h
// Created by: drose (16May00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPGLOBALS_H

View File

@ -1,6 +1,19 @@
// Filename: cppIdentifier.C
// Filename: cppIdentifier.cxx
// Created by: drose (26Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -16,7 +29,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPIdentifier::
CPPIdentifier(const string &name, const CPPFile &file) : _file(file) {
@ -27,7 +40,7 @@ CPPIdentifier(const string &name, const CPPFile &file) : _file(file) {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPIdentifier::
CPPIdentifier(const CPPNameComponent &name) {
@ -38,7 +51,7 @@ CPPIdentifier(const CPPNameComponent &name) {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::add_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPIdentifier::
add_name(const string &name) {
@ -48,7 +61,7 @@ add_name(const string &name) {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::add_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPIdentifier::
add_name(const CPPNameComponent &name) {
@ -58,7 +71,7 @@ add_name(const CPPNameComponent &name) {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::Equivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPIdentifier::
operator == (const CPPIdentifier &other) const {
@ -75,9 +88,9 @@ operator == (const CPPIdentifier &other) const {
}
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::Nonequivalence Operator
// Function: CPPIdentifier::Nonequivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPIdentifier::
operator != (const CPPIdentifier &other) const {
@ -87,7 +100,7 @@ operator != (const CPPIdentifier &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::Ordering Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPIdentifier::
operator < (const CPPIdentifier &other) const {
@ -106,7 +119,7 @@ operator < (const CPPIdentifier &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::is_scoped
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPIdentifier::
is_scoped() const {
@ -117,7 +130,7 @@ is_scoped() const {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::get_simple_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPIdentifier::
get_simple_name() const {
@ -127,7 +140,7 @@ get_simple_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::get_local_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPIdentifier::
get_local_name(CPPScope *scope) const {
@ -143,7 +156,7 @@ get_local_name(CPPScope *scope) const {
// Determine the scope of everything up until but not including the
// last name.
CPPScope *my_scope = get_scope(scope, NULL);
if (my_scope == NULL) {
result = get_fully_scoped_name();
} else if (my_scope == scope) {
@ -162,7 +175,7 @@ get_local_name(CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::get_fully_scoped_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPIdentifier::
get_fully_scoped_name() const {
@ -219,7 +232,7 @@ is_tbd() const {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::get_scope
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPIdentifier::
get_scope(CPPScope *current_scope, CPPScope *global_scope,
@ -263,7 +276,7 @@ get_scope(CPPScope *current_scope, CPPScope *global_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::get_scope
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPIdentifier::
get_scope(CPPScope *current_scope, CPPScope *global_scope,
@ -339,7 +352,7 @@ find_type(CPPScope *current_scope, CPPScope *global_scope,
if (type != NULL) {
if (!type->is_incomplete() || force_instantiate) {
type = type->instantiate(_names.back().get_templ(),
current_scope, global_scope,
current_scope, global_scope,
error_sink)->as_type();
// If we ended up with another template, instantiate later.
@ -380,9 +393,9 @@ find_type(CPPScope *current_scope, CPPScope *global_scope,
if (is_fully_specified()) {
// If our identifier fully specifies the instantiation, then
// apply it.
CPPDeclaration *decl =
CPPDeclaration *decl =
type->instantiate(_names.back().get_templ(),
current_scope, global_scope,
current_scope, global_scope,
error_sink);
assert(decl != NULL);
CPPType *new_type = decl->as_type();
@ -398,7 +411,7 @@ find_type(CPPScope *current_scope, CPPScope *global_scope,
type = CPPType::new_type(new CPPTBDType((CPPIdentifier *)this));
}
// type->_file.replace_nearer(_file);
}
}
return type;
}
@ -406,7 +419,7 @@ find_type(CPPScope *current_scope, CPPScope *global_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::find_symbol
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPIdentifier::
find_symbol(CPPScope *current_scope, CPPScope *global_scope,
@ -428,7 +441,7 @@ find_symbol(CPPScope *current_scope, CPPScope *global_scope,
sym = CPPType::new_type(new CPPTBDType((CPPIdentifier *)this));
} else {
// Instantiate the symbol.
sym = sym->instantiate(_names.back().get_templ(), current_scope,
sym = sym->instantiate(_names.back().get_templ(), current_scope,
global_scope, error_sink);
}
}
@ -440,7 +453,7 @@ find_symbol(CPPScope *current_scope, CPPScope *global_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::find_template
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPIdentifier::
find_template(CPPScope *current_scope, CPPScope *global_scope,
@ -455,7 +468,7 @@ find_template(CPPScope *current_scope, CPPScope *global_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::find_scope
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPIdentifier::
find_scope(CPPScope *current_scope, CPPScope *global_scope,
@ -471,7 +484,7 @@ find_scope(CPPScope *current_scope, CPPScope *global_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::substitute_decl
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPIdentifier *CPPIdentifier::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -500,7 +513,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPIdentifier::
output(ostream &out, CPPScope *scope) const {
@ -515,7 +528,7 @@ output(ostream &out, CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::output_local_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPIdentifier::
output_local_name(ostream &out, CPPScope *scope) const {
@ -529,7 +542,7 @@ output_local_name(ostream &out, CPPScope *scope) const {
// Determine the scope of everything up until but not including the
// last name.
CPPScope *my_scope = get_scope(scope, NULL);
if (my_scope == NULL) {
output_fully_scoped_name(out);
} else {
@ -541,7 +554,7 @@ output_local_name(ostream &out, CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPIdentifier::output_fully_scoped_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPIdentifier::
output_fully_scoped_name(ostream &out) const {

View File

@ -2,6 +2,19 @@
// Created by: drose (26Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPIDENTIFIER_H
#define CPPIDENTIFIER_H

View File

@ -1,6 +1,19 @@
// Filename: cppInstance.C
// Filename: cppInstance.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -22,7 +35,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstance::
CPPInstance(CPPType *type, const string &name, int storage_class) :
@ -37,7 +50,7 @@ CPPInstance(CPPType *type, const string &name, int storage_class) :
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstance::
CPPInstance(CPPType *type, CPPIdentifier *ident, int storage_class) :
@ -73,7 +86,7 @@ CPPInstance(CPPType *type, CPPInstanceIdentifier *ii, int storage_class,
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::Copy Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstance::
CPPInstance(const CPPInstance &copy) :
@ -89,7 +102,7 @@ CPPInstance(const CPPInstance &copy) :
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstance::
~CPPInstance() {
@ -110,10 +123,10 @@ make_typecast_function(CPPInstance *inst, CPPIdentifier *ident,
CPPParameterList *parameters, int function_flags) {
CPPType *type = CPPType::new_type(inst->_type);
delete inst;
function_flags |= (int)CPPFunctionType::F_operator_typecast;
CPPType *ft =
CPPType *ft =
CPPType::new_type(new CPPFunctionType(type, parameters, function_flags));
return new CPPInstance(ft, ident);
@ -122,7 +135,7 @@ make_typecast_function(CPPInstance *inst, CPPIdentifier *ident,
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::Equivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPInstance::
operator == (const CPPInstance &other) const {
@ -138,7 +151,7 @@ operator == (const CPPInstance &other) const {
// on the identifier.
if ((_ident == NULL && other._ident != NULL) ||
(_ident != NULL && other._ident == NULL) ||
(_ident != NULL && other._ident != NULL && *_ident != *other._ident))
(_ident != NULL && other._ident != NULL && *_ident != *other._ident))
{
return false;
}
@ -147,7 +160,7 @@ operator == (const CPPInstance &other) const {
if ((_initializer == NULL && other._initializer != NULL) ||
(_initializer != NULL && other._initializer == NULL) ||
(_initializer != NULL && other._initializer != NULL &&
*_initializer != *other._initializer))
*_initializer != *other._initializer))
{
return false;
}
@ -158,7 +171,7 @@ operator == (const CPPInstance &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::Nonequivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPInstance::
operator != (const CPPInstance &other) const {
@ -168,7 +181,7 @@ operator != (const CPPInstance &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::Ordering Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPInstance::
operator < (const CPPInstance &other) const {
@ -184,7 +197,7 @@ operator < (const CPPInstance &other) const {
// on the identifier.
if ((_ident == NULL && other._ident != NULL) ||
(_ident != NULL && other._ident == NULL) ||
(_ident != NULL && other._ident != NULL && *_ident != *other._ident))
(_ident != NULL && other._ident != NULL && *_ident != *other._ident))
{
if (_ident == NULL || other._ident == NULL) {
return _ident < other._ident;
@ -196,7 +209,7 @@ operator < (const CPPInstance &other) const {
if ((_initializer == NULL && other._initializer != NULL) ||
(_initializer != NULL && other._initializer == NULL) ||
(_initializer != NULL && other._initializer != NULL &&
*_initializer != *other._initializer))
*_initializer != *other._initializer))
{
if (_initializer == NULL || other._initializer == NULL) {
return _initializer < other._initializer;
@ -234,7 +247,7 @@ set_initializer(CPPExpression *initializer) {
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::is_scoped
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPInstance::
is_scoped() const {
@ -248,7 +261,7 @@ is_scoped() const {
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::get_scope
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPInstance::
get_scope(CPPScope *current_scope, CPPScope *global_scope,
@ -263,7 +276,7 @@ get_scope(CPPScope *current_scope, CPPScope *global_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::get_simple_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPInstance::
get_simple_name() const {
@ -277,7 +290,7 @@ get_simple_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::get_local_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPInstance::
get_local_name(CPPScope *scope) const {
@ -291,7 +304,7 @@ get_local_name(CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::get_fully_scoped_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPInstance::
get_fully_scoped_name() const {
@ -327,7 +340,7 @@ check_for_constructor(CPPScope *current_scope, CPPScope *global_scope) {
(new CPPSimpleType(CPPSimpleType::T_void));
_type = CPPType::new_type
(new CPPFunctionType(void_type, func->_parameters,
(new CPPFunctionType(void_type, func->_parameters,
func->_flags | CPPFunctionType::F_constructor));
} else if (method_name == "~" + class_name) {
@ -335,7 +348,7 @@ check_for_constructor(CPPScope *current_scope, CPPScope *global_scope) {
(new CPPSimpleType(CPPSimpleType::T_void));
_type = CPPType::new_type
(new CPPFunctionType(void_type, func->_parameters,
(new CPPFunctionType(void_type, func->_parameters,
func->_flags | CPPFunctionType::F_destructor));
}
}
@ -345,7 +358,7 @@ check_for_constructor(CPPScope *current_scope, CPPScope *global_scope) {
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::instantiate
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPInstance::
instantiate(const CPPTemplateParameterList *actual_params,
@ -353,7 +366,7 @@ instantiate(const CPPTemplateParameterList *actual_params,
CPPPreprocessor *error_sink) const {
if (!is_template()) {
if (error_sink != NULL) {
error_sink->warning("Ignoring template parameters for instance " +
error_sink->warning("Ignoring template parameters for instance " +
_ident->get_local_name());
}
return (CPPInstance *)this;
@ -374,7 +387,7 @@ instantiate(const CPPTemplateParameterList *actual_params,
actual_params->build_subst_decl(tscope->_parameters, subst,
current_scope, global_scope);
CPPInstance *inst =
CPPInstance *inst =
((CPPInstance *)this)->substitute_decl(subst, current_scope, global_scope)
->as_instance();
if (inst == this) {
@ -419,19 +432,19 @@ is_fully_specified() const {
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPInstance::
substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPScope *current_scope, CPPScope *global_scope) {
CPPDeclaration *top =
CPPDeclaration *top =
CPPDeclaration::substitute_decl(subst, current_scope, global_scope);
if (top != this) {
return top;
}
CPPInstance *rep = new CPPInstance(*this);
CPPDeclaration *new_type =
CPPDeclaration *new_type =
_type->substitute_decl(subst, current_scope, global_scope);
rep->_type = new_type->as_type();
@ -441,7 +454,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
}
if (_initializer != NULL) {
rep->_initializer =
rep->_initializer =
_initializer->substitute_decl(subst, current_scope, global_scope)
->as_expression();
}
@ -459,7 +472,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPInstance::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -534,7 +547,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete,
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPInstance::
get_subtype() const {
@ -544,7 +557,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPInstance::as_instance
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstance *CPPInstance::
as_instance() {

View File

@ -2,6 +2,19 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPINSTANCE_H
#define CPPINSTANCE_H
@ -40,7 +53,7 @@ public:
SC_mutable = 0x200,
// This bit is only set by CPPStructType::check_virtual().
SC_inherited_virtual = 0x400,
SC_inherited_virtual = 0x400,
};
CPPInstance(CPPType *type, const string &name, int storage_class = 0);

View File

@ -1,6 +1,19 @@
// Filename: cppInstanceIdentifier.C
// Filename: cppInstanceIdentifier.cxx
// Created by: drose (21Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -16,7 +29,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPInstanceIdentifier::Modifier::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstanceIdentifier::Modifier::
Modifier(CPPInstanceIdentifierType type) :
@ -31,7 +44,7 @@ Modifier(CPPInstanceIdentifierType type) :
////////////////////////////////////////////////////////////////////
// Function: CPPInstanceIdentifier::Modifier::named func_type constructor
// Access: Public, Static
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstanceIdentifier::Modifier CPPInstanceIdentifier::Modifier::
func_type(CPPParameterList *params, int flags) {
@ -44,7 +57,7 @@ func_type(CPPParameterList *params, int flags) {
////////////////////////////////////////////////////////////////////
// Function: CPPInstanceIdentifier::Modifier::named array_type constructor
// Access: Public, Static
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstanceIdentifier::Modifier CPPInstanceIdentifier::Modifier::
array_type(CPPExpression *expr) {
@ -56,7 +69,7 @@ array_type(CPPExpression *expr) {
////////////////////////////////////////////////////////////////////
// Function: CPPInstanceIdentifier::Modifier::named scoped_pointer_type
// Access: Public, Static
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstanceIdentifier::Modifier CPPInstanceIdentifier::Modifier::
scoped_pointer_type(CPPIdentifier *scoping) {
@ -68,7 +81,7 @@ scoped_pointer_type(CPPIdentifier *scoping) {
////////////////////////////////////////////////////////////////////
// Function: CPPInstanceIdentifier::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPInstanceIdentifier::
CPPInstanceIdentifier(CPPIdentifier *ident) : _ident(ident) {
@ -93,7 +106,7 @@ unroll_type(CPPType *start_type) {
////////////////////////////////////////////////////////////////////
// Function: CPPInstanceIdentifier::add_modifier
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPInstanceIdentifier::
add_modifier(CPPInstanceIdentifierType type) {
@ -103,7 +116,7 @@ add_modifier(CPPInstanceIdentifierType type) {
////////////////////////////////////////////////////////////////////
// Function: CPPInstanceIdentifier::add_modifier
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPInstanceIdentifier::
add_func_modifier(CPPParameterList *params, int flags) {
@ -118,7 +131,7 @@ add_scoped_pointer_modifier(CPPIdentifier *scoping) {
////////////////////////////////////////////////////////////////////
// Function: CPPInstanceIdentifier::add_modifier
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPInstanceIdentifier::
add_array_modifier(CPPExpression *expr) {
@ -128,7 +141,7 @@ add_array_modifier(CPPExpression *expr) {
////////////////////////////////////////////////////////////////////
// Function: CPPInstanceIdentifier::get_scope
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPInstanceIdentifier::
get_scope(CPPScope *current_scope, CPPScope *global_scope,

View File

@ -2,6 +2,19 @@
// Created by: drose (21Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPINSTANCEIDENTIFIER_H
#define CPPINSTANCEIDENTIFIER_H
@ -51,7 +64,7 @@ public:
CPPScope *get_scope(CPPScope *current_scope, CPPScope *global_scope,
CPPPreprocessor *error_sink = NULL) const;
CPPIdentifier *_ident;
class Modifier {

View File

@ -1,6 +1,19 @@
// Filename: cppManifest.C
// Filename: cppManifest.cxx
// Created by: drose (22Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -12,7 +25,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPManifest::ExpansionNode::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPManifest::ExpansionNode::
ExpansionNode(int parm_number) :
@ -23,7 +36,7 @@ ExpansionNode(int parm_number) :
////////////////////////////////////////////////////////////////////
// Function: CPPManifest::ExpansionNode::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPManifest::ExpansionNode::
ExpansionNode(const string &str) :
@ -34,7 +47,7 @@ ExpansionNode(const string &str) :
////////////////////////////////////////////////////////////////////
// Function: CPPManifest::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPManifest::
CPPManifest(const string &args, const CPPFile &file) : _file(file) {
@ -52,7 +65,7 @@ CPPManifest(const string &args, const CPPFile &file) : _file(file) {
}
_name = args.substr(0, p);
vector_string parameter_names;
if (args[p] == '(') {
@ -78,7 +91,7 @@ CPPManifest(const string &args, const CPPFile &file) : _file(file) {
////////////////////////////////////////////////////////////////////
// Function: CPPManifest::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPManifest::
~CPPManifest() {
@ -92,7 +105,7 @@ CPPManifest::
////////////////////////////////////////////////////////////////////
// Function: CPPManifest::expand
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPManifest::
expand(const vector_string &args) const {
@ -133,7 +146,7 @@ determine_type() const {
////////////////////////////////////////////////////////////////////
// Function: CPPManifest::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPManifest::
output(ostream &out) const {
@ -168,10 +181,10 @@ output(ostream &out) const {
////////////////////////////////////////////////////////////////////
// Function: CPPManifest::parse_parameters
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPManifest::
parse_parameters(const string &args, size_t &p,
parse_parameters(const string &args, size_t &p,
vector_string &parameter_names) {
assert(p < args.size());
assert(args[p] == '(');
@ -184,7 +197,7 @@ parse_parameters(const string &args, size_t &p,
while (p < args.size() && args[p] != ')') {
// Here's the beginning of a parm.
size_t q = p;
while (p < args.size() && !isspace(args[p]) &&
while (p < args.size() && !isspace(args[p]) &&
args[p] != ')' && args[p] != ',') {
p++;
}
@ -208,7 +221,7 @@ parse_parameters(const string &args, size_t &p,
////////////////////////////////////////////////////////////////////
// Function: CPPManifest::save_expansion
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPManifest::
save_expansion(const string &exp, const vector_string &parameter_names) {
@ -240,7 +253,7 @@ save_expansion(const string &exp, const vector_string &parameter_names) {
pnum = i;
}
}
if (pnum != -1) {
// Yep!
if (last != q) {

View File

@ -2,6 +2,19 @@
// Created by: drose (22Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPMANIFEST_H
#define CPPMANIFEST_H

View File

@ -1,6 +1,19 @@
// Filename: cppNameComponent.C
// Filename: cppNameComponent.cxx
// Created by: drose (12Nov99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -10,11 +23,11 @@
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPNameComponent::
CPPNameComponent(const string &name) :
_name(name)
_name(name)
{
_templ = (CPPTemplateParameterList *)NULL;
}
@ -22,7 +35,7 @@ CPPNameComponent(const string &name) :
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::Equivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPNameComponent::
operator == (const CPPNameComponent &other) const {
@ -45,7 +58,7 @@ operator == (const CPPNameComponent &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::Nonequivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPNameComponent::
operator != (const CPPNameComponent &other) const {
@ -55,7 +68,7 @@ operator != (const CPPNameComponent &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::Ordering Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPNameComponent::
operator < (const CPPNameComponent &other) const {
@ -74,7 +87,7 @@ operator < (const CPPNameComponent &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPNameComponent::
get_name() const {
@ -84,7 +97,7 @@ get_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::get_name_with_templ
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPNameComponent::
get_name_with_templ(CPPScope *scope) const {
@ -101,7 +114,7 @@ get_name_with_templ(CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::get_templ
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTemplateParameterList *CPPNameComponent::
get_templ() const {
@ -111,7 +124,7 @@ get_templ() const {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::empty
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPNameComponent::
empty() const {
@ -121,7 +134,7 @@ empty() const {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::has_templ
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPNameComponent::
has_templ() const {
@ -146,7 +159,7 @@ is_tbd() const {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::set_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPNameComponent::
set_name(const string &name) {
@ -156,7 +169,7 @@ set_name(const string &name) {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::append_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPNameComponent::
append_name(const string &name) {
@ -166,7 +179,7 @@ append_name(const string &name) {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::set_templ
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPNameComponent::
set_templ(CPPTemplateParameterList *templ) {
@ -176,7 +189,7 @@ set_templ(CPPTemplateParameterList *templ) {
////////////////////////////////////////////////////////////////////
// Function: CPPNameComponent::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPNameComponent::
output(ostream &out) const {

View File

@ -2,6 +2,19 @@
// Created by: drose (12Nov99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPNAMECOMPONENT_H
#define CPPNAMECOMPONENT_H

View File

@ -1,6 +1,19 @@
// Filename: cppNamespace.C
// Filename: cppNamespace.cxx
// Created by: drose (16Nov99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -12,7 +25,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPNamespace::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPNamespace::
CPPNamespace(CPPIdentifier *ident, CPPScope *scope, const CPPFile &file) :
@ -24,7 +37,7 @@ CPPNamespace(CPPIdentifier *ident, CPPScope *scope, const CPPFile &file) :
////////////////////////////////////////////////////////////////////
// Function: CPPNamespace::get_simple_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPNamespace::
get_simple_name() const {
@ -37,7 +50,7 @@ get_simple_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPNamespace::get_local_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPNamespace::
get_local_name(CPPScope *scope) const {
@ -50,7 +63,7 @@ get_local_name(CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPNamespace::get_fully_scoped_name
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPNamespace::
get_fully_scoped_name() const {
@ -63,7 +76,7 @@ get_fully_scoped_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPNamespace::get_scope
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPNamespace::
get_scope() const {
@ -73,7 +86,7 @@ get_scope() const {
////////////////////////////////////////////////////////////////////
// Function: CPPNamespace::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPNamespace::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -96,7 +109,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
////////////////////////////////////////////////////////////////////
// Function: CPPNamespace::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPNamespace::
get_subtype() const {
@ -106,7 +119,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPNamespace::as_namespace
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPNamespace *CPPNamespace::
as_namespace() {

View File

@ -2,6 +2,19 @@
// Created by: drose (16Nov99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPNAMESPACE_H
#define CPPNAMESPACE_H

View File

@ -1,15 +1,19 @@
// Filename: cppParameterList.C
// Filename: cppParameterList.cxx
// Created by: drose (21Oct99)
//
//
////////////////////////////////////////////////////////////////////
// Copyright (C) 1992,93,94,95,96,97 Walt Disney Imagineering, Inc.
//
// These coded instructions, statements, data structures and
// computer programs contain unpublished proprietary information of
// Walt Disney Imagineering and are protected by Federal copyright
// law. They may not be disclosed to third parties or copied or
// duplicated in any form, in whole or in part, without the prior
// written consent of Walt Disney Imagineering Inc.
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -19,7 +23,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPParameterList::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPParameterList::
CPPParameterList() {
@ -53,7 +57,7 @@ is_equivalent(const CPPParameterList &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPParameterList::Equality Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPParameterList::
operator == (const CPPParameterList &other) const {
@ -74,7 +78,7 @@ operator == (const CPPParameterList &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPParameterList::Inequality Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPParameterList::
operator != (const CPPParameterList &other) const {
@ -84,7 +88,7 @@ operator != (const CPPParameterList &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPParameterList::Ordering Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPParameterList::
operator < (const CPPParameterList &other) const {
@ -140,7 +144,7 @@ is_fully_specified() const {
////////////////////////////////////////////////////////////////////
// Function: CPPParameterList::substitute_decl
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPParameterList *CPPParameterList::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -148,7 +152,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPParameterList *rep = new CPPParameterList;
bool any_changed = false;
for (int i = 0; i < (int)_parameters.size(); i++) {
CPPInstance *inst =
CPPInstance *inst =
_parameters[i]->substitute_decl(subst, current_scope, global_scope)
->as_instance();
if (inst != _parameters[i]) {

View File

@ -2,6 +2,19 @@
// Created by: drose (21Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPPARAMETERLIST_H
#define CPPPARAMETERLIST_H

View File

@ -1,6 +1,19 @@
// Filename: cppParser.C
// Filename: cppParser.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -17,7 +30,7 @@ bool cppparser_output_class_keyword = true;
////////////////////////////////////////////////////////////////////
// Function: CPPParser::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPParser::
CPPParser() : CPPScope((CPPScope *)NULL, CPPNameComponent(""), V_public) {
@ -41,7 +54,7 @@ is_fully_specified() const {
////////////////////////////////////////////////////////////////////
// Function: CPPParser::parse_file
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPParser::
parse_file(const string &filename) {
@ -53,7 +66,7 @@ parse_file(const string &filename) {
return get_error_count() == 0;
}
////////////////////////////////////////////////////////////////////
// Function: CPPParser::parse_expr
// Access: Public
@ -65,7 +78,7 @@ CPPExpression *CPPParser::
parse_expr(const string &expr) {
return CPPPreprocessor::parse_expr(expr, this, this);
}
////////////////////////////////////////////////////////////////////
// Function: CPPParser::parse_type
// Access: Public

View File

@ -2,6 +2,19 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPPARSER_H
#define CPPPARSER_H
@ -42,4 +55,4 @@ extern bool cppparser_output_class_keyword;
#endif

View File

@ -1,6 +1,19 @@
// Filename: cppPointerType.C
// Filename: cppPointerType.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -11,7 +24,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPPointerType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPPointerType::
CPPPointerType(CPPType *pointing_at) :
@ -30,14 +43,14 @@ CPPPointerType(CPPType *pointing_at) :
////////////////////////////////////////////////////////////////////
bool CPPPointerType::
is_fully_specified() const {
return CPPType::is_fully_specified() &&
return CPPType::is_fully_specified() &&
_pointing_at->is_fully_specified();
}
////////////////////////////////////////////////////////////////////
// Function: CPPPointerType::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPPointerType::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -48,7 +61,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
}
CPPPointerType *rep = new CPPPointerType(*this);
rep->_pointing_at =
rep->_pointing_at =
_pointing_at->substitute_decl(subst, current_scope, global_scope)
->as_type();
@ -116,13 +129,13 @@ is_equivalent(const CPPType &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPPointerType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPointerType::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
_pointing_at->output(out, indent_level, scope, complete);
CPPFunctionType *ftype = _pointing_at->as_function_type();
if (ftype != NULL &&
if (ftype != NULL &&
((ftype->_flags & CPPFunctionType::F_method_pointer) != 0)) {
// We have to output pointers-to-method with a scoping before the
// '*'.
@ -147,21 +160,21 @@ output_instance(ostream &out, int indent_level, CPPScope *scope,
string star = "*";
CPPFunctionType *ftype = _pointing_at->as_function_type();
if (ftype != NULL &&
if (ftype != NULL &&
((ftype->_flags & CPPFunctionType::F_method_pointer) != 0)) {
// We have to output pointers-to-method with a scoping before the
// '*'.
star = ftype->_class_owner->get_fully_scoped_name() + "::*";
}
_pointing_at->output_instance(out, indent_level, scope, complete,
_pointing_at->output_instance(out, indent_level, scope, complete,
star + prename, name);
}
////////////////////////////////////////////////////////////////////
// Function: CPPPointerType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPPointerType::
get_subtype() const {
@ -171,7 +184,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPPointerType::as_pointer_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPPointerType *CPPPointerType::
as_pointer_type() {

View File

@ -2,14 +2,18 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
// Copyright (C) 1992,93,94,95,96,97 Walt Disney Imagineering, Inc.
//
// These coded instructions, statements, data structures and
// computer programs contain unpublished proprietary information of
// Walt Disney Imagineering and are protected by Federal copyright
// law. They may not be disclosed to third parties or copied or
// duplicated in any form, in whole or in part, without the prior
// written consent of Walt Disney Imagineering Inc.
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPPOINTERTYPE_H

View File

@ -1,6 +1,19 @@
// Filename: cppPreprocessor.C
// Filename: cppPreprocessor.cxx
// Created by: drose (22Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -66,7 +79,7 @@ trim_blanks(const string &str) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::InputFile::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPPreprocessor::InputFile::
InputFile() {
@ -80,7 +93,7 @@ InputFile() {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::InputFile::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPPreprocessor::InputFile::
~InputFile() {
@ -92,7 +105,7 @@ CPPPreprocessor::InputFile::
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::InputFile::open
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPPreprocessor::InputFile::
open(const CPPFile &file) {
@ -101,19 +114,19 @@ open(const CPPFile &file) {
_file = file;
ifstream *in = new ifstream;
_in = in;
return _file._filename.open_read(*in);
}
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::InputFile::connect_input
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPPreprocessor::InputFile::
connect_input(const string &input) {
assert(_in == NULL);
_input = input;
_in = new istringstream(_input);
return !_in->fail();
@ -122,13 +135,13 @@ connect_input(const string &input) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::InputFile::get
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::InputFile::
get() {
assert(_in != NULL);
int c = _in->get();
// Quietly skip over embedded carriage-return characters. We
// shouldn't see any of these unless there was some DOS-to-Unix file
// conversion problem.
@ -146,7 +159,7 @@ get() {
_col_number = 1;
}
break;
default:
if (!_lock_position) {
_col_number++;
@ -159,7 +172,7 @@ get() {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPPreprocessor::
CPPPreprocessor() {
@ -207,7 +220,7 @@ get_verbose() const {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::copy_filepos
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
copy_filepos(const CPPPreprocessor &other) {
@ -220,7 +233,7 @@ copy_filepos(const CPPPreprocessor &other) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_file
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFile CPPPreprocessor::
get_file() const {
@ -233,7 +246,7 @@ get_file() const {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_line_number
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
get_line_number() const {
@ -246,7 +259,7 @@ get_line_number() const {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_col_number
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
get_col_number() const {
@ -259,7 +272,7 @@ get_col_number() const {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_next_token
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPToken CPPPreprocessor::
get_next_token() {
@ -379,7 +392,7 @@ get_next_token0() {
return token;
}
_saved_tokens.push_back(token);
return CPPToken(SCOPING, first_line, first_col, first_file,
return CPPToken(SCOPING, first_line, first_col, first_file,
name, result);
}
@ -394,7 +407,7 @@ get_next_token0() {
// indentifier wants template instantiation, assume the angle
// bracket begins the instantiation and call yacc recursively to
// parse the template parameters.
CPPDeclaration *decl =
CPPDeclaration *decl =
ident->find_template(current_scope, global_scope);
if (decl != NULL) {
ident->_names.back().set_templ
@ -409,12 +422,12 @@ get_next_token0() {
int token_type = IDENTIFIER;
CPPDeclaration *decl = ident->find_symbol(current_scope, global_scope);
if (decl != NULL &&
if (decl != NULL &&
(decl->as_typedef() != NULL || decl->as_type() != NULL)) {
token_type = TYPENAME_IDENTIFIER;
}
return CPPToken(token_type, first_line, first_col, first_file,
return CPPToken(token_type, first_line, first_col, first_file,
name, result);
}
@ -425,7 +438,7 @@ get_next_token0() {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::warning
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
warning(const string &message, int line, int col, CPPFile file) {
@ -447,7 +460,7 @@ warning(const string &message, int line, int col, CPPFile file) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::error
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
error(const string &message, int line, int col, CPPFile file) {
@ -475,7 +488,7 @@ error(const string &message, int line, int col, CPPFile file) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_warning_count
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
get_warning_count() const {
@ -485,7 +498,7 @@ get_warning_count() const {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_error_count
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
get_error_count() const {
@ -532,7 +545,7 @@ get_comment_before(int line, CPPFile file) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::init_cpp
// Access: Protected
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPPreprocessor::
init_cpp(const CPPFile &file) {
@ -546,7 +559,7 @@ init_cpp(const CPPFile &file) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::init_const_expr
// Access: Protected
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPPreprocessor::
init_const_expr(const string &expr) {
@ -559,7 +572,7 @@ init_const_expr(const string &expr) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::init_type
// Access: Protected
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPPreprocessor::
init_type(const string &type) {
@ -572,7 +585,7 @@ init_type(const string &type) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::push_file
// Access: Protected
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPPreprocessor::
push_file(const CPPFile &file) {
@ -581,7 +594,7 @@ push_file(const CPPFile &file) {
#endif
_files.push_back(InputFile());
InputFile &infile = _files.back();
if (infile.open(file)) {
// Record the fact that we opened the file for the benefit of user
// code.
@ -602,12 +615,12 @@ push_file(const CPPFile &file) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::push_string
// Access: Protected
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPPreprocessor::
push_string(const string &input, bool lock_position) {
#ifdef CPP_VERBOSE_LEX
cerr << "Pushing to string \"" << input
cerr << "Pushing to string \"" << input
<< "\"\nlock_position = " << lock_position << "\n";
#endif
CPPFile first_file = get_file();
@ -616,8 +629,8 @@ push_string(const string &input, bool lock_position) {
_files.push_back(InputFile());
InputFile &infile = _files.back();
if (infile.connect_input(input)) {
if (infile.connect_input(input)) {
if (lock_position) {
infile._file = first_file;
infile._line_number = first_line;
@ -637,7 +650,7 @@ push_string(const string &input, bool lock_position) {
_files.pop_back();
return false;
}
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::parse_expr
// Access: Protected
@ -650,7 +663,7 @@ push_string(const string &input, bool lock_position) {
// of this function defined for CPPParser.
////////////////////////////////////////////////////////////////////
CPPExpression *CPPPreprocessor::
parse_expr(const string &input_expr, CPPScope *current_scope,
parse_expr(const string &input_expr, CPPScope *current_scope,
CPPScope *global_scope) {
// Get a copy of the expression string we can modify.
string expr = input_expr;
@ -710,7 +723,7 @@ parse_expr(const string &input_expr, CPPScope *current_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::internal_get_next_token
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPToken CPPPreprocessor::
internal_get_next_token() {
@ -889,7 +902,7 @@ internal_get_next_token() {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::skip_whitespace
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
skip_whitespace(int c) {
@ -915,7 +928,7 @@ skip_whitespace(int c) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::skip_comment
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
skip_comment(int c) {
@ -941,14 +954,14 @@ skip_comment(int c) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::skip_c_comment
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
skip_c_comment(int c) {
if (_save_comments) {
CPPCommentBlock *comment = new CPPCommentBlock;
_comments.push_back(comment);
comment->_file = get_file();
comment->_line_number = get_line_number();
comment->_last_line = get_line_number();
@ -970,16 +983,16 @@ skip_c_comment(int c) {
c = get();
}
}
warning("Comment is unterminated",
comment->_line_number, comment->_col_number,
warning("Comment is unterminated",
comment->_line_number, comment->_col_number,
comment->_file);
} else {
CPPFile first_file = get_file();
int first_line_number = get_line_number();
int first_col_number = get_col_number() - 2;
while (c != EOF) {
if (c == '*') {
c = get();
@ -990,19 +1003,19 @@ skip_c_comment(int c) {
c = get();
}
}
warning("Comment is unterminated",
first_line_number, first_col_number,
warning("Comment is unterminated",
first_line_number, first_col_number,
first_file);
}
return c;
}
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::skip_cpp_comment
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
skip_cpp_comment(int c) {
@ -1021,7 +1034,7 @@ skip_cpp_comment(int c) {
} else {
// Otherwise, this begins a new comment block.
comment = new CPPCommentBlock;
comment->_file = get_file();
comment->_line_number = get_line_number();
comment->_last_line = get_line_number();
@ -1031,12 +1044,12 @@ skip_cpp_comment(int c) {
_comments.push_back(comment);
}
while (c != EOF && c != '\n') {
comment->_comment += c;
c = get();
}
comment->_comment += '\n';
comment->_last_line = get_line_number();
@ -1054,7 +1067,7 @@ skip_cpp_comment(int c) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::process_directive
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
process_directive(int c) {
@ -1107,7 +1120,7 @@ process_directive(int c) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_preprocessor_command
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
get_preprocessor_command(int c, string &command) {
@ -1133,7 +1146,7 @@ get_preprocessor_command(int c, string &command) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_preprocessor_args
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
get_preprocessor_args(int c, string &args) {
@ -1168,10 +1181,10 @@ get_preprocessor_args(int c, string &args) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::handle_define_directive
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
handle_define_directive(const string &args, int first_line,
handle_define_directive(const string &args, int first_line,
int first_col, const CPPFile &first_file) {
if (args.empty()) {
warning("Ignoring empty #define directive",
@ -1192,10 +1205,10 @@ handle_define_directive(const string &args, int first_line,
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::handle_undef_directive
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
handle_undef_directive(const string &args, int first_line,
handle_undef_directive(const string &args, int first_line,
int first_col, const CPPFile &first_file) {
if (args.empty()) {
warning("Ignoring empty #undef directive",
@ -1211,7 +1224,7 @@ handle_undef_directive(const string &args, int first_line,
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::handle_ifdef_directive
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
handle_ifdef_directive(const string &args, int, int, const CPPFile &) {
@ -1220,15 +1233,15 @@ handle_ifdef_directive(const string &args, int, int, const CPPFile &) {
// The macro is defined. We continue.
return;
}
// The macro is undefined. Skip stuff.
skip_false_if_block(true);
}
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::handle_ifndef_directive
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
handle_ifndef_directive(const string &args, int, int, const CPPFile &) {
@ -1237,19 +1250,19 @@ handle_ifndef_directive(const string &args, int, int, const CPPFile &) {
// The macro is undefined. We continue.
return;
}
// The macro is defined. Skip stuff.
skip_false_if_block(true);
}
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::handle_if_directive
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
handle_if_directive(const string &args, int first_line,
handle_if_directive(const string &args, int first_line,
int first_col, const CPPFile &first_file) {
CPPExpression *expr = parse_expr(args, global_scope, global_scope);
@ -1272,7 +1285,7 @@ handle_if_directive(const string &args, int first_line,
// The expression result is true. We continue.
return;
}
// The expression result is false. Skip stuff.
skip_false_if_block(true);
}
@ -1280,16 +1293,16 @@ handle_if_directive(const string &args, int first_line,
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::handle_include_directive
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
handle_include_directive(const string &args, int first_line,
handle_include_directive(const string &args, int first_line,
int first_col, const CPPFile &first_file) {
bool okflag = false;
Filename filename;
Filename filename_as_referenced;
bool angle_quotes = false;
if (!args.empty()) {
if (args[0] == '"' && args[args.size() - 1] == '"') {
filename = args.substr(1, args.size() - 2);
@ -1321,14 +1334,14 @@ handle_include_directive(const string &args, int first_line,
// Now look for the filename. If we didn't use angle quotes, look
// first in the current directory.
bool found_file = false;
CPPFile::Source source = CPPFile::S_none;
CPPFile::Source source = CPPFile::S_none;
if (okflag) {
if (!angle_quotes) {
found_file = filename.exists();
source = CPPFile::S_local;
}
// Now look for it on the include path.
if (!found_file && filename.resolve_filename(_system_include_path)) {
found_file = true;
@ -1339,7 +1352,7 @@ handle_include_directive(const string &args, int first_line,
found_file = true;
source = CPPFile::S_alternate;
}
if (!found_file) {
warning("Cannot find " + filename.get_fullpath(),
first_line, first_col, first_file);
@ -1355,14 +1368,14 @@ handle_include_directive(const string &args, int first_line,
first_line, first_col, first_file);
}
}
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::handle_error_directive
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
handle_error_directive(const string &args, int first_line,
handle_error_directive(const string &args, int first_line,
int first_col, const CPPFile &first_file) {
error(args, first_line, first_col, first_file);
}
@ -1427,7 +1440,7 @@ skip_false_if_block(bool consider_elifs) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_quoted_char
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPToken CPPPreprocessor::
get_quoted_char(int c) {
@ -1448,7 +1461,7 @@ get_quoted_char(int c) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_quoted_string
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPToken CPPPreprocessor::
get_quoted_string(int c) {
@ -1462,7 +1475,7 @@ get_quoted_string(int c) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_identifier
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPToken CPPPreprocessor::
get_identifier(int c) {
@ -1470,7 +1483,7 @@ get_identifier(int c) {
int first_line = get_line_number();
int first_col = get_col_number();
string name(1, (char)c);
c = get();
while (c != EOF && (isalnum(c) || c == '_')) {
name += c;
@ -1512,12 +1525,12 @@ get_identifier(int c) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::expand_manifest
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPToken CPPPreprocessor::
expand_manifest(const CPPManifest *manifest) {
vector_string args;
if (manifest->_has_parameters) {
// Hmm, we're expecting arguments.
extract_manifest_args(manifest->_name, manifest->_num_parameters, args);
@ -1542,10 +1555,10 @@ expand_manifest(const CPPManifest *manifest) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::extract_manifest_args
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
extract_manifest_args(const string &name, int num_args,
extract_manifest_args(const string &name, int num_args,
vector_string &args) {
CPPFile first_file = get_file();
int first_line = get_line_number();
@ -1610,7 +1623,7 @@ extract_manifest_args(const string &name, int num_args,
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::expand_defined_function
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
expand_defined_function(string &expr, size_t q, size_t &p) {
@ -1637,7 +1650,7 @@ expand_defined_function(string &expr, size_t q, size_t &p) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::expand_manifest_inline
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
expand_manifest_inline(string &expr, size_t q, size_t &p,
@ -1656,10 +1669,10 @@ expand_manifest_inline(string &expr, size_t q, size_t &p,
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::extract_manifest_args_inline
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
extract_manifest_args_inline(const string &name, int num_args,
extract_manifest_args_inline(const string &name, int num_args,
vector_string &args,
const string &expr, size_t &p) {
// Skip whitespace till paren.
@ -1711,14 +1724,14 @@ extract_manifest_args_inline(const string &name, int num_args,
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get_number
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPToken CPPPreprocessor::
get_number(int c, int c2) {
CPPFile first_file = get_file();
int first_line = get_line_number();
int first_col = get_col_number();
string num(1, (char)c);
bool leading_zero = (c == '0');
bool decimal_point = (c == '.');
@ -1820,7 +1833,7 @@ get_number(int c, int c2) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::check_keyword
// Access: Private, Static
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
check_keyword(const string &name) {
@ -1828,14 +1841,14 @@ check_keyword(const string &name) {
if (name == "bool") return KW_BOOL;
if (name == "catch") return KW_CATCH;
if (name == "char") return KW_CHAR;
if (name == "class") return KW_CLASS;
if (name == "const") return KW_CONST;
if (name == "class") return KW_CLASS;
if (name == "const") return KW_CONST;
if (name == "delete") return KW_DELETE;
if (name == "double") return KW_DOUBLE;
if (name == "dynamic_cast") return KW_DYNAMIC_CAST;
if (name == "else") return KW_ELSE;
if (name == "__end_publish") return KW_END_PUBLISH;
if (name == "enum") return KW_ENUM;
if (name == "enum") return KW_ENUM;
if (name == "extern") return KW_EXTERN;
if (name == "explicit") return KW_EXPLICIT;
if (name == "__published") return KW_PUBLISHED;
@ -1862,16 +1875,16 @@ check_keyword(const string &name) {
if (name == "sizeof") return KW_SIZEOF;
if (name == "static") return KW_STATIC;
if (name == "static_cast") return KW_STATIC_CAST;
if (name == "struct") return KW_STRUCT;
if (name == "struct") return KW_STRUCT;
if (name == "template") return KW_TEMPLATE;
if (name == "throw") return KW_THROW;
if (name == "true") return KW_TRUE;
if (name == "try") return KW_TRY;
if (name == "typedef") return KW_TYPEDEF;
if (name == "typedef") return KW_TYPEDEF;
if (name == "typename") return KW_TYPENAME;
if (name == "union") return KW_UNION;
if (name == "union") return KW_UNION;
if (name == "unsigned") return KW_UNSIGNED;
if (name == "using") return KW_USING;
if (name == "using") return KW_USING;
if (name == "virtual") return KW_VIRTUAL;
if (name == "void") return KW_VOID;
if (name == "volatile") return KW_VOLATILE;
@ -1887,7 +1900,7 @@ check_keyword(const string &name) {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::scan_quoted
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPPreprocessor::
scan_quoted(int c) {
@ -2008,7 +2021,7 @@ should_ignore_preprocessor() const {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::get
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
int CPPPreprocessor::
get() {
@ -2023,7 +2036,7 @@ get() {
}
int c = _files.back().get();
while (c == EOF && !_files.empty()) {
#ifdef CPP_VERBOSE_LEX
cerr << "End of input stream, restoring to previous input\n";
@ -2050,7 +2063,7 @@ get() {
////////////////////////////////////////////////////////////////////
// Function: CPPPreprocessor::unget
// Access: Private
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPPreprocessor::
unget(int c) {
@ -2090,7 +2103,7 @@ nested_parse_template_instantiation(CPPTemplateScope *scope) {
}
CPPTemplateParameterList *actual_params = new CPPTemplateParameterList;
for (pi = formal_params._parameters.begin();
pi != formal_params._parameters.end() && !_angle_bracket_found;
++pi) {

View File

@ -2,6 +2,19 @@
// Created by: drose (22Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPPREPROCESSOR_H
#define CPPPREPROCESSOR_H
@ -144,7 +157,7 @@ private:
bool should_ignore_manifest(const CPPManifest *manifest) const;
bool should_ignore_preprocessor() const;
int get();
void unget(int c);

View File

@ -1,6 +1,19 @@
// Filename: cppReferenceType.C
// Filename: cppReferenceType.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -9,7 +22,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPReferenceType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPReferenceType::
CPPReferenceType(CPPType *pointing_at) :
@ -28,14 +41,14 @@ CPPReferenceType(CPPType *pointing_at) :
////////////////////////////////////////////////////////////////////
bool CPPReferenceType::
is_fully_specified() const {
return CPPType::is_fully_specified() &&
return CPPType::is_fully_specified() &&
_pointing_at->is_fully_specified();
}
////////////////////////////////////////////////////////////////////
// Function: CPPReferenceType::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPReferenceType::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -46,7 +59,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
}
CPPReferenceType *rep = new CPPReferenceType(*this);
rep->_pointing_at =
rep->_pointing_at =
_pointing_at->substitute_decl(subst, current_scope, global_scope)
->as_type();
@ -114,7 +127,7 @@ is_equivalent(const CPPType &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPReferenceType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPReferenceType::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -134,14 +147,14 @@ void CPPReferenceType::
output_instance(ostream &out, int indent_level, CPPScope *scope,
bool complete, const string &prename,
const string &name) const {
_pointing_at->output_instance(out, indent_level, scope, complete,
_pointing_at->output_instance(out, indent_level, scope, complete,
"&" + prename, name);
}
////////////////////////////////////////////////////////////////////
// Function: CPPReferenceType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPReferenceType::
get_subtype() const {
@ -151,7 +164,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPReferenceType::as_reference_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPReferenceType *CPPReferenceType::
as_reference_type() {

View File

@ -2,6 +2,19 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPREFERENCETYPE_H
#define CPPREFERENCETYPE_H

View File

@ -1,6 +1,19 @@
// Filename: cppScope.C
// Filename: cppScope.cxx
// Created by: drose (21Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -26,7 +39,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPScope::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope::
CPPScope(CPPScope *parent_scope,
@ -45,7 +58,7 @@ CPPScope(CPPScope *parent_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPScope::Destructor
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope::
~CPPScope() {
@ -89,7 +102,7 @@ get_parent_scope() const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::set_current_vis
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPScope::
set_current_vis(CPPVisibility current_vis) {
@ -99,7 +112,7 @@ set_current_vis(CPPVisibility current_vis) {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::get_current_vis
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPVisibility CPPScope::
get_current_vis() const {
@ -109,7 +122,7 @@ get_current_vis() const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::add_declaration
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPScope::
add_declaration(CPPDeclaration *decl, CPPScope *global_scope,
@ -133,7 +146,7 @@ add_declaration(CPPDeclaration *decl, CPPScope *global_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPScope::add_enum_value
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPScope::
add_enum_value(CPPInstance *inst) {
@ -148,7 +161,7 @@ add_enum_value(CPPInstance *inst) {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::define_extension_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPScope::
define_extension_type(CPPExtensionType *type) {
@ -199,7 +212,7 @@ define_extension_type(CPPExtensionType *type) {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::define_namespace
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPScope::
define_namespace(CPPNamespace *scope) {
@ -211,13 +224,13 @@ define_namespace(CPPNamespace *scope) {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::add_using
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPScope::
add_using(CPPUsing *using_decl, CPPScope *global_scope,
CPPPreprocessor *error_sink) {
if (using_decl->_full_namespace) {
CPPScope *scope =
CPPScope *scope =
using_decl->_ident->find_scope(this, global_scope);
if (scope != NULL) {
_using.insert(scope);
@ -265,8 +278,8 @@ is_fully_specified() const {
}
Declarations::const_iterator di;
for (di = _declarations.begin();
di != _declarations.end() && specified;
for (di = _declarations.begin();
di != _declarations.end() && specified;
++di) {
if (!(*di)->is_fully_specified()) {
specified = false;
@ -283,7 +296,7 @@ is_fully_specified() const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::instantiate
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPScope::
instantiate(const CPPTemplateParameterList *actual_params,
@ -291,10 +304,10 @@ instantiate(const CPPTemplateParameterList *actual_params,
CPPPreprocessor *error_sink) const {
CPPScope *this_scope = (CPPScope *)this;
if (_parent_scope == NULL ||
if (_parent_scope == NULL ||
_parent_scope->as_template_scope() == NULL) {
if (error_sink != NULL) {
error_sink->warning("Ignoring template parameters for scope " +
error_sink->warning("Ignoring template parameters for scope " +
get_local_name());
}
return this_scope;
@ -333,7 +346,7 @@ instantiate(const CPPTemplateParameterList *actual_params,
// scope = new CPPScope(current_scope, name, V_public);
scope = new CPPScope(_parent_scope, name, V_public);
copy_substitute_decl(scope, subst, global_scope);
// Also define any new template parameter types, in case we
// "instantiated" this scope with another template parameter.
CPPTemplateParameterList::Parameters::const_iterator pi;
@ -351,7 +364,7 @@ instantiate(const CPPTemplateParameterList *actual_params,
}
}
}
// Finally, record this particular instantiation for future
// reference, so we don't have to do this again.
((CPPScope *)this)->_instantiations.insert(Instantiations::value_type(actual_params, scope));
@ -362,7 +375,7 @@ instantiate(const CPPTemplateParameterList *actual_params,
////////////////////////////////////////////////////////////////////
// Function: CPPScope::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPScope::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -388,7 +401,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
// scope has template parameters--then we must first remove any of
// the template parameters from the subst list. These will later
// get substituted properly during instantiation.
const CPPTemplateParameterList &p =
const CPPTemplateParameterList &p =
_parent_scope->as_template_scope()->_parameters;
CPPDeclaration::SubstDecl new_subst = subst;
@ -413,7 +426,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPScope::find_type
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPType *CPPScope::
find_type(const string &name, bool recurse) const {
@ -433,8 +446,8 @@ find_type(const string &name, bool recurse) const {
if (_struct_type != NULL) {
CPPStructType::Derivation::const_iterator di;
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
++di) {
CPPStructType *st = (*di)._base->as_struct_type();
if (st != NULL) {
@ -456,7 +469,7 @@ find_type(const string &name, bool recurse) const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::find_type
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPType *CPPScope::
find_type(const string &name, CPPDeclaration::SubstDecl &subst,
@ -479,12 +492,12 @@ find_type(const string &name, CPPDeclaration::SubstDecl &subst,
if (_struct_type != NULL) {
CPPStructType::Derivation::const_iterator di;
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
++di) {
CPPStructType *st = (*di)._base->as_struct_type();
if (st != NULL) {
CPPType *type = st->_scope->find_type(name, subst, global_scope,
CPPType *type = st->_scope->find_type(name, subst, global_scope,
false);
if (type != NULL) {
return type;
@ -503,7 +516,7 @@ find_type(const string &name, CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPScope::find_scope
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPScope::
find_scope(const string &name, bool recurse) const {
@ -521,8 +534,8 @@ find_scope(const string &name, bool recurse) const {
} else if (_struct_type != NULL) {
CPPStructType::Derivation::const_iterator di;
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
++di) {
CPPStructType *st = (*di)._base->as_struct_type();
if (st != NULL) {
@ -556,7 +569,7 @@ find_scope(const string &name, bool recurse) const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::find_scope
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPScope::
find_scope(const string &name, CPPDeclaration::SubstDecl &subst,
@ -575,7 +588,7 @@ find_scope(const string &name, CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPScope::find_symbol
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPScope::
find_symbol(const string &name, bool recurse) const {
@ -616,8 +629,8 @@ find_symbol(const string &name, bool recurse) const {
if (_struct_type != NULL) {
CPPStructType::Derivation::const_iterator di;
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
++di) {
CPPStructType *st = (*di)._base->as_struct_type();
if (st != NULL) {
@ -639,7 +652,7 @@ find_symbol(const string &name, bool recurse) const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::find_template
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPScope::
find_template(const string &name, bool recurse) const {
@ -659,8 +672,8 @@ find_template(const string &name, bool recurse) const {
if (_struct_type != NULL) {
CPPStructType::Derivation::const_iterator di;
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
for (di = _struct_type->_derivation.begin();
di != _struct_type->_derivation.end();
++di) {
CPPStructType *st = (*di)._base->as_struct_type();
if (st != NULL) {
@ -682,7 +695,7 @@ find_template(const string &name, bool recurse) const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::get_simple_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPScope::
get_simple_name() const {
@ -697,7 +710,7 @@ get_simple_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::get_local_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPScope::
get_local_name(CPPScope *scope) const {
@ -708,7 +721,7 @@ get_local_name(CPPScope *scope) const {
*/
if (scope != NULL && _parent_scope != NULL && _parent_scope != scope) {
return _parent_scope->get_local_name(scope) + "::" +
return _parent_scope->get_local_name(scope) + "::" +
_name.get_name_with_templ();
} else {
return _name.get_name_with_templ();
@ -718,7 +731,7 @@ get_local_name(CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::get_fully_scoped_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPScope::
get_fully_scoped_name() const {
@ -729,7 +742,7 @@ get_fully_scoped_name() const {
*/
if (_parent_scope != NULL) {
return _parent_scope->get_fully_scoped_name() + "::" +
return _parent_scope->get_fully_scoped_name() + "::" +
_name.get_name_with_templ();
} else {
return _name.get_name_with_templ();
@ -739,7 +752,7 @@ get_fully_scoped_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPScope::
output(ostream &out, CPPScope *scope) const {
@ -754,7 +767,7 @@ output(ostream &out, CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::write
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPScope::
write(ostream &out, int indent_level, CPPScope *scope) const {
@ -800,7 +813,7 @@ get_template_scope() {
////////////////////////////////////////////////////////////////////
// Function: CPPScope::as_template_scope
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTemplateScope *CPPScope::
as_template_scope() {
@ -830,8 +843,8 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
if (_struct_type->_ident != (CPPIdentifier *)NULL) {
native_scope = _struct_type->_ident->_native_scope;
}
to_scope->_struct_type =
new CPPStructType(_struct_type->_type,
to_scope->_struct_type =
new CPPStructType(_struct_type->_type,
new CPPIdentifier(to_scope->_name),
native_scope, to_scope, _struct_type->_file);
to_scope->_struct_type->_incomplete = false;
@ -842,7 +855,7 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
di != _struct_type->_derivation.end();
++di) {
CPPStructType::Base b = (*di);
b._base =
b._base =
(*di)._base->substitute_decl(subst, to_scope, global_scope)->as_type();
to_scope->_struct_type->_derivation.push_back(b);
if (b._base != (*di)._base) {
@ -850,10 +863,10 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
}
}
}
Declarations::const_iterator di;
for (di = _declarations.begin(); di != _declarations.end(); ++di) {
CPPDeclaration *decl =
CPPDeclaration *decl =
(*di)->substitute_decl(subst, to_scope, global_scope);
to_scope->_declarations.push_back(decl);
if (decl != (*di)) {
@ -865,7 +878,7 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
for (ei = _structs.begin(); ei != _structs.end(); ++ei) {
string name = (*ei).first;
CPPType *source_type = (*ei).second;
CPPDeclaration *decl =
CPPDeclaration *decl =
source_type->substitute_decl(subst, to_scope, global_scope);
assert(decl != NULL);
CPPType *new_type = decl->as_type();
@ -878,7 +891,7 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
for (ei = _classes.begin(); ei != _classes.end(); ++ei) {
string name = (*ei).first;
CPPType *source_type = (*ei).second;
CPPDeclaration *decl =
CPPDeclaration *decl =
source_type->substitute_decl(subst, to_scope, global_scope);
assert(decl != NULL);
CPPType *new_type = decl->as_type();
@ -887,11 +900,11 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
if (new_type != source_type) {
anything_changed = true;
}
}
}
for (ei = _unions.begin(); ei != _unions.end(); ++ei) {
string name = (*ei).first;
CPPType *source_type = (*ei).second;
CPPDeclaration *decl =
CPPDeclaration *decl =
source_type->substitute_decl(subst, to_scope, global_scope);
assert(decl != NULL);
CPPType *new_type = decl->as_type();
@ -904,7 +917,7 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
for (ei = _enums.begin(); ei != _enums.end(); ++ei) {
string name = (*ei).first;
CPPType *source_type = (*ei).second;
CPPDeclaration *decl =
CPPDeclaration *decl =
source_type->substitute_decl(subst, to_scope, global_scope);
assert(decl != NULL);
CPPType *new_type = decl->as_type();
@ -925,10 +938,10 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
}
CPPFunctionGroup::Instances::const_iterator ii;
for (ii = fgroup->_instances.begin();
for (ii = fgroup->_instances.begin();
ii != fgroup->_instances.end();
++ii) {
CPPInstance *inst =
CPPInstance *inst =
(*ii)->substitute_decl(subst, to_scope, global_scope)->as_instance();
to_fgroup->_instances.push_back(inst);
if (inst != (*ii)) {
@ -936,10 +949,10 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
}
}
}
Typedefs::const_iterator ti;
for (ti = _typedefs.begin(); ti != _typedefs.end(); ++ti) {
CPPTypedef *td =
CPPTypedef *td =
(*ti).second->substitute_decl(subst, to_scope, global_scope)->as_typedef();
to_scope->_typedefs.insert(Typedefs::value_type((*ti).first, td));
if (td != (*ti).second) {
@ -948,14 +961,14 @@ copy_substitute_decl(CPPScope *to_scope, CPPDeclaration::SubstDecl &subst,
}
Variables::const_iterator vi;
for (vi = _variables.begin(); vi != _variables.end(); ++vi) {
CPPInstance *inst =
CPPInstance *inst =
(*vi).second->substitute_decl(subst, to_scope, global_scope)->as_instance();
to_scope->_variables.insert(Variables::value_type((*vi).first, inst));
if (inst != (*vi).second) {
anything_changed = true;
}
}
Templates::const_iterator tmi;
for (tmi = _templates.begin(); tmi != _templates.end(); ++tmi) {
CPPDeclaration *decl =
@ -992,7 +1005,7 @@ handle_declaration(CPPDeclaration *decl, CPPScope *global_scope) {
if (!name.empty() && def->get_scope(this, global_scope) == this) {
// Don't add a new template definition if we already had one
// by the same name in another scope.
if (find_template(name) == NULL) {
_templates.insert(Templates::value_type(name, def));
}
@ -1036,7 +1049,7 @@ handle_declaration(CPPDeclaration *decl, CPPScope *global_scope) {
// to the _variables member.
_variables[name] = inst;
}
if (inst->is_template()) {
// Don't add a new template definition if we already had one
// by the same name in another scope.
@ -1047,7 +1060,7 @@ handle_declaration(CPPDeclaration *decl, CPPScope *global_scope) {
/*
if (inst->_type->as_function_type() == NULL ||
(inst->_type->as_function_type()->_flags &
(inst->_type->as_function_type()->_flags &
CPPFunctionType::F_constructor) == 0) {
_templates.insert(Templates::value_type(name, inst));
}

View File

@ -2,6 +2,19 @@
// Created by: drose (21Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPSCOPE_H
#define CPPSCOPE_H
@ -52,7 +65,7 @@ public:
CPPScope *get_parent_scope() const;
virtual void add_declaration(CPPDeclaration *decl, CPPScope *global_scope,
CPPPreprocessor *preprocessor,
CPPPreprocessor *preprocessor,
const cppyyltype &pos);
virtual void add_enum_value(CPPInstance *inst);
virtual void define_extension_type(CPPExtensionType *type);

View File

@ -1,6 +1,19 @@
// Filename: cppSimpleType.C
// Filename: cppSimpleType.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "cppSimpleType.h"
@ -9,7 +22,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPSimpleType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPSimpleType::
CPPSimpleType(CPPSimpleType::Type type, int flags) :
@ -34,7 +47,7 @@ is_tbd() const {
////////////////////////////////////////////////////////////////////
// Function: CPPSimpleType::get_preferred_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPSimpleType::
get_preferred_name() const {
@ -45,7 +58,7 @@ get_preferred_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPSimpleType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPSimpleType::
output(ostream &out, int, CPPScope *, bool) const {
@ -111,7 +124,7 @@ output(ostream &out, int, CPPScope *, bool) const {
////////////////////////////////////////////////////////////////////
// Function: CPPSimpleType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPSimpleType::
get_subtype() const {
@ -121,7 +134,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPSimpleType::as_simple_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPSimpleType *CPPSimpleType::
as_simple_type() {

View File

@ -2,6 +2,19 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPSIMPLETYPE_H
#define CPPSIMPLETYPE_H

View File

@ -1,6 +1,19 @@
// Filename: cppStructType.C
// Filename: cppStructType.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -18,7 +31,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::Base::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPStructType::Base::
output(ostream &out) const {
@ -31,11 +44,11 @@ output(ostream &out) const {
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPStructType::
CPPStructType(CPPStructType::Type type, CPPIdentifier *ident,
CPPScope *current_scope, CPPScope *scope,
CPPStructType(CPPStructType::Type type, CPPIdentifier *ident,
CPPScope *current_scope, CPPScope *scope,
const CPPFile &file) :
CPPExtensionType(type, ident, current_scope, file),
_scope(scope)
@ -47,7 +60,7 @@ CPPStructType(CPPStructType::Type type, CPPIdentifier *ident,
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::Copy Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPStructType::
CPPStructType(const CPPStructType &copy) :
@ -62,7 +75,7 @@ CPPStructType(const CPPStructType &copy) :
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::Copy Assignment Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPStructType::
operator = (const CPPStructType &copy) {
@ -86,7 +99,7 @@ append_derivation(CPPType *base, CPPVisibility vis, bool is_virtual) {
b._base = base;
b._vis = vis;
b._is_virtual = is_virtual;
_derivation.push_back(b);
}
}
@ -94,7 +107,7 @@ append_derivation(CPPType *base, CPPVisibility vis, bool is_virtual) {
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::get_scope
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPScope *CPPStructType::
get_scope() const {
@ -188,10 +201,10 @@ get_destructor() const {
++ii) {
CPPInstance *inst = (*ii);
assert(inst->_type != (CPPType *)NULL);
CPPFunctionType *ftype = inst->_type->as_function_type();
assert(ftype != (CPPFunctionType *)NULL);
if ((ftype->_flags & CPPFunctionType::F_destructor) != 0) {
return inst;
}
@ -205,7 +218,7 @@ get_destructor() const {
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::instantiate
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPStructType::
instantiate(const CPPTemplateParameterList *actual_params,
@ -217,13 +230,13 @@ instantiate(const CPPTemplateParameterList *actual_params,
if (_scope == NULL) {
if (error_sink != NULL) {
error_sink->warning("Ignoring template parameters for class " +
error_sink->warning("Ignoring template parameters for class " +
get_local_name());
}
return (CPPDeclaration *)this;
}
CPPScope *scope =
CPPScope *scope =
_scope->instantiate(actual_params, current_scope, global_scope, error_sink);
if (scope->get_struct_type()->get_scope() != scope) {
@ -251,7 +264,7 @@ instantiate(const CPPTemplateParameterList *actual_params,
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPStructType::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -280,7 +293,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPStructType *rep = new CPPStructType(*this);
if (_ident != NULL) {
rep->_ident =
rep->_ident =
_ident->substitute_decl(subst, current_scope, global_scope);
}
@ -294,7 +307,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
// parameters into our identifier.
CPPScope *pscope = rep->_scope->get_parent_scope();
if (pscope != (CPPScope *)NULL &&
if (pscope != (CPPScope *)NULL &&
pscope->_name.has_templ()) {
// If the struct name didn't have an explicit template
@ -311,11 +324,11 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
}
}
bool unchanged =
bool unchanged =
(rep->_ident == _ident && rep->_scope == _scope);
for (int i = 0; i < (int)_derivation.size(); i++) {
rep->_derivation[i]._base =
rep->_derivation[i]._base =
_derivation[i]._base->substitute_decl(subst, current_scope, global_scope)->as_type();
if (rep->_derivation[i]._base != _derivation[i]._base) {
unchanged = false;
@ -350,7 +363,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPStructType::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -382,7 +395,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
} else {
out << _type;
}
// Show any derivation we may have
if (!_derivation.empty()) {
Derivation::const_iterator di = _derivation.begin();
@ -403,7 +416,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPStructType::
get_subtype() const {
@ -413,7 +426,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPStructType::as_struct_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPStructType *CPPStructType::
as_struct_type() {
@ -466,7 +479,7 @@ get_virtual_funcs(VFunctions &funcs) const {
if (destructor != (CPPInstance *)NULL) {
// It's a match! This destructor is virtual.
funcs.erase(vfi);
destructor->_storage_class |=
destructor->_storage_class |=
(CPPInstance::SC_virtual | CPPInstance::SC_inherited_virtual);
}
@ -501,7 +514,7 @@ get_virtual_funcs(VFunctions &funcs) const {
// *inherited* virtual, which means only that the
// interface is defined in some parent class. Sometimes
// this is useful to know.
new_inst->_storage_class |=
new_inst->_storage_class |=
(CPPInstance::SC_virtual | CPPInstance::SC_inherited_virtual);
}
}
@ -518,7 +531,7 @@ get_virtual_funcs(VFunctions &funcs) const {
CPPFunctionGroup *fgroup = (*fi).second;
CPPFunctionGroup::Instances::const_iterator ii;
for (ii = fgroup->_instances.begin();
ii != fgroup->_instances.end();
ii != fgroup->_instances.end();
++ii) {
CPPInstance *inst = (*ii);
if ((inst->_storage_class & CPPInstance::SC_virtual) != 0) {
@ -566,7 +579,7 @@ is_equal(const CPPDeclaration *other) const {
const CPPStructType *ot = ((CPPDeclaration *)other)->as_struct_type();
assert(ot != NULL);
return this == ot ||
return this == ot ||
(get_fully_scoped_name() == ot->get_fully_scoped_name());
*/
}
@ -589,7 +602,7 @@ is_less(const CPPDeclaration *other) const {
return false;
}
return
return
(get_fully_scoped_name() < ot->get_fully_scoped_name());
*/
}

View File

@ -2,6 +2,19 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPSTRUCTTYPE_H
#define CPPSTRUCTTYPE_H
@ -58,7 +71,7 @@ public:
CPPScope *_scope;
bool _incomplete;
class Base {
public:
void output(ostream &out) const;

View File

@ -1,6 +1,19 @@
// Filename: cppTBDType.C
// Filename: cppTBDType.cxx
// Created by: drose (05Nov99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -12,7 +25,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPTBDType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTBDType::
CPPTBDType(CPPIdentifier *ident) :
@ -91,12 +104,12 @@ get_fully_scoped_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPTBDType::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPTBDType::
substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPScope *current_scope, CPPScope *global_scope) {
CPPDeclaration *top =
CPPDeclaration *top =
CPPDeclaration::substitute_decl(subst, current_scope, global_scope);
if (top != this) {
return top;
@ -138,7 +151,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPTBDType::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTBDType::
output(ostream &out, int, CPPScope *, bool) const {
@ -148,7 +161,7 @@ output(ostream &out, int, CPPScope *, bool) const {
////////////////////////////////////////////////////////////////////
// Function: CPPTBDType::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPTBDType::
get_subtype() const {
@ -158,7 +171,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPTBDType::as_tbd_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTBDType *CPPTBDType::
as_tbd_type() {
@ -176,7 +189,7 @@ bool CPPTBDType::
is_equal(const CPPDeclaration *other) const {
const CPPTBDType *ot = ((CPPDeclaration *)other)->as_tbd_type();
assert(ot != NULL);
return (*_ident) == (*ot->_ident);
}
@ -192,6 +205,6 @@ bool CPPTBDType::
is_less(const CPPDeclaration *other) const {
const CPPTBDType *ot = ((CPPDeclaration *)other)->as_tbd_type();
assert(ot != NULL);
return (*_ident) < (*ot->_ident);
}

View File

@ -2,6 +2,19 @@
// Created by: drose (05Nov99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPTBDTYPE_H
#define CPPTBDTYPE_H

View File

@ -1,6 +1,19 @@
// Filename: cppTemplateParameterList.C
// Filename: cppTemplateParameterList.cxx
// Created by: drose (28Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -12,7 +25,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateParameterList::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTemplateParameterList::
CPPTemplateParameterList() {
@ -21,7 +34,7 @@ CPPTemplateParameterList() {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateParameterList::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPTemplateParameterList::
get_string() const {
@ -49,7 +62,7 @@ build_subst_decl(const CPPTemplateParameterList &formal_params,
++pfi, ++pai) {
CPPDeclaration *formal = *pfi;
CPPDeclaration *actual = *pai;
if (actual->as_type()) {
actual = actual->as_type()->resolve_type(current_scope, global_scope);
}
@ -66,7 +79,7 @@ build_subst_decl(const CPPTemplateParameterList &formal_params,
// A value template parameter. Its default is an expression.
CPPInstance *inst = decl->as_instance();
if (inst->_initializer != NULL) {
CPPDeclaration *decl =
CPPDeclaration *decl =
inst->_initializer->substitute_decl(subst, current_scope,
global_scope);
if (!(*decl == *inst)) {
@ -123,7 +136,7 @@ bool CPPTemplateParameterList::
is_tbd() const {
for (int i = 0; i < (int)_parameters.size(); i++) {
CPPType *type = _parameters[i]->as_type();
if (type != (CPPType *)NULL &&
if (type != (CPPType *)NULL &&
(type->is_tbd() || type->as_class_template_parameter() != NULL)) {
return true;
}
@ -138,7 +151,7 @@ is_tbd() const {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateParameterList::Equivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPTemplateParameterList::
operator == (const CPPTemplateParameterList &other) const {
@ -156,7 +169,7 @@ operator == (const CPPTemplateParameterList &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateParameterList::Nonequivalence Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPTemplateParameterList::
operator != (const CPPTemplateParameterList &other) const {
@ -166,7 +179,7 @@ operator != (const CPPTemplateParameterList &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateParameterList::Ordering Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPTemplateParameterList::
operator < (const CPPTemplateParameterList &other) const {
@ -184,7 +197,7 @@ operator < (const CPPTemplateParameterList &other) const {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateParameterList::substitute_decl
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTemplateParameterList *CPPTemplateParameterList::
substitute_decl(CPPDeclaration::SubstDecl &subst,
@ -193,7 +206,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
bool anything_changed = false;
for (int i = 0; i < (int)rep->_parameters.size(); i++) {
rep->_parameters[i] =
rep->_parameters[i] =
_parameters[i]->substitute_decl(subst, current_scope, global_scope);
if (rep->_parameters[i] != _parameters[i]) {
anything_changed = true;
@ -211,7 +224,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateParameterList::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTemplateParameterList::
output(ostream &out, CPPScope *scope) const {

View File

@ -2,6 +2,19 @@
// Created by: drose (28Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPTEMPLATEPARAMETERLIST_H
#define CPPTEMPLATEPARAMETERLIST_H

View File

@ -1,6 +1,19 @@
// Filename: cppTemplateScope.C
// Filename: cppTemplateScope.cxx
// Created by: drose (28Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -13,7 +26,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTemplateScope::
CPPTemplateScope(CPPScope *parent_scope) :
@ -25,7 +38,7 @@ CPPTemplateScope(CPPScope *parent_scope) :
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::add_declaration
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTemplateScope::
add_declaration(CPPDeclaration *decl, CPPScope *global_scope,
@ -39,7 +52,7 @@ add_declaration(CPPDeclaration *decl, CPPScope *global_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::add_enum_value
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTemplateScope::
add_enum_value(CPPInstance *inst) {
@ -51,7 +64,7 @@ add_enum_value(CPPInstance *inst) {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::define_extension_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTemplateScope::
define_extension_type(CPPExtensionType *type) {
@ -63,7 +76,7 @@ define_extension_type(CPPExtensionType *type) {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::define_namespace
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTemplateScope::
define_namespace(CPPNamespace *scope) {
@ -74,7 +87,7 @@ define_namespace(CPPNamespace *scope) {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::add_using
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTemplateScope::
add_using(CPPUsing *using_decl, CPPScope *global_scope,
@ -86,7 +99,7 @@ add_using(CPPUsing *using_decl, CPPScope *global_scope,
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::add_template_parameter
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTemplateScope::
add_template_parameter(CPPDeclaration *param) {
@ -123,7 +136,7 @@ is_fully_specified() const {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::get_simple_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPTemplateScope::
get_simple_name() const {
@ -134,7 +147,7 @@ get_simple_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::get_local_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPTemplateScope::
get_local_name(CPPScope *scope) const {
@ -145,7 +158,7 @@ get_local_name(CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::get_fully_scoped_name
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
string CPPTemplateScope::
get_fully_scoped_name() const {
@ -156,7 +169,7 @@ get_fully_scoped_name() const {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTemplateScope::
output(ostream &out, CPPScope *scope) const {
@ -169,7 +182,7 @@ output(ostream &out, CPPScope *scope) const {
////////////////////////////////////////////////////////////////////
// Function: CPPTemplateScope::as_template_scope
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTemplateScope *CPPTemplateScope::
as_template_scope() {

View File

@ -2,6 +2,19 @@
// Created by: drose (28Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPTEMPLATESCOPE_H
#define CPPTEMPLATESCOPE_H
@ -23,7 +36,7 @@ public:
CPPTemplateScope(CPPScope *parent_scope);
void add_template_parameter(CPPDeclaration *param);
virtual void add_declaration(CPPDeclaration *decl, CPPScope *global_scope,
CPPPreprocessor *preprocessor,
const cppyyltype &pos);

View File

@ -1,6 +1,19 @@
// Filename: cppToken.C
// Filename: cppToken.cxx
// Created by: drose (22Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -13,13 +26,13 @@
////////////////////////////////////////////////////////////////////
// Function: CPPToken::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPToken::
CPPToken(int token, int line_number, int col_number,
const CPPFile &file, const string &str,
const YYSTYPE &lval) :
_token(token), _lval(lval)
_token(token), _lval(lval)
{
_lval.str = str;
_lloc.timestamp = 0;
@ -34,11 +47,11 @@ CPPToken(int token, int line_number, int col_number,
////////////////////////////////////////////////////////////////////
// Function: CPPToken::Copy Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPToken::
CPPToken(const CPPToken &copy) :
_token(copy._token),
_token(copy._token),
_lloc(copy._lloc)
{
_lval.str = copy._lval.str;
@ -48,7 +61,7 @@ CPPToken(const CPPToken &copy) :
////////////////////////////////////////////////////////////////////
// Function: CPPToken::Copy Assignment Operator
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPToken::
operator = (const CPPToken &copy) {
@ -83,7 +96,7 @@ is_eof() const {
////////////////////////////////////////////////////////////////////
// Function: CPPToken::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPToken::
output(ostream &out) const {

View File

@ -2,6 +2,19 @@
// Created by: drose (22Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPTOKEN_H
#define CPPTOKEN_H

View File

@ -1,6 +1,19 @@
// Filename: cppType.C
// Filename: cppType.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -18,7 +31,7 @@ operator () (CPPType *a, CPPType *b) const {
////////////////////////////////////////////////////////////////////
// Function: CPPType::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPType::
CPPType(const CPPFile &file) :
@ -202,7 +215,7 @@ output_instance(ostream &out, int indent_level, CPPScope *scope,
////////////////////////////////////////////////////////////////////
// Function: CPPType::as_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPType *CPPType::
as_type() {

View File

@ -2,6 +2,19 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPTYPE_H
#define CPPTYPE_H
@ -51,7 +64,7 @@ public:
virtual bool is_incomplete() const;
virtual bool is_equivalent(const CPPType &other) const;
void output_instance(ostream &out, const string &name,
void output_instance(ostream &out, const string &name,
CPPScope *scope) const;
virtual void output_instance(ostream &out, int indent_level,
CPPScope *scope,

View File

@ -1,6 +1,19 @@
// Filename: cppTypeDeclaration.C
// Filename: cppTypeDeclaration.cxx
// Created by: drose (14Aug00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -25,12 +38,12 @@ CPPTypeDeclaration(CPPType *type) :
////////////////////////////////////////////////////////////////////
// Function: CPPTypeDeclaration::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPTypeDeclaration::
substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPScope *current_scope, CPPScope *global_scope) {
CPPDeclaration *decl =
CPPDeclaration *decl =
CPPInstance::substitute_decl(subst, current_scope, global_scope);
assert(decl != NULL);
if (decl->as_type_declaration()) {
@ -43,7 +56,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPTypeDeclaration::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTypeDeclaration::
output(ostream &out, int indent_level, CPPScope *scope, bool) const {
@ -53,7 +66,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeDeclaration::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPTypeDeclaration::
get_subtype() const {
@ -63,7 +76,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeDeclaration::as_type_declaration
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTypeDeclaration *CPPTypeDeclaration::
as_type_declaration() {

View File

@ -1,6 +1,19 @@
// Filename: cppTypeDeclaration.h
// Created by: drose (14Aug00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPTYPEDECLARATION_H

View File

@ -1,6 +1,19 @@
// Filename: cppTypeParser.C
// Filename: cppTypeParser.cxx
// Created by: drose (14Dec99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -10,7 +23,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPTypeParser::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTypeParser::
CPPTypeParser(CPPScope *current_scope, CPPScope *global_scope) :
@ -23,7 +36,7 @@ CPPTypeParser(CPPScope *current_scope, CPPScope *global_scope) :
////////////////////////////////////////////////////////////////////
// Function: CPPTypeParser::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTypeParser::
~CPPTypeParser() {
@ -32,7 +45,7 @@ CPPTypeParser::
////////////////////////////////////////////////////////////////////
// Function: CPPTypeParser::parse_type
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPTypeParser::
parse_type(const string &type) {
@ -49,7 +62,7 @@ parse_type(const string &type) {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeParser::parse_type
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
bool CPPTypeParser::
parse_type(const string &type, const CPPPreprocessor &filepos) {
@ -68,7 +81,7 @@ parse_type(const string &type, const CPPPreprocessor &filepos) {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeParser::output
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTypeParser::
output(ostream &out) const {

View File

@ -2,6 +2,19 @@
// Created by: drose (14Dec99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPTYPEPARSER_H
#define CPPTYPEPARSER_H
@ -40,4 +53,4 @@ operator << (ostream &out, const CPPTypeParser &ep) {
#endif

View File

@ -1,6 +1,19 @@
// Filename: cppTypeProxy.C
// Filename: cppTypeProxy.cxx
// Created by: drose (07Dec99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -10,7 +23,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTypeProxy::
CPPTypeProxy() :
@ -183,7 +196,7 @@ output_instance(ostream &out, int indent_level, CPPScope *scope,
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTypeProxy::
output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
@ -198,7 +211,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool complete) const {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPTypeProxy::
get_subtype() const {
@ -208,7 +221,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPType *CPPTypeProxy::
as_type() {
@ -221,7 +234,7 @@ as_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_simple_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPSimpleType *CPPTypeProxy::
as_simple_type() {
@ -234,7 +247,7 @@ as_simple_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_pointer_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPPointerType *CPPTypeProxy::
as_pointer_type() {
@ -247,7 +260,7 @@ as_pointer_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_reference_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPReferenceType *CPPTypeProxy::
as_reference_type() {
@ -260,7 +273,7 @@ as_reference_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_array_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPArrayType *CPPTypeProxy::
as_array_type() {
@ -273,7 +286,7 @@ as_array_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_const_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPConstType *CPPTypeProxy::
as_const_type() {
@ -286,7 +299,7 @@ as_const_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_function_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPFunctionType *CPPTypeProxy::
as_function_type() {
@ -299,7 +312,7 @@ as_function_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_extension_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPExtensionType *CPPTypeProxy::
as_extension_type() {
@ -312,7 +325,7 @@ as_extension_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_struct_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPStructType *CPPTypeProxy::
as_struct_type() {
@ -325,7 +338,7 @@ as_struct_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_enum_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPEnumType *CPPTypeProxy::
as_enum_type() {
@ -338,7 +351,7 @@ as_enum_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_tbd_type
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTBDType *CPPTypeProxy::
as_tbd_type() {
@ -351,7 +364,7 @@ as_tbd_type() {
////////////////////////////////////////////////////////////////////
// Function: CPPTypeProxy::as_type_proxy
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTypeProxy *CPPTypeProxy::
as_type_proxy() {

View File

@ -2,6 +2,19 @@
// Created by: drose (07Dec99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPTYPEPROXY_H
#define CPPTYPEPROXY_H

View File

@ -1,6 +1,19 @@
// Filename: cppTypedef.C
// Filename: cppTypedef.cxx
// Created by: drose (19Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -19,7 +32,7 @@
// typedef.
////////////////////////////////////////////////////////////////////
CPPTypedef::
CPPTypedef(CPPInstance *inst, bool global) : CPPInstance(*inst)
CPPTypedef(CPPInstance *inst, bool global) : CPPInstance(*inst)
{
// Actually, we'll avoid deleting this for now. It causes problems
// for some reason to be determined later.
@ -35,12 +48,12 @@ CPPTypedef(CPPInstance *inst, bool global) : CPPInstance(*inst)
////////////////////////////////////////////////////////////////////
// Function: CPPTypedef::substitute_decl
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration *CPPTypedef::
substitute_decl(CPPDeclaration::SubstDecl &subst,
CPPScope *current_scope, CPPScope *global_scope) {
CPPDeclaration *decl =
CPPDeclaration *decl =
CPPInstance::substitute_decl(subst, current_scope, global_scope);
assert(decl != NULL);
if (decl->as_typedef()) {
@ -53,7 +66,7 @@ substitute_decl(CPPDeclaration::SubstDecl &subst,
////////////////////////////////////////////////////////////////////
// Function: CPPTypedef::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPTypedef::
output(ostream &out, int indent_level, CPPScope *scope, bool) const {
@ -64,7 +77,7 @@ output(ostream &out, int indent_level, CPPScope *scope, bool) const {
////////////////////////////////////////////////////////////////////
// Function: CPPTypedef::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPTypedef::
get_subtype() const {
@ -74,7 +87,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPTypedef::as_typedef
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPTypedef *CPPTypedef::
as_typedef() {

View File

@ -2,6 +2,19 @@
// Created by: drose (19Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPTYPEDEF_H
#define CPPTYPEDEF_H

View File

@ -1,6 +1,19 @@
// Filename: cppUsing.C
// Filename: cppUsing.cxx
// Created by: drose (16Nov99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -10,7 +23,7 @@
////////////////////////////////////////////////////////////////////
// Function: CPPUsing::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPUsing::
CPPUsing(CPPIdentifier *ident, bool full_namespace, const CPPFile &file) :
@ -22,7 +35,7 @@ CPPUsing(CPPIdentifier *ident, bool full_namespace, const CPPFile &file) :
////////////////////////////////////////////////////////////////////
// Function: CPPUsing::output
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
void CPPUsing::
output(ostream &out, int, CPPScope *, bool) const {
@ -36,7 +49,7 @@ output(ostream &out, int, CPPScope *, bool) const {
////////////////////////////////////////////////////////////////////
// Function: CPPUsing::get_subtype
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPDeclaration::SubType CPPUsing::
get_subtype() const {
@ -46,7 +59,7 @@ get_subtype() const {
////////////////////////////////////////////////////////////////////
// Function: CPPUsing::as_using
// Access: Public, Virtual
// Description:
// Description:
////////////////////////////////////////////////////////////////////
CPPUsing *CPPUsing::
as_using() {

View File

@ -2,6 +2,19 @@
// Created by: drose (16Nov99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPUSING_H
#define CPPUSING_H

View File

@ -1,6 +1,19 @@
// Filename: cppVisibility.C
// Filename: cppVisibility.cxx
// Created by: drose (22Oct99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
@ -17,10 +30,10 @@ operator << (ostream &out, CPPVisibility vis) {
case V_protected:
return out << "protected";
case V_private:
return out << "private";
case V_unknown:
return out << "unknown";
}

View File

@ -2,6 +2,19 @@
// Created by: drose (22Oct99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CPPVISIBILITY_H
#define CPPVISIBILITY_H

View File

@ -1,6 +1,19 @@
// Filename: indent.C
// Filename: indent.cxx
// Created by: drose (16Jan99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////

View File

@ -2,6 +2,19 @@
// Created by: drose (16Jan99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef INDENT_H
#define INDENT_H
@ -21,4 +34,4 @@ indent(ostream &out, int indent_level);
#endif

View File

@ -1,6 +1,19 @@
// Filename: configTable.I
// Created by: drose (15May00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////

View File

@ -1,6 +1,19 @@
// Filename: configTable.C
// Filename: configTable.cxx
// Created by: drose (15May00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "dconfig.h"
@ -116,7 +129,7 @@ void ConfigTable::ReadConfigFile(void) {
// this is currently done in makefile.config.so...
// CSN.
#ifndef CONFIG_PATH
#define CONFIG_PATH "."
#endif
@ -144,7 +157,7 @@ void ConfigTable::ReadConfigFile(void) {
if (microconfig_cat->is_spam())
microconfig_cat->spam() << "evaluated value of configpath '"
<< configpath << "'" << endl;
DSearchPath config_search(configpath);
DSearchPath::Results config_files;

View File

@ -1,6 +1,19 @@
// Filename: configTable.h
// Created by: drose (15May00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CONFIGTABLE_H

View File

@ -1,6 +1,19 @@
// Filename: config_dconfig.C
// Filename: config_dconfig.cxx
// Created by: drose (15May00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "config_dconfig.h"

View File

@ -1,6 +1,19 @@
// Filename: config_dconfig.h
// Created by: drose (15May00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CONFIG_DCONFIG_H

View File

@ -1,6 +1,19 @@
// Filename: config_notify.C
// Filename: config_notify.cxx
// Created by: drose (29Feb00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "config_notify.h"

View File

@ -1,6 +1,19 @@
// Filename: config_notify.h
// Created by: drose (29Feb00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef CONFIG_NOTIFY_H

View File

@ -1,7 +1,20 @@
// Filename: config_setup.h
// Created by: cary (20Mar00)
//
///////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef __CONFIG_SETUP_H__
#define __CONFIG_SETUP_H__

View File

@ -1,7 +1,20 @@
// Filename: config.I
// Filename: dconfig.I
// Created by: cary (20Mar00)
//
///////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
INLINE double get_total_time_config_init() {

View File

@ -1,6 +1,19 @@
// Filename: dconfig.C
// Filename: dconfig.cxx
// Created by: drose (08Feb99)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "dconfig.h"

View File

@ -1,7 +1,20 @@
// Filename: dconfig.h
// Created by: cary (14Jul98)
//
///////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef DCONFIG_H
#define DCONFIG_H

View File

@ -2,6 +2,19 @@
// Created by: cary (20Mar00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
INLINE bool Base_Expander::isEnv(ConfigString S) {
return (getenv(S.c_str()) != (TYPENAME ConfigString::value_type *)0L);

View File

@ -2,6 +2,19 @@
// Created by: cary (26Aug98)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef __EXPAND_H__
#define __EXPAND_H__

View File

@ -1,5 +1,18 @@
// Filename: notify.I
// Created by: drose (28Feb00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////

View File

@ -1,6 +1,19 @@
// Filename: notify.C
// Filename: notify.cxx
// Created by: drose (28Feb00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "notify.h"
@ -18,7 +31,7 @@ Notify *Notify::_global_ptr = (Notify *)NULL;
////////////////////////////////////////////////////////////////////
// Function: Notify::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
Notify::
Notify() {
@ -33,7 +46,7 @@ Notify() {
////////////////////////////////////////////////////////////////////
// Function: Notify::Destructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
Notify::
~Notify() {
@ -252,7 +265,7 @@ get_category(const string &basename, NotifyCategory *parent_category) {
}
}
NotifyCategory *category =
NotifyCategory *category =
new NotifyCategory(fullname, basename, parent_category);
_categories.insert(Categories::value_type(fullname, category));
return category;
@ -380,7 +393,7 @@ bool Notify::
assert_failure(const char *expression, int line,
const char *source_file) {
ostringstream message_str;
message_str
message_str
<< expression << " at line " << line << " of " << source_file;
string message = message_str.str();
@ -421,7 +434,7 @@ string_severity(const string &str) {
// comparison.
string lstring;
for (string::const_iterator si = str.begin();
si != str.end();
si != str.end();
++si) {
lstring += tolower(*si);
}

View File

@ -1,6 +1,19 @@
// Filename: notify.h
// Created by: drose (28Feb00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef NOTIFY_H
@ -39,7 +52,7 @@ PUBLISHED:
typedef bool AssertHandler(const char *expression, int line,
const char *source_file);
void set_assert_handler(AssertHandler *assert_handler);
void clear_assert_handler();
bool has_assert_handler() const;
@ -50,9 +63,9 @@ PUBLISHED:
void clear_assert_failed();
NotifyCategory *get_top_category();
NotifyCategory *get_category(const string &basename,
NotifyCategory *get_category(const string &basename,
NotifyCategory *parent_category);
NotifyCategory *get_category(const string &basename,
NotifyCategory *get_category(const string &basename,
const string &parent_fullname);
NotifyCategory *get_category(const string &fullname);
@ -119,7 +132,7 @@ private:
#ifdef NDEBUG
#define nassertr(condition, return_value)
#define nassertr(condition, return_value)
#define nassertv(condition)
#define nassertd(condition) if (false)
// We trust the compiler to optimize the above out.

View File

@ -1,13 +1,26 @@
// Filename: notifyCategory.I
// Created by: drose (29Feb00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: NotifyCategory::get_fullname
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
INLINE string NotifyCategory::
get_fullname() const {
@ -17,7 +30,7 @@ get_fullname() const {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategory::get_basename
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
INLINE string NotifyCategory::
get_basename() const {
@ -27,7 +40,7 @@ get_basename() const {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategory::get_severity
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
INLINE NotifySeverity NotifyCategory::
get_severity() const {

View File

@ -1,6 +1,19 @@
// Filename: notifyCategory.C
// Filename: notifyCategory.cxx
// Created by: drose (29Feb00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#include "notifyCategory.h"
@ -12,13 +25,13 @@
////////////////////////////////////////////////////////////////////
// Function: NotifyCategory::Constructor
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
NotifyCategory::
NotifyCategory(const string &fullname, const string &basename,
NotifyCategory *parent) :
_fullname(fullname),
_basename(basename),
NotifyCategory(const string &fullname, const string &basename,
NotifyCategory *parent) :
_fullname(fullname),
_basename(basename),
_parent(parent)
{
if (_parent != (NotifyCategory *)NULL) {
@ -47,7 +60,7 @@ NotifyCategory(const string &fullname, const string &basename,
// The user specified a particular severity for this category at
// config time. Use it.
_severity = Notify::string_severity(severity_name);
if (_severity == NS_unspecified) {
nout << "Invalid severity name for " << config_name << ": "
<< severity_name << "\n";

View File

@ -1,6 +1,19 @@
// Filename: notifyCategory.h
// Created by: drose (29Feb00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef NOTIFYCATEGORY_H
@ -24,15 +37,15 @@
////////////////////////////////////////////////////////////////////
class EXPCL_DTOOLCONFIG NotifyCategory {
private:
NotifyCategory(const string &fullname, const string &basename,
NotifyCategory(const string &fullname, const string &basename,
NotifyCategory *parent);
PUBLISHED:
INLINE string get_fullname() const;
INLINE string get_basename() const;
INLINE NotifySeverity get_severity() const;
INLINE void set_severity(NotifySeverity severity);
INLINE bool is_on(NotifySeverity severity) const;
// When NOTIFY_DEBUG is not defined, the categories will never be
@ -52,7 +65,7 @@ PUBLISHED:
INLINE bool is_warning() const;
INLINE bool is_error() const;
INLINE bool is_fatal() const;
ostream &out(NotifySeverity severity, bool prefix = true) const;
INLINE ostream &spam(bool prefix = true) const;
INLINE ostream &debug(bool prefix = true) const;
@ -60,10 +73,10 @@ PUBLISHED:
INLINE ostream &warning(bool prefix = true) const;
INLINE ostream &error(bool prefix = true) const;
INLINE ostream &fatal(bool prefix = true) const;
int get_num_children() const;
NotifyCategory *get_child(int i) const;
private:
string _fullname;
string _basename;
@ -71,7 +84,7 @@ private:
NotifySeverity _severity;
typedef vector<NotifyCategory *> Children;
Children _children;
friend class Notify;
};

View File

@ -1,6 +1,19 @@
// Filename: notifyCategoryProxy.I
// Created by: drose (04Mar00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
@ -55,7 +68,7 @@ get_safe_ptr() {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::is_on
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE bool NotifyCategoryProxy<GetCategory>::
@ -66,7 +79,7 @@ is_on(NotifySeverity severity) {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::is_spam
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE bool NotifyCategoryProxy<GetCategory>::
@ -81,7 +94,7 @@ is_spam() {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::is_debug
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE bool NotifyCategoryProxy<GetCategory>::
@ -96,7 +109,7 @@ is_debug() {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::is_info
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE bool NotifyCategoryProxy<GetCategory>::
@ -107,7 +120,7 @@ is_info() {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::is_warning
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE bool NotifyCategoryProxy<GetCategory>::
@ -118,7 +131,7 @@ is_warning() {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::is_error
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE bool NotifyCategoryProxy<GetCategory>::
@ -129,7 +142,7 @@ is_error() {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::is_fatal
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE bool NotifyCategoryProxy<GetCategory>::
@ -140,7 +153,7 @@ is_fatal() {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::out
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE ostream &NotifyCategoryProxy<GetCategory>::
@ -151,7 +164,7 @@ out(NotifySeverity severity, bool prefix) {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::spam
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE ostream &NotifyCategoryProxy<GetCategory>::
@ -162,7 +175,7 @@ spam(bool prefix) {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::debug
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE ostream &NotifyCategoryProxy<GetCategory>::
@ -173,7 +186,7 @@ debug(bool prefix) {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::info
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE ostream &NotifyCategoryProxy<GetCategory>::
@ -184,7 +197,7 @@ info(bool prefix) {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::warning
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE ostream &NotifyCategoryProxy<GetCategory>::
@ -195,7 +208,7 @@ warning(bool prefix) {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::error
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE ostream &NotifyCategoryProxy<GetCategory>::
@ -206,7 +219,7 @@ error(bool prefix) {
////////////////////////////////////////////////////////////////////
// Function: NotifyCategoryProxy::fatal
// Access: Public
// Description:
// Description:
////////////////////////////////////////////////////////////////////
template<class GetCategory>
INLINE ostream &NotifyCategoryProxy<GetCategory>::

View File

@ -1,6 +1,19 @@
// Filename: notifyCategoryProxy.h
// Created by: drose (04Mar00)
//
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://www.panda3d.org/license.txt .
//
// To contact the maintainers of this program write to
// panda3d@yahoogroups.com .
//
////////////////////////////////////////////////////////////////////
#ifndef NOTIFYCATEGORYPROXY_H
@ -78,7 +91,7 @@ public:
INLINE bool is_warning();
INLINE bool is_error();
INLINE bool is_fatal();
INLINE ostream &out(NotifySeverity severity, bool prefix = true);
INLINE ostream &spam(bool prefix = true);
INLINE ostream &debug(bool prefix = true);

Some files were not shown because too many files have changed in this diff Show More