heckenb@mi.uni-erlangen.de on 20/10/97 15:14:59
To: gpc@hut.fi cc: (bcc: Richard Kerry/Quantel Research) Subject: Re: Gpc not accepting non-standard (?) systax.
richard.kerry@quantel.com wrote:
The 'C' directive on external procedures.
FUNCTION _p_paramcount : Integer; C; EXTERNAL ; FUNCTION _p_paramstr (num: Integer; VAR str: String): Boolean; C; EXTERNAL ;
It says : : parse error before `External'
The "C" directive implies "external". Earlier GPCs have accepted the above, the newer versions don't anymore. Just using "C" should do what you want. (Apart from this, there are still plans to make a more consistent syntax for C/External/AsmName... sometime...)
If I comment these out it fails on a structured constant definition using 'value'.
type ArgDefs = ArgDefTable value ( ((' ', 1, 0), 0, OptionalArg, NullArg), etc...
It says : : parse error before `Value' : invalid schema discriminants
If I comment out 'value' it says : parse error before `,' : missing expression : discriminated type is not a schema or string : parse error before `,'
Is there some configuration I need to do to make these work ? Or have I found a bug ?
If ArgDefTable is an array or record (or a combination of these), this is a known problem (since I don't know if this is required by the standard, I'm not sure if it's a bug or just a missing feature ;-). It's listed in my To-Do list at http://www.mi.uni-erlangen.de/~heckenb/gpc-todo_toc.html in the section "Records/arrays". If, however, a schema type is involved (the error messages say something about these), it might help to see the declaration of ArgDefTable. Did you perhaps use "string" without a maximum length? -- Frank Heckenbach, Erlangen, Germany heckenb@mi.uni-erlangen.de http://home.pages.de/~fjf/links.htm
Thank you for your help with the C/external problem, I've removed 'external' and that part is now happy.
Regarding the second problem, concerning a structured constant, or at least what seems to be the gpc technique to achieve the effect of a structured constant :
The full chain of defs is as follows :
const mArgName = 16;
type ArgType = (OutputFileArg, InputFileArg, OptionsArg); ArgClass = (StringArg, FileArg, NullArg); ArgStatus = (RequiredArg, OptionalArg);
ArgName = packed array[1..mArgName] of char; iArgName = 0..mArgName;
ArgDef = record name: record txt: ArgName; amin: iArgName; len: iArgName; end; pos: integer; status: ArgStatus; aclass: ArgClass; end;
ArgDefTable = array[ArgType] of ArgDef;
type ArgDefs = ArgDefTable value ( ((' ', 1, 0), 0, OptionalArg, NullArg), (('Output_File ', 1, 11), 2, OptionalArg, FileArg), ... );
var kludge : ArgDefs ; I hope this is sufficient for you to sort out my problem. It compiled successfully under gpc-970824 but fails under 971001.
Thank You, Richard Kerry.