/usr/include/styx/ptm_gen.h is in styx-dev 2.0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | /* ------------------------------------------------------------------------ */
/* */
/* [ptm_gen.h] Parse Term Construction */
/* - during parse process - */
/* */
/* Copyright (c) 1993 by D\olle, Manns */
/* ------------------------------------------------------------------------ */
/* File generated by 'ctoh'. Don't change manually. */
#ifndef ptm_gen_INCL
#define ptm_gen_INCL
#include "symbols.h"
#include "scn_base.h"
#include "scn_abs.h"
#include "prs_dfn.h"
#include "prs_abs.h"
#include "ptm.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
The module [ptm_gen] provides a high-level parse interface. It implements
the construction of the parse tree / term during the parse process.
The scan, parse and term construction functions are reentrant which offers
the possibility of multiple concurrent parse operations.
*/
/* ------------------------- Types ------------------------------------------ */
AbstractType(PT_Diag); /* Abstract parse term diagnose type */
AbstractType(PT_Cfg); /* Abstract parse term configuration type */
/* ------------------------ Parsing & Term Construction -------------------- */
PT_Cfg PT_init(PLR_Tab PTab, Scn_Stream cStream)
/* initializes parse term construction
for parse table 'PTab' and scan stream 'cStream';
creates a configuration
*/
;
PT_Cfg PT_init_extscn(PLR_Tab PTab, AbsScn_T sconfig)
/* initializes parse term construction
for parse table 'PTab' and external scanner 'sconfig';
creates a configuration
*/
;
PT_Cfg PT_init_ext(AbsPlr_T pconfig, AbsScn_T sconfig)
/* initializes parse term construction
for external parser 'pconfig' and external scanner 'sconfig';
creates a configuration
*/
;
void PT_setMsgFun(void (*prMsg)(c_string msg))
/* defines 'prMsg' as ( static ) default message function
( 'msg': single byte character set or UTF-8 )
*/
;
void PT_setDiagFun(PT_Cfg PCfg, PT_Diag PDiag)
/* adds diagnose environment 'PDiag' to
parse term configuration 'PCfg'
*/
;
void PT_setTokConvFun(PT_Cfg PCfg, symbol convTok(symbol tok, symbol val))
/* adds token value converter 'convTok' to
parse term configuration 'PCfg'
( user-defined shift-handler )
*/
;
void PT_setNtmConvFun(PT_Cfg PCfg, PT_Term convNtm(PT_Term Tree))
/* adds nonterminal value converter 'convNtm' to
parse term configuration 'PCfg'
( user-defined reduce-handler; must release each replaced source tree )
*/
;
void PT_setTokConvFunEx
(
PT_Cfg PCfg,
symbol convTok(symbol tok, symbol val, Any_T ctx),
Any_T ctx
)
/* like PT_setTokConvFun
Additionally, a non-NULL context 'ctx' will be passed
to the shift-handler.
Both handler must use the same context.
( currently not supported by 'pim_test' )
*/
;
void PT_setNtmConvFunEx
(
PT_Cfg PCfg, PT_Term convNtm(PT_Term Tree, Any_T ctx),
Any_T ctx
)
/* like PT_setNtmConvFun
Additionally, a non-NULL context 'ctx' will be passed
to the reduce-handler.
Both handler must use the same context.
( currently not supported by 'pim_test' )
*/
;
void PT_setEParser
(
PT_Cfg PCfg,
Abs_T newEParser(Any_T ePlrCtx, c_string language),
void freeEParser(Abs_T eParser),
Any_T ePlrCtx
)
/* adds embedded parser constructor 'newEParser',
destructor 'freeEParser' and some context 'ePlrCtx' to
parse term configuration 'PCfg';
must be set for embedded languages
*/
;
void PT_quit(PT_Cfg PCfg)
/* terminates parse term construction;
removes configuration 'PCfg'
*/
;
PT_Term PT_parse(PT_Cfg PCfg, c_string StartSymbol, c_bool interprete)
#define PT_PARSE(pcfg,start) PT_parse((pcfg),(start),C_False)
#define PT_INTERPRETE(pcfg,start) PT_parse((pcfg),(start),C_True)
/* parses and constructs parse term of type C ( see [ptm] )
according configuration 'PCfg';
uses 'StartSymbol' as start nonterminal or default if empty
( interprete --> early reduction )
*/
;
PT_Term XPT_parse(PT_Cfg PCfg, c_string StartSymbol, c_bool interprete)
#define XPT_PARSE(pcfg,start) XPT_parse((pcfg),(start),C_False)
#define XPT_INTERPRETE(pcfg,start) XPT_parse((pcfg),(start),C_True)
/* parses and constructs parse term of type Xaron ( see [ptm] )
according configuration 'PCfg';
uses 'StartSymbol' as start nonterminal or default if empty
( interprete --> early reduction )
*/
;
int PT_synErrorCnt(PT_Cfg PCfg)
/* number of syntax errors in parse term configuration 'PCfg' */
;
symbol PT_ErrorSymbol(PT_Cfg PCfg)
/* symbol of error token in parse term configuration 'PCfg' */
;
/* --------------------------- Semantic Analysis ---------------------------- */
/* ---------------- ... using the default environment ( static ) ------------ */
void PT_diagnose(PT_Term PTree, c_string format, ...)
/* prints a test message for parse term node 'PTree'
according variable format specification 'format' and '...'
*/
;
void PT_error(PT_Term PTree, c_string format, ...)
/* increments the number of semantic errors and
prints an error message for parse term node 'PTree'
according variable format specification 'format' and '...'
*/
;
void PT_warn(PT_Term PTree, c_string format, ...)
/* increments the number of warnings and
prints a warning message for parse term node 'PTree'
according variable format specification 'format' and '...'
*/
;
void PT_setErrorCnt(int cnt)
/* resets the number of semantic errors with 'cnt' */
;
int PT_errorCnt(void); /* number of semantic errors */
void PT_setWarningCnt(int cnt); /* resets the number of warnings with 'cnt' */
int PT_warnCnt(void); /* number of warnings */
/* ---------------- ... using the diagnose environment ( reentrant ) -------- */
PT_Diag PT_diag_init(void (*prMsg)(c_string msg))
/* creates a diagnose environment
using 'prMsg' as message function
( 'msg': single byte character set or UTF-8 )
*/
;
void PT_diag_quit(PT_Diag PDiag); /* removes diagnose environment 'PDiag' */
void PT_diag_msg(PT_Term PTree, PT_Diag PDiag, c_string format, ...)
/* prints a message for parse term node 'PTree'
according diagnose environment 'PDiag',
variable format specification 'format' and '...'
*/
;
void PT_diag_test(PT_Term PTree, PT_Diag PDiag, c_string format, ...)
/* like PT_diag_msg; prints a test message */
;
void PT_diag_err(PT_Term PTree, PT_Diag PDiag, c_string format, ...)
/* increments the number of semantic errors
in diagnose environment 'PDiag' and
prints an error message for parse term node 'PTree'
according variable format specification 'format' and '...'
*/
;
void PT_diag_warn(PT_Term PTree, PT_Diag PDiag, c_string format, ...)
/* increments the number of warnings
in diagnose environment 'PDiag' and
prints a warning message for parse term node 'PTree'
according variable format specification 'format' and '...'
*/
;
void PT_diag_setErrorCnt(PT_Diag PDiag, int cnt)
/* resets the number of semantic errors
in diagnose environment 'PDiag' with 'cnt'
*/
;
int PT_diag_errorCnt(PT_Diag PDiag)
/* number of semantic errors in diagnose environment 'PDiag' */
;
void PT_diag_setWarningCnt(PT_Diag PDiag, int cnt)
/* resets number of warnings
in diagnose environment 'PDiag' with 'cnt'
*/
;
int PT_diag_warnCnt(PT_Diag PDiag)
/* number of warnings in diagnose environment 'PDiag' */
;
void (*PT_diag_msgFun(PT_Diag PDiag))(c_string msg)
/* message function in diagnose environment 'PDiag' */
;
/* ---------------- Accessing configuration ( Xaron support ) --------------- */
Scn_Stream PT_stream(PT_Cfg PCfg)
/* current scan stream in parse term configuration 'PCfg' */
;
PLR_Tab PT_ptab(PT_Cfg PCfg)
/* current parse table in parse term configuration 'PCfg' */
;
#ifdef __cplusplus
}
#endif
#endif
|