2010-10-12 08:46:24 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2002-03-08 07:45:36 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 09:14:41 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2002-03-08 07:45:36 -06:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2002-03-08 07:45:36 -06:00
|
|
|
*
|
2008-04-10 09:14:41 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2002-03-08 07:45:36 -06:00
|
|
|
*
|
2008-04-10 09:14:41 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2002-03-08 07:45:36 -06:00
|
|
|
*
|
2008-04-10 09:14:41 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2002-03-08 07:45:36 -06:00
|
|
|
*
|
2008-04-10 09:14:41 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2002-03-08 07:45:36 -06:00
|
|
|
*
|
2008-04-10 09:14:41 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2002-03-08 07:45:36 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#include <precomp.h>
|
|
|
|
#include <all_toks.hxx>
|
|
|
|
|
|
|
|
|
|
|
|
// NOT FULLY DEFINED SERVICES
|
|
|
|
#include <cpp/ctokdeal.hxx>
|
2002-05-14 03:02:21 -05:00
|
|
|
#include "c_dealer.hxx"
|
2002-03-08 07:45:36 -06:00
|
|
|
#include "tokintpr.hxx"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace cpp {
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
Token::DealOut( ::TokenDealer & o_rDealer )
|
|
|
|
{
|
2007-11-02 10:49:59 -05:00
|
|
|
// KORR_FUTURE HACK (casting to derivation cpp::TokenDealer)
|
2002-05-07 12:32:25 -05:00
|
|
|
o_rDealer.AsDistributor()->Deal_CppCode(*this);
|
2002-03-08 07:45:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#define DEF_TOKEN_CLASS(name) \
|
|
|
|
void \
|
|
|
|
Tok_##name::Trigger( TokenInterpreter & io_rInterpreter ) const \
|
|
|
|
{ io_rInterpreter.Hdl_##name(*this); } \
|
|
|
|
INT16 \
|
|
|
|
Tok_##name::TypeId() const { return Tid_##name; } \
|
|
|
|
const char * \
|
|
|
|
Tok_##name::Text() const { return #name; }
|
|
|
|
|
|
|
|
#define DEF_TOKEN_CLASS_WITHTEXT(name, text ) \
|
|
|
|
void \
|
|
|
|
Tok_##name::Trigger( TokenInterpreter & io_rInterpreter ) const \
|
|
|
|
{ io_rInterpreter.Hdl_##name(*this); } \
|
|
|
|
INT16 \
|
|
|
|
Tok_##name::TypeId() const { return Tid_##name; } \
|
|
|
|
const char * \
|
|
|
|
Tok_##name::Text() const { return text; }
|
|
|
|
|
|
|
|
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Identifier,sText)
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Operator,sText)
|
|
|
|
|
|
|
|
DEF_TOKEN_CLASS(operator)
|
|
|
|
DEF_TOKEN_CLASS(class)
|
|
|
|
DEF_TOKEN_CLASS(struct)
|
|
|
|
DEF_TOKEN_CLASS(union)
|
|
|
|
DEF_TOKEN_CLASS(enum)
|
|
|
|
DEF_TOKEN_CLASS(typedef)
|
|
|
|
DEF_TOKEN_CLASS(public)
|
|
|
|
DEF_TOKEN_CLASS(protected)
|
|
|
|
DEF_TOKEN_CLASS(private)
|
|
|
|
DEF_TOKEN_CLASS(template)
|
|
|
|
DEF_TOKEN_CLASS(virtual)
|
|
|
|
DEF_TOKEN_CLASS(friend)
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Tilde,"~")
|
|
|
|
DEF_TOKEN_CLASS(const)
|
|
|
|
DEF_TOKEN_CLASS(volatile)
|
|
|
|
DEF_TOKEN_CLASS(extern)
|
|
|
|
DEF_TOKEN_CLASS(static)
|
|
|
|
DEF_TOKEN_CLASS(mutable)
|
|
|
|
DEF_TOKEN_CLASS(register)
|
|
|
|
DEF_TOKEN_CLASS(inline)
|
|
|
|
DEF_TOKEN_CLASS(explicit)
|
|
|
|
DEF_TOKEN_CLASS(namespace)
|
|
|
|
DEF_TOKEN_CLASS(using)
|
|
|
|
DEF_TOKEN_CLASS(throw)
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(SwBracket_Left,"{")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(SwBracket_Right,"}")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(ArrayBracket_Left,"[")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(ArrayBracket_Right,"]")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Bracket_Left,"(")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Bracket_Right,")")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(DoubleColon,"::")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Semicolon,";")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Comma,",")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Colon,":")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Assign,"=")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Less,"<")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Greater,">")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Asterix,"*")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(AmpersAnd,"&")
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Ellipse,"...")
|
2005-01-27 04:21:09 -06:00
|
|
|
DEF_TOKEN_CLASS(typename)
|
2002-03-08 07:45:36 -06:00
|
|
|
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(DefineName,sText)
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(MacroName,sText)
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(MacroParameter,sText)
|
|
|
|
// DEF_TOKEN_CLASS_WITHTEXT(PreProDefinition,sText)
|
|
|
|
|
|
|
|
void
|
|
|
|
Tok_PreProDefinition::Trigger( TokenInterpreter & io_rInterpreter ) const
|
|
|
|
{ io_rInterpreter.Hdl_PreProDefinition(*this); }
|
|
|
|
|
|
|
|
INT16
|
|
|
|
Tok_PreProDefinition::TypeId() const { return Tid_PreProDefinition; }
|
|
|
|
|
|
|
|
const char *
|
|
|
|
Tok_PreProDefinition::Text() const
|
|
|
|
{
|
|
|
|
return sText;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(BuiltInType,sText)
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(TypeSpecializer,sText)
|
|
|
|
DEF_TOKEN_CLASS_WITHTEXT(Constant,sText)
|
|
|
|
|
|
|
|
const char *
|
|
|
|
Tok_UnblockMacro::Text() const
|
|
|
|
{
|
|
|
|
return sMacroName;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Tok_UnblockMacro::DealOut( ::TokenDealer & o_rDealer )
|
|
|
|
{
|
2007-11-02 10:49:59 -05:00
|
|
|
// KORR_FUTURE HACK (casting to derivation cpp::TokenDealer)
|
2002-05-07 12:32:25 -05:00
|
|
|
o_rDealer.AsDistributor()->Deal_Cpp_UnblockMacro(*this);
|
2002-03-08 07:45:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace cpp
|
2010-10-12 08:46:24 -05:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|