/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <stdlib.h> #include <string.h>
#define INS 327680 /* input buffer */ #define OBS 8092 /* output buffer */ #define NARG 32 /* Max number arguments to a macro */ #define NINCLUDE 48 /* Max number of include directories (-I) */ #define NIF 64 /* depth of nesting of #if */ #define NINC 32 /* depth of nesting of #include */
#define ISDEFINED 0x01 /* has #defined value */ #define ISKW 0x02 /* is PP keyword */ #define ISUNCHANGE 0x04 /* can't be #defined in PP */ #define ISMAC 0x08 /* builtin macro, e.g. __LINE__ */ #define ISARCHITECTURE 0x10 /* architecture */ #define ISACTIVE 0x80 /* is macro currently expanded */
#define EOB 0xFE /* sentinel for end of input buffer */ #define EOFC 0xFD /* sentinel for end of input file */
typedefstruct token
{ unsignedchar type;
size_t wslen;
size_t len;
uchar *t; unsignedint identifier; /* used from macro processor to identify where a macro becomes valid again. */
} Token;
typedefstruct tokenrow
{
Token *tp; /* current one to scan */
Token *bp; /* base (allocated value) */
Token *lp; /* last+1 token used */
size_t max; /* number allocated */
} Tokenrow;
typedefstruct source
{ char *filename; /* name of file of the source */ int line; /* current line number */ int lineinc; /* adjustment for \\n lines */
uchar *inb; /* input buffer */
uchar *inp; /* input pointer */
uchar *inl; /* end of input */ int fd; /* input source */ int ifdepth; /* conditional nesting in include */ int pathdepth; int wrap; struct source *next; /* stack for #include */
} Source;
typedefstruct nlist
{ struct nlist *next;
uchar *name;
size_t len;
Tokenrow *vp; /* value as macro */
Tokenrow *ap; /* list of argument names, if any */ char val; /* value as preprocessor name */ char flag; /* is defined, is pp name */
uchar *loc; /* location of definition */
} Nlist;
/* Checks if one of the validators within the list points to the token in_pTokenToCheck. If so, the macro is set valid and the validator is removed.
*/ void mvl_check(
MacroValidatorList *
inout_pValidators,
Token const * inout_pTokenToCheck);
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.0Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.