X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/28bf4b0bfd405a2057d865910f8589c54a40f17b..061ece7d6fedbde47030222fea74b575c12707dc:/src/mttok.c?ds=sidebyside diff --git a/src/mttok.c b/src/mttok.c index 69e6a99..b8739bb 100644 --- a/src/mttok.c +++ b/src/mttok.c @@ -1,6 +1,6 @@ /* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2001 University of Virginia, +** Splint - annotation-assisted static program checker +** Copyright (C) 1994-2003 University of Virginia, ** Massachusetts Institute of Technology ** ** This program is free software; you can redistribute it and/or modify it @@ -17,17 +17,16 @@ ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ** MA 02111-1307, USA. ** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu +** For information on splint: info@splint.org +** To report a bug: splint-bug@splint.org +** For more information: http://www.splint.org */ /* ** mttok.c - based on lltok.c */ -# include "lclintMacros.nf" +# include "splintMacros.nf" # include "basic.h" - # include "mtgrammar.h" cstring @@ -38,7 +37,7 @@ mttok_unparse (mttok tok) switch (tok->tok) { case EOF: lit = ""; break; - case MT_STATE: lit = "state"; break; + case MT_STATE: lit = "attribute"; break; case MT_GLOBAL: lit = "global"; break; case MT_CONTEXT: lit = "context"; break; case MT_ONEOF: lit = "oneof"; break; @@ -48,7 +47,10 @@ mttok_unparse (mttok tok) case MT_DEFAULT: lit = "default"; break; case MT_REFERENCE: lit = "reference"; break; case MT_PARAMETER: lit = "parameter"; break; + case MT_RESULT: lit = "result"; break; case MT_CLAUSE: lit = "clause"; break; + case MT_LITERAL: lit = "literal"; break; + case MT_NULL: lit = "null"; break; case MT_ANNOTATIONS: lit = "annotations"; break; case MT_ARROW: lit = "==>"; break; case MT_MERGE: lit = "merge"; break; @@ -116,6 +118,11 @@ void mttok_free (mttok t) sfree (t); } +bool mttok_isError (mttok t) +{ + return ((t)->tok == MT_ERROR); +} + bool mttok_isIdentifier (mttok t) { return ((t)->tok == MT_IDENT);