C++ Producer Guide

March 1998

next section previous section current document TenDRA home page document index


Annex A. #pragma directive syntax

The following gives a summary of the syntax for the #pragma directives used for compiler configuration and token specification:


pragma-directive : # pragma TenDRA ++opt tendra-directive # pragma token-directive tendra-directive : scope-directive low-level-directive analysis-directive on check-directive allow keyword-directive type-directive linkage-directive misc-directive tendra-token-directive on : on warning off allow : allow warning disallow
scope-directive : begin begin name environment identifier end directory identifier use environment identifier use environment identifier use environment identifier reset allow
low-level-directive : error string-literal allow error string-literal on error string-literal as option string-literal option string-literal allow option string-literal on option value string-literal integer-literal use error string-literal
analysis-directive : complete initialization analysis complete struct / union analysis conversion analysis conversion-specopt discard analysis discard-specopt enum switch analysis external function linkage for initialization block ignore struct / union / enum tag implicit export template implicit function declaration integer operator analysis integer overflow analysis nested comment analysis operator precedence analysis pointer operator analysis throw analysis unify external linkage variable analysis variable hiding analysis weak prototype analysis conversion-spec : ( int - int implicit-specopt ) ( int - pointer implicit-specopt ) ( pointer - int implicit-specopt ) ( pointer - pointer implicit-specopt ) ( int - enum implicit ) ( pointer - void * implicit ) ( void * - pointer implicit ) implicit-spec : implicit explicit discard-spec : ( function return ) ( static ) ( value )
check-directive : ambiguous overload resolution assignment as bool bitfield overflow block function static catch all character escape overflow compatible token complete file includes conditional declaration conditional lvalue conditional overload resolution overload-specopt const conditional directive as macro argument dollar as ident extra , extra ; extra ; after conditional extra ... extra bitfield int type extra macro definition extra type definition fall into case forward enum declaration function pointer as pointer ident ... implicit int type inttype-specopt implicit token definition incompatible interface declaration incompatible member declaration incompatible linkage incompatible promoted function argument incompatible type qualifier incompatible void return incomplete type as object type indented # directive indented directive after # initialization of struct / union ( auto ) longlong type no directive / nline after ident no external declaration no ident after # no nline after file end no token definition overload resolution prototype prototype ( weak ) rvalue token as const text after directive this lvalue unify incompatible string literal unknown directive unknown escape unknown pragma unknown struct / union unmatched quote unreachable code variable initialization weak macro equality writeable string literal inttype-spec : for const / volatile for external declaration for function return overload-spec : ( complete ) ( incomplete )
keyword-directive : keyword identifier for keyword-spec undef keyword identifier keyword-spec : discard value discard variable exhaustive fall into case keyword identifier operator operator set set reachable set unreachable type representation weak
type-directive : bottom identifier character character-sign character character-literal character-mapping character string-literal character-mapping compute promote identifier escape character-literal character-mapping integer literal literal-spec promoted type-id : type-id set character literal : type-id set longlong type : longlong-spec set ptrdiff_t : type-id set size_t : type-id set wchar_t : type-id set string literal : string-const set std namespace : scope-name type identifier for type-spec character-sign : signed unsigned either character-mapping : as character-literal allow disallow literal-spec : literal-base literal-suffixopt literal-type-list literal-base : decimal octal hexadecimal literal-suffix : unsigned long unsigned long long long unsigned long long literal-type-list : * literal-type-spec integer-literal literal-type-spec | literal-type-list ? literal-type-spec | literal-type-list literal-type-spec : : type-id * allowopt : identifier * * allowopt : longlong-spec : long long long string-const : const no const scope-name : identifier :: type-spec : bottom ptrdiff_t size_t wchar_t ... printf ... scanf
linkage-directive : const linkage linkage external linkage string-literal external volatile_t inline linkage linkage linkage resolution : linkage-spec linkage : external internal linkage-spec : ( linkage ) on ( linkage ) warning off
misc-directive : argument type-id as ... argument type-id as type-id compatible type : type-id == type-id : allow conversion identifier-list allow declaration block identifier begin declaration block end directive directive-spec directive-state discard expression exhaustive explicit cast cast-specopt allow includes depth integer-literal preserve preserve-list set expression set error limit integer-literal set name limit integer-literal warningopt suspend static identifier-list directive-spec : assert file ident import include_next unassert warning weak directive-state : allow warning disallow ( ignore ) allow ( ignore ) warning cast-operator : static_cast const_cast reinterpret_cast cast-spec : as cast-operator cast-spec | cast-operator preserve-list : identifier-list * identifier-list : identifier identifier-listopt
token-directive : token token-spec no_def token-list define token-list ignore token-list interface token-list undef token token-list extend interface header-name implement interface header-name tendra-token-directive : token token-spec no_def token-list define token-list reject token-list interface token-list undef token token-list extend header-name implement header-name member definition type-id : identifier member-offset member-offset : ::opt id-expression member-offset . ::opt id-expression member-offset [ constant-expression ] token-list : token-id token-listopt # preproc-token-list token-id : token-namespaceopt identifier type-id . identifier
token-spec : token-introduction token-identification token-introduction : exp-token statement-token type-token member-token procedure-token token-identification : token-namespaceopt identifier # external-identifieropt token-namespace : TAG external-identifier : - preproc-token-list exp-token : EXP exp-storageopt : type-id : NAT INTEGER exp-storage : lvalue rvalue const statement-token : STATEMENT type-token : TYPE VARIETY VARIETY signed VARIETY unsigned FLOAT ARITHMETIC SCALAR CLASS STRUCT UNION member-token : MEMBER access-specifieropt member-type-id : type-id : member-type-id : type-id type-id % constant-expression access-specifier : public protected private procedure-token : general-procedure simple-procedure function-procedure general-procedure : PROC { bound-toksopt | prog-parsopt } token-introduction bound-toks : bound-token bound-token , bound-toks bound-token : token-introduction token-namespaceopt identifier prog-pars : program-parameter program-parameter , prog-pars program-parameter : EXP identifier STATEMENT identifier TYPE type-id MEMBER type-id : identifier PROC identifier simple-procedure : PROC ( simple-toksopt ) token-introduction simple-toks : simple-token simple-token , simple-toks simple-token : token-introduction token-namespaceopt identifieropt function-procedure : FUNC type-id :


Part of the TenDRA Web.
Crown Copyright © 1998.