]> andersk Git - splint.git/blobdiff - src/signature.y
Fixed all /*@i...@*/ tags (except 1).
[splint.git] / src / signature.y
index 436f3dd879f5ac4155811a07b2eeb3f5f1d9849c..b52657da27ffa5ea20c6d0faa282569888f4faf5 100644 (file)
@@ -1,49 +1,45 @@
 /*;-*-C-*-;
-** Copyright (c) Massachusetts Institute of Technology 1994-1998.
-**          All Rights Reserved.
-**          Unpublished rights reserved under the copyright laws of
-**          the United States.
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2003 University of Virginia,
+**         Massachusetts Institute of Technology
 **
-** THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
-** OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
-**
-** This code is distributed freely and may be used freely under the 
-** following conditions:
-**
-**     1. This notice may not be removed or altered.
+** This program is free software; you can redistribute it and/or modify it
+** under the terms of the GNU General Public License as published by the
+** Free Software Foundation; either version 2 of the License, or (at your
+** option) any later version.
+** 
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+** General Public License for more details.
+** 
+** The GNU General Public License is available from http://www.gnu.org/ or
+** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+** MA 02111-1307, USA.
 **
-**     2. Works derived from this code are not distributed for
-**        commercial gain without explicit permission from MIT 
-**        (for permission contact lclint-request@sds.lcs.mit.edu).
+** For information on splint: splint@cs.virginia.edu
+** To report a bug: splint-bug@cs.virginia.edu
+** For more information: http://www.splint.org
 */
 /*
-**      Copyright (c) Massachusetts Institute of Technology, 1993
-**         All Rights Reserved.  Unpublished rights reserved
-**         under the copyright laws of the United States.
-**++
-**  FACILITY:  LSLC
-**
-**  MODULE DESCRIPTION:
+** signature.y
 **
-**      FILENAME: signature.y
+** Grammar for parsing LSL signatures.
 **
-**     PURPOSE:  bison grammar for LSL signatures.
-** 
-**  AUTHOR:
-**     Yang Meng Tan, Massachusetts Institute of Technology
+** Original author: Yang Meng Tan, Massachusetts Institute of Technology
 */
 
 %{
 
-# include "bison.reset"
-
 # include <stdio.h>
-# include "lclintMacros.nf"
-# include "llbasic.h"
+# include "splintMacros.nf"
+# include "basic.h"
 # include "lslparse.h"
 # include "signature.h"
 
-void lslerror (char *);
+static void lslerror (char *);
+extern int lsllex ();
+
 /*@dependent@*/ /*@null@*/ lslOp importedlslOp;
 
 /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
@@ -54,7 +50,9 @@ static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
 
 # define YYDEBUG 1
 
-# include "bison.head"
+/*@-redef@*/
+/*@-readonlytrans@*/
+/*@-nullassign@*/
 
 %}
 
@@ -79,7 +77,9 @@ static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
   /*@only@*/  nameNode name;
   /*@owned@*/ lslOp operator;
   /*@only@*/  lslOpList operators;
-}
+  /*@-redef@*/ /*@-matchfields@*/ 
+} 
+/*@=redef@*/ /*@=matchfields@*/
 
 %token <ltok> LST_SIMPLEID
 %token <ltok> LST_LOGICALOP         /* \implies, \and, \not, \or */
@@ -137,6 +137,7 @@ static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
 %%
 
 top: operatorList { lslOpList_free ($1); } 
+  ;
  
 operatorList: operator 
               { lslOpList x = lslOpList_new ();
@@ -146,17 +147,20 @@ operatorList: operator
             | operatorList operator
               { lslOpList_add ($1, $2);
                $$ = $1; } 
+;
 
 operator: name LST_COLON signature 
           { $$ = makelslOpNode ($1, $3); }
 /* The next production is never used in the output of lsl -syms 
           |  name
           { $$ = makelslOpNode ($1, (sigNode)0); } */
+;
  
 name: opId /* check for the case of if_then_else */
       { $$ = makeNameNodeId ($1); } 
     | opForm
       { $$ = makeNameNodeForm ($1); }
+;
  
 opForm 
      : LST_ifTOKEN LST_MARKERSYM LST_thenTOKEN LST_MARKERSYM LST_elseTOKEN LST_MARKERSYM
@@ -201,7 +205,7 @@ opForm
      | LST_MARKERSYM LST_FIELDMAPSYM LST_SIMPLEID
      { $$ = makeOpFormNode ($1, OPF_MMAP, 
                            opFormUnion_createAnyOp ($3), ltoken_undefined); }
-                         
+;                        
 
 anyOp: LST_SIMPLEOP
        { $$ = $1; }
@@ -209,43 +213,53 @@ anyOp: LST_SIMPLEOP
        { $$ = $1; }
      | LST_EQOP
        { $$ = $1; }
+;
 
 middle: /* empty */
         { $$ = 0; }      
       | placeList
         { $$ = $1; }      
+;
  
 placeList: LST_MARKERSYM
            { $$ = 1; }      
          | placeList separator LST_MARKERSYM
            { $$ = $1 + 1; }      
+;
  
 separator: LST_COMMA
            { $$ = $1; }      
          | LST_SEPSYM
            { $$ = $1; }      
+;
 
 signature: domain LST_MAPSYM sortId
            { $$ = makesigNode ($2, $1, $3); }
+;
 
 domain: /* empty */
         { $$ = ltokenList_new (); } 
       | sortList
         { $$ = $1; }
+;
  
 sortList: sortId
           { $$ = ltokenList_singleton ($1); } 
         | sortList LST_COMMA sortId
           { $$ = ltokenList_push ($1, $3); }  
+;
 
 sortId: LST_SIMPLEID 
         { 
          $$ = $1; 
          ltoken_setText ($$, processTraitSortId (ltoken_getText ($1))); 
        } 
+;
 
 opId: LST_SIMPLEID
       { $$ = $1; }
+;
+
 %%
 
 # include "bison.reset"
@@ -257,7 +271,7 @@ void lslerror (char *s)
   llfatalbug 
     (cstring_makeLiteral 
      ("There has been a problem in the parser with LSL signatures. This is believed to result "
-      "from a problem with bison v. 1.25.  Please try rebuidling LCLint "
+      "from a problem with bison v. 1.25.  Please try rebuidling Splint "
       "using the pre-compiled grammar files by commenting out the "
       "BISON= line in the top-level Makefile."));
 }
This page took 0.057545 seconds and 4 git commands to generate.