Mercurial > ~dholland > hg > ag > index.cgi
diff anagram/agcore/rproc.h @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/anagram/agcore/rproc.h Sat Dec 22 17:52:45 2007 -0500 @@ -0,0 +1,60 @@ +/* + * AnaGram, A System for Syntax Directed Programming + * Copyright 1993-2002 Parsifal Software. All Rights Reserved. + * See the file COPYING for license and usage terms. + * + * rproc.h + */ + +#ifndef RPROC_H +#define RPROC_H + +#include "register.h" + +struct CSegment { + unsigned char *begin; + unsigned char *end; + int line; + + // this is in pgg24.syn and moving it would make an ugly mess + CSegment(); + + int length() { return end - begin; } + int operator < (const CSegment &s) const { return begin < s.begin; } +}; + +struct ProcedureDescriptor; + +class Procedure : public ObjectRegister<ProcedureDescriptor> { +public: + Procedure() {} + Procedure(const int x); + //Procedure(const Procedure &t) : ObjectRegister<ProcedureDescriptor>(t) {} + Procedure(const CSegment &t); + static const int first; + static void reset(); + int operator < (const Procedure p) const; +}; + +struct ProcedureDescriptor { + int cast; + //int n_params; + //unsigned cast_index; + //int auto_proc; + int alias; + int line, col; + int form_number; + CSegment cSegment; + //int *args; + int macro_flag : 1; + int value_flag : 1; + + ProcedureDescriptor(); + ProcedureDescriptor(const CSegment &); + int operator < (const ProcedureDescriptor &d) const { + return cSegment.begin < d.cSegment.begin; + } +}; + + +#endif /* RPROC_H */