@@ -843,48 +843,48 @@ enable_or_disable ("enable"|"disable")
843
843
/* C++ Keywords and Operators */
844
844
%}
845
845
846
- alignas { return cpp11_keyword (TOK_ALIGNAS); } // C++11
847
- alignof { return cpp11_keyword (TOK_ALIGNOF); } // C++11
848
- and { return cpp98_keyword (TOK_ANDAND); }
849
- and_eq { return cpp98_keyword (TOK_ANDASSIGN); }
850
- bool { return cpp98_keyword (TOK_BOOL); }
851
- catch { return cpp98_keyword (TOK_CATCH); }
852
- char16_t { // C++11, but Visual Studio uses typedefs
846
+ " alignas" { return cpp11_keyword (TOK_ALIGNAS); } // C++11
847
+ " alignof" { return cpp11_keyword (TOK_ALIGNOF); } // C++11
848
+ " and" { return cpp98_keyword (TOK_ANDAND); }
849
+ " and_eq" { return cpp98_keyword (TOK_ANDASSIGN); }
850
+ " bool" { return cpp98_keyword (TOK_BOOL); }
851
+ " catch" { return cpp98_keyword (TOK_CATCH); }
852
+ " char16_t" { // C++11, but Visual Studio uses typedefs
853
853
if (PARSER.mode == configt::ansi_ct::flavourt::VISUAL_STUDIO)
854
854
return make_identifier ();
855
855
else
856
856
return cpp11_keyword (TOK_CHAR16_T);
857
857
}
858
- char32_t { // C++11, but Visual Studio uses typedefs
858
+ " char32_t" { // C++11, but Visual Studio uses typedefs
859
859
if (PARSER.mode == configt::ansi_ct::flavourt::VISUAL_STUDIO)
860
860
return make_identifier ();
861
861
else
862
862
return cpp11_keyword (TOK_CHAR32_T);
863
863
}
864
- class { return cpp98_keyword (TOK_CLASS); }
865
- compl { return cpp98_keyword (' ~' ); }
866
- constexpr { return cpp11_keyword (TOK_CONSTEXPR); } // C++11
867
- delete { return cpp98_keyword (TOK_DELETE); }
868
- decltype { return cpp11_keyword (TOK_DECLTYPE); } // C++11
869
- explicit { return cpp98_keyword (TOK_EXPLICIT); }
870
- false { return cpp98_keyword (TOK_FALSE); }
871
- friend { return cpp98_keyword (TOK_FRIEND); }
872
- mutable { return cpp98_keyword (TOK_MUTABLE); }
873
- namespace { return cpp98_keyword (TOK_NAMESPACE); }
874
- new { return cpp98_keyword (TOK_NEW); }
875
- nodiscard { return cpp11_keyword (TOK_NODISCARD); } // C++11
876
- noexcept { return cpp11_keyword (TOK_NOEXCEPT); } // C++11
877
- noreturn { return cpp11_keyword (TOK_NORETURN); } // C++11
878
- not { return cpp98_keyword (' !' ); }
879
- not_eq { return cpp98_keyword (TOK_NE); }
880
- nullptr { return cpp11_keyword (TOK_NULLPTR); } // C++11
881
- operator { return cpp98_keyword (TOK_OPERATOR); }
882
- or { return cpp98_keyword (TOK_OROR); }
883
- or_eq { return cpp98_keyword (TOK_ORASSIGN); }
884
- private { return cpp98_keyword (TOK_PRIVATE); }
885
- protected { return cpp98_keyword (TOK_PROTECTED); }
886
- public { return cpp98_keyword (TOK_PUBLIC); }
887
- static_assert { // C++11, but Visual Studio supports it in all modes
864
+ " class" { return cpp98_keyword (TOK_CLASS); }
865
+ " compl" { return cpp98_keyword (' ~' ); }
866
+ " constexpr" { return cpp11_keyword (TOK_CONSTEXPR); } // C++11
867
+ " delete" { return cpp98_keyword (TOK_DELETE); }
868
+ " decltype" { return cpp11_keyword (TOK_DECLTYPE); } // C++11
869
+ " explicit" { return cpp98_keyword (TOK_EXPLICIT); }
870
+ " false" { return cpp98_keyword (TOK_FALSE); }
871
+ " friend" { return cpp98_keyword (TOK_FRIEND); }
872
+ " mutable" { return cpp98_keyword (TOK_MUTABLE); }
873
+ " namespace" { return cpp98_keyword (TOK_NAMESPACE); }
874
+ " new" { return cpp98_keyword (TOK_NEW); }
875
+ " nodiscard" { return cpp11_keyword (TOK_NODISCARD); } // C++11
876
+ " noexcept" { return cpp11_keyword (TOK_NOEXCEPT); } // C++11
877
+ " noreturn" { return cpp11_keyword (TOK_NORETURN); } // C++11
878
+ " not" { return cpp98_keyword (' !' ); }
879
+ " not_eq" { return cpp98_keyword (TOK_NE); }
880
+ " nullptr" { return cpp11_keyword (TOK_NULLPTR); } // C++11
881
+ " operator" { return cpp98_keyword (TOK_OPERATOR); }
882
+ " or " { return cpp98_keyword (TOK_OROR); }
883
+ " or_eq" { return cpp98_keyword (TOK_ORASSIGN); }
884
+ " private" { return cpp98_keyword (TOK_PRIVATE); }
885
+ " protected" { return cpp98_keyword (TOK_PROTECTED); }
886
+ " public" { return cpp98_keyword (TOK_PUBLIC); }
887
+ " static_assert" { // C++11, but Visual Studio supports it in all modes
888
888
// as a keyword, even though the documentation claims
889
889
// it's a macro.
890
890
if (PARSER.mode == configt::ansi_ct::flavourt::VISUAL_STUDIO)
@@ -894,24 +894,24 @@ static_assert { // C++11, but Visual Studio supports it in all modes
894
894
else
895
895
return cpp11_keyword (TOK_STATIC_ASSERT);
896
896
}
897
- template { return cpp98_keyword (TOK_TEMPLATE); }
898
- this { return cpp98_keyword (TOK_THIS); }
899
- thread_local { return cpp11_keyword (TOK_THREAD_LOCAL); } // C++11
900
- throw { return cpp98_keyword (TOK_THROW); }
901
- true { return cpp98_keyword (TOK_TRUE); }
902
- typeid { return cpp98_keyword (TOK_TYPEID); }
903
- typename { return cpp98_keyword (TOK_TYPENAME); }
904
- using { return cpp98_keyword (TOK_USING); }
905
- virtual { return cpp98_keyword (TOK_VIRTUAL); }
906
- wchar_t { // CodeWarrior doesn't have wchar_t built in,
897
+ " template" { return cpp98_keyword (TOK_TEMPLATE); }
898
+ " this" { return cpp98_keyword (TOK_THIS); }
899
+ " thread_local" { return cpp11_keyword (TOK_THREAD_LOCAL); } // C++11
900
+ " throw" { return cpp98_keyword (TOK_THROW); }
901
+ " true" { return cpp98_keyword (TOK_TRUE); }
902
+ " typeid" { return cpp98_keyword (TOK_TYPEID); }
903
+ " typename" { return cpp98_keyword (TOK_TYPENAME); }
904
+ " using" { return cpp98_keyword (TOK_USING); }
905
+ " virtual" { return cpp98_keyword (TOK_VIRTUAL); }
906
+ " wchar_t" { // CodeWarrior doesn't have wchar_t built in,
907
907
// and MSC has a command-line option to turn it off
908
908
if (PARSER.mode ==configt::ansi_ct::flavourt::CODEWARRIOR)
909
909
return make_identifier ();
910
910
else
911
911
return cpp98_keyword (TOK_WCHAR_T);
912
912
}
913
- xor { return cpp98_keyword (' ^' ); }
914
- xor_eq { return cpp98_keyword (TOK_XORASSIGN); }
913
+ " xor" { return cpp98_keyword (' ^' ); }
914
+ " xor_eq" { return cpp98_keyword (TOK_XORASSIGN); }
915
915
" .*" { return cpp_operator (TOK_DOTPM); }
916
916
" ->*" { return cpp_operator (TOK_ARROWPM); }
917
917
" ::" { if (PARSER.cpp98 )
@@ -925,7 +925,7 @@ xor_eq { return cpp98_keyword(TOK_XORASSIGN); }
925
925
}
926
926
}
927
927
928
- __decltype { if (PARSER.cpp98 &&
928
+ " __decltype" { if (PARSER.cpp98 &&
929
929
(PARSER.mode ==configt::ansi_ct::flavourt::GCC ||
930
930
PARSER.mode ==configt::ansi_ct::flavourt::CLANG))
931
931
return cpp98_keyword (TOK_DECLTYPE);
0 commit comments