merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / parser / cpp / all_toks.cxx
blob6af3a30fdde9a9af55372f5463c9a7cae9d6eedf
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: all_toks.cxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <precomp.h>
32 #include <all_toks.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <cpp/ctokdeal.hxx>
37 #include "c_dealer.hxx"
38 #include "tokintpr.hxx"
42 namespace cpp {
45 void
46 Token::DealOut( ::TokenDealer & o_rDealer )
48 // KORR_FUTURE HACK (casting to derivation cpp::TokenDealer)
49 o_rDealer.AsDistributor()->Deal_CppCode(*this);
53 #define DEF_TOKEN_CLASS(name) \
54 void \
55 Tok_##name::Trigger( TokenInterpreter & io_rInterpreter ) const \
56 { io_rInterpreter.Hdl_##name(*this); } \
57 INT16 \
58 Tok_##name::TypeId() const { return Tid_##name; } \
59 const char * \
60 Tok_##name::Text() const { return #name; }
62 #define DEF_TOKEN_CLASS_WITHTEXT(name, text ) \
63 void \
64 Tok_##name::Trigger( TokenInterpreter & io_rInterpreter ) const \
65 { io_rInterpreter.Hdl_##name(*this); } \
66 INT16 \
67 Tok_##name::TypeId() const { return Tid_##name; } \
68 const char * \
69 Tok_##name::Text() const { return text; }
72 DEF_TOKEN_CLASS_WITHTEXT(Identifier,sText)
73 DEF_TOKEN_CLASS_WITHTEXT(Operator,sText)
75 DEF_TOKEN_CLASS(operator)
76 DEF_TOKEN_CLASS(class)
77 DEF_TOKEN_CLASS(struct)
78 DEF_TOKEN_CLASS(union)
79 DEF_TOKEN_CLASS(enum)
80 DEF_TOKEN_CLASS(typedef)
81 DEF_TOKEN_CLASS(public)
82 DEF_TOKEN_CLASS(protected)
83 DEF_TOKEN_CLASS(private)
84 DEF_TOKEN_CLASS(template)
85 DEF_TOKEN_CLASS(virtual)
86 DEF_TOKEN_CLASS(friend)
87 DEF_TOKEN_CLASS_WITHTEXT(Tilde,"~")
88 DEF_TOKEN_CLASS(const)
89 DEF_TOKEN_CLASS(volatile)
90 DEF_TOKEN_CLASS(extern)
91 DEF_TOKEN_CLASS(static)
92 DEF_TOKEN_CLASS(mutable)
93 DEF_TOKEN_CLASS(register)
94 DEF_TOKEN_CLASS(inline)
95 DEF_TOKEN_CLASS(explicit)
96 DEF_TOKEN_CLASS(namespace)
97 DEF_TOKEN_CLASS(using)
98 DEF_TOKEN_CLASS(throw)
99 DEF_TOKEN_CLASS_WITHTEXT(SwBracket_Left,"{")
100 DEF_TOKEN_CLASS_WITHTEXT(SwBracket_Right,"}")
101 DEF_TOKEN_CLASS_WITHTEXT(ArrayBracket_Left,"[")
102 DEF_TOKEN_CLASS_WITHTEXT(ArrayBracket_Right,"]")
103 DEF_TOKEN_CLASS_WITHTEXT(Bracket_Left,"(")
104 DEF_TOKEN_CLASS_WITHTEXT(Bracket_Right,")")
105 DEF_TOKEN_CLASS_WITHTEXT(DoubleColon,"::")
106 DEF_TOKEN_CLASS_WITHTEXT(Semicolon,";")
107 DEF_TOKEN_CLASS_WITHTEXT(Comma,",")
108 DEF_TOKEN_CLASS_WITHTEXT(Colon,":")
109 DEF_TOKEN_CLASS_WITHTEXT(Assign,"=")
110 DEF_TOKEN_CLASS_WITHTEXT(Less,"<")
111 DEF_TOKEN_CLASS_WITHTEXT(Greater,">")
112 DEF_TOKEN_CLASS_WITHTEXT(Asterix,"*")
113 DEF_TOKEN_CLASS_WITHTEXT(AmpersAnd,"&")
114 DEF_TOKEN_CLASS_WITHTEXT(Ellipse,"...")
115 DEF_TOKEN_CLASS(typename)
117 DEF_TOKEN_CLASS_WITHTEXT(DefineName,sText)
118 DEF_TOKEN_CLASS_WITHTEXT(MacroName,sText)
119 DEF_TOKEN_CLASS_WITHTEXT(MacroParameter,sText)
120 // DEF_TOKEN_CLASS_WITHTEXT(PreProDefinition,sText)
122 void
123 Tok_PreProDefinition::Trigger( TokenInterpreter & io_rInterpreter ) const
124 { io_rInterpreter.Hdl_PreProDefinition(*this); }
126 INT16
127 Tok_PreProDefinition::TypeId() const { return Tid_PreProDefinition; }
129 const char *
130 Tok_PreProDefinition::Text() const
132 return sText;
137 DEF_TOKEN_CLASS_WITHTEXT(BuiltInType,sText)
138 DEF_TOKEN_CLASS_WITHTEXT(TypeSpecializer,sText)
139 DEF_TOKEN_CLASS_WITHTEXT(Constant,sText)
141 const char *
142 Tok_UnblockMacro::Text() const
144 return sMacroName;
147 void
148 Tok_UnblockMacro::DealOut( ::TokenDealer & o_rDealer )
150 // KORR_FUTURE HACK (casting to derivation cpp::TokenDealer)
151 o_rDealer.AsDistributor()->Deal_Cpp_UnblockMacro(*this);
154 } // namespace cpp