Major cleanup of comments

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@128 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-01-20 05:45:58 +00:00
commit fc2fb1ff98
25 changed files with 769 additions and 853 deletions

View file

@ -1,39 +1,25 @@
/****************************************************************************
* Simplified Wrapper and Interface Generator (SWIG)
/* -----------------------------------------------------------------------------
* cpp.c
*
* An implementation of a C preprocessor plus some support for additional
* SWIG directives.
*
* - SWIG directives such as %include, %extern, and %import are handled
* - A new macro %define ... %enddef can be used for multiline macros
* - No preprocessing is performed in %{ ... %} blocks
* - Lines beginning with %# are stripped down to #... and passed through.
*
* Author : David Beazley
* Author(s) : David Beazley (beazley@cs.uchicago.edu)
*
* Department of Computer Science
* University of Chicago
* 1100 E 58th Street
* Chicago, IL 60637
* beazley@cs.uchicago.edu
*
* Please read the file LICENSE for the copyright and terms by which SWIG
* can be used and distributed.
****************************************************************************/
* Copyright (C) 1999-2000. The University of Chicago
* See the file LICENSE for information on usage and redistribution.
* ----------------------------------------------------------------------------- */
static char cvsroot[] = "$Header$";
#include "preprocessor.h"
#include <ctype.h>
/* -----------------------------------------------------------------------------
* $Header$
*
* File : cpp.c
*
* The SWIG Preprocessor. This works almost exactly like the C preprocessor except
* for a number of extensions:
*
* - SWIG directives such as %include, %extern, and %import are recognized
* - A new macro %define ... %enddef is provided to make it easier to
* write multi-line macros.
* - No preprocessing is performed inside %{ ... %} blocks.
* - Lines beginning with %#... are stripped to #... and passed through
* unmodified.
* ----------------------------------------------------------------------------- */
static DOH *cpp = 0; /* C preprocessor data */
static int include_all = 1; /* Follow all includes */
static int single_include = 1; /* Only include each file once */

View file

@ -1,31 +1,19 @@
/****************************************************************************
* Simplified Wrapper and Interface Generator (SWIG)
*
* Author : David Beazley
*
* Department of Computer Science
* University of Chicago
* 1100 E 58th Street
* Chicago, IL 60637
* beazley@cs.uchicago.edu
*
* Please read the file LICENSE for the copyright and terms by which SWIG
* can be used and distributed.
****************************************************************************/
#include "preprocessor.h"
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
* expr.c
*
* This is your basic ol' integer arithmetic expression evaluator. Could have
* used yacc for this, but it generates something like 1000 lines of code
* (whereas this implementation is much smaller).
* Integer arithmetic expression evaluator used to handle expressions
* encountered during preprocessing.
*
* Author(s) : David Beazley (beazley@cs.uchicago.edu)
*
* This module is primarily for use by the preprocessor and any other parts of
* the compiler that need to perform compile-time expression evaluation.
* Copyright (C) 1999-2000. The University of Chicago
* See the file LICENSE for information on usage and redistribution.
* ----------------------------------------------------------------------------- */
static char cvsroot[] = "$Header$";
#include "preprocessor.h"
static SwigScanner *scan = 0;
typedef struct {
@ -172,23 +160,25 @@ static void reduce_op() {
}
/* -----------------------------------------------------------------------------
* void Preprocessor_expr_init()
* Preprocessor_expr_init()
*
* Initialize the expression evaluator
* ----------------------------------------------------------------------------- */
void Preprocessor_expr_init() {
void
Preprocessor_expr_init() {
if (!expr_init) init_precedence();
if (!scan) scan = NewSwigScanner();
}
/* -----------------------------------------------------------------------------
* int Preprocessor_expr(DOH *s, int *error)
* Preprocessor_expr()
*
* Evaluates an arithmetic expression in s.
* Evaluates an arithmetic expression. Returns the result and sets an error code.
* ----------------------------------------------------------------------------- */
int Preprocessor_expr(DOH *s, int *error) {
int
Preprocessor_expr(DOH *s, int *error) {
int token = 0;
int op = 0;
@ -328,8 +318,14 @@ int Preprocessor_expr(DOH *s, int *error) {
return 0;
}
/* Return the expression error message */
char *Preprocessor_expr_error() {
/* -----------------------------------------------------------------------------
* Preprocessor_expr_error()
*
* Return error message set by the evaluator (if any)
* ----------------------------------------------------------------------------- */
char *
Preprocessor_expr_error() {
return errmsg;
}

View file

@ -1,17 +1,15 @@
/****************************************************************************
* Simplified Wrapper and Interface Generator (SWIG)
/* -----------------------------------------------------------------------------
* preprocessor.h
*
* SWIG preprocessor module.
*
* Author : David Beazley
* Author(s) : David Beazley (beazley@cs.uchicago.edu)
*
* Department of Computer Science
* University of Chicago
* 1100 E 58th Street
* Chicago, IL 60637
* beazley@cs.uchicago.edu
* Copyright (C) 1999-2000. The University of Chicago
* See the file LICENSE for information on usage and redistribution.
*
* Please read the file LICENSE for the copyright and terms by which SWIG
* can be used and distributed.
****************************************************************************/
* $Header$
* ----------------------------------------------------------------------------- */
#ifndef _PREPROCESSOR_H
#define _PREPROCESSOR_H