[insert project logo here (125x200px max)]
Navigator
Mailinglists
Please report any errors or ommissions you find to our `Help' mailinglist, or
post a message in the Forums.
Copyright and Licensing Information
Snap is (c) Jonathan T. Moore, 1999-2002 and licensed under the
GNU General Public License (GPL).
All other parts of Splash are (c) Willem de Bruijn, 2002-2003 and
licensed under the BSD Open Source License.
All sourcecode is made publicly available.
Acknowledgement
Splash and the Splash website are hosted
by SourceForge.net
|
Splash - Documentation
SNMP Plus a Lightweight API for SNAP Handling
Main Page Alphabetical List Data Structures File List Data Fields Globals
snap-1.1-wjdb/utils/snapparse.c File Reference#include "../lib/config.h"
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <netinet/in.h>
#include "../lib/bytecode.h"
#include "../lib/dyncheck.h"
#include "../lib/packet.h"
#include "../lib/io.h"
#include "../lib/memalloc.h"
#include "labels.h"
#include "../lib/d_printf.h"
#include "../lib/list.h"
Include dependency graph for snapparse.c:
Go to the source code of this file.
|
Data Structures |
union | yyalloc |
union | yystype |
Defines |
#define | YYBISON 1 |
#define | T_INTV 257 |
#define | T_ADDRV 258 |
#define | T_STRV 259 |
#define | T_EXCV 260 |
#define | T_FLOATV 261 |
#define | T_MAIN 262 |
#define | T_EXIT 263 |
#define | T_PUSH 264 |
#define | T_POP 265 |
#define | T_POPI 266 |
#define | T_PULL 267 |
#define | T_EQ 268 |
#define | T_EQI 269 |
#define | T_PAJ 270 |
#define | T_TPAJ 271 |
#define | T_BEZ 272 |
#define | T_BNE 273 |
#define | T_STORE 274 |
#define | T_JI 275 |
#define | T_NEQ 276 |
#define | T_NEQI 277 |
#define | T_ADD 278 |
#define | T_ADDI 279 |
#define | T_SUB 280 |
#define | T_SUBI 281 |
#define | T_MULT 282 |
#define | T_MULTI 283 |
#define | T_DIV 284 |
#define | T_DIVI 285 |
#define | T_MOD 286 |
#define | T_MODI 287 |
#define | T_NEG 288 |
#define | T_NOT 289 |
#define | T_LNOT 290 |
#define | T_AND 291 |
#define | T_ANDI 292 |
#define | T_OR 293 |
#define | T_ORI 294 |
#define | T_LSHL 295 |
#define | T_LSHLI 296 |
#define | T_RSHL 297 |
#define | T_RSHLI 298 |
#define | T_RSHA 299 |
#define | T_RSHAI 300 |
#define | T_SNET 301 |
#define | T_SNETI 302 |
#define | T_BCAST 303 |
#define | T_BCASTI 304 |
#define | T_ISX 305 |
#define | T_GETRB 306 |
#define | T_GETSRC 307 |
#define | T_GETDST 308 |
#define | T_GETSPT 309 |
#define | T_HERE 310 |
#define | T_ISHERE 311 |
#define | T_ROUTE 312 |
#define | T_RTDEV 313 |
#define | T_SEND 314 |
#define | T_HOP 315 |
#define | T_FORW 316 |
#define | T_FORWTO 317 |
#define | T_DEMUX 318 |
#define | T_DEMUXI 319 |
#define | T_PRINT 320 |
#define | T_GETLD 321 |
#define | T_SETXH 322 |
#define | T_RAISEX 323 |
#define | T_PLUS 324 |
#define | T_MINUS 325 |
#define | T_LABEL 326 |
#define | T_LABELV 327 |
#define | T_PC 328 |
#define | T_MKTUP 329 |
#define | T_LEN 330 |
#define | T_NTH 331 |
#define | T_ISTUP 332 |
#define | T_LPAREN 333 |
#define | T_RPAREN 334 |
#define | T_COMMA 335 |
#define | T_SVCV 336 |
#define | T_CALLS 337 |
#define | T_GT 338 |
#define | T_GEQ 339 |
#define | T_LT 340 |
#define | T_LEQ 341 |
#define | T_GTI 342 |
#define | T_GEQI 343 |
#define | T_LTI 344 |
#define | T_LEQI 345 |
#define | T_DATA 346 |
#define | T_DFORW 347 |
#define | T_DFORWTO 348 |
#define | T_DSEND 349 |
#define | T_STACKEMPTY 350 |
#define | T_STACKCOUNT 351 |
#define | T_PULLSTACK 352 |
#define | CHECK_CODE_OVERFLOW(p) |
#define | YYSTYPE yystype |
#define | YYSTYPE_IS_TRIVIAL 1 |
#define | YYDEBUG 0 |
#define | YYFINAL 117 |
#define | YYFLAG -32768 |
#define | YYNTBASE 99 |
#define | YYTRANSLATE(x) ((unsigned)(x) <= 352 ? yytranslate[x] : 109) |
#define | YYLAST 167 |
#define | YYSTACK_ALLOC malloc |
#define | YYSTACK_FREE free |
#define | YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) |
#define | YYSTACK_BYTES(N) |
#define | YYCOPY(To, From, Count) |
#define | YYSTACK_RELOCATE(Stack) |
#define | YYSIZE_T unsigned int |
#define | yyerrok (yyerrstatus = 0) |
#define | yyclearin (yychar = YYEMPTY) |
#define | YYEMPTY -2 |
#define | YYEOF 0 |
#define | YYACCEPT goto yyacceptlab |
#define | YYABORT goto yyabortlab |
#define | YYERROR goto yyerrlab1 |
#define | YYFAIL goto yyerrlab |
#define | YYRECOVERING() (!!yyerrstatus) |
#define | YYBACKUP(Token, Value) |
#define | YYTERROR 1 |
#define | YYERRCODE 256 |
#define | YYLLOC_DEFAULT(Current, Rhs, N) |
#define | YYLEX yylex () |
#define | YYDPRINTF(Args) |
#define | YYINITDEPTH 200 |
#define | YYMAXDEPTH 10000 |
#define | YYPARSE_PARAM_ARG |
#define | YYPARSE_PARAM_DECL |
#define | YY_DECL_NON_LSP_VARIABLES |
#define | YY_DECL_VARIABLES YY_DECL_NON_LSP_VARIABLES |
#define | YYPOPSTACK (yyvsp--, yyssp--) |
Functions |
int | newho (buffer_t *b, char *file, int line) |
int | newtup (list_t *vlist, char *file, int line) |
OPCODE_T | refine_op (OPCODE_T op, TAG_T vtag) |
void | yyerror (char *s) |
YY_DECL_VARIABLES int | yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL |
Variables |
packet_t * | p |
int | value_int |
uint32 | value_addr |
buffer_t | value_str |
int | value_exc |
float32 | value_float |
int | noop |
Define Documentation
#define CHECK_CODE_OVERFLOW |
( |
p |
|
) |
|
|
|
Value: if ((p)->pc >= (p)->code_max) { \
fprintf(stderr,"%s:%d: code overflow\n", \
__FILE__,__LINE__); \
fflush(stderr); \
exit(1); \
}
Definition at line 130 of file snapparse.c.
Referenced by yyparse(). |
#define YY_DECL_NON_LSP_VARIABLES
|
|
|
Value: \
int yychar; \
\
\
YYSTYPE yylval; \
\
\
int yynerrs;
Definition at line 780 of file snapparse.c. |
#define YY_DECL_VARIABLES YY_DECL_NON_LSP_VARIABLES
|
|
#define YYABORT goto yyabortlab
|
|
#define YYACCEPT goto yyacceptlab
|
|
#define YYBACKUP |
( |
Token, |
|
|
Value |
|
) |
|
|
|
Value: do \
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
yylval = (Value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ \
yyerror ("syntax error: cannot back up"); \
YYERROR; \
} \
while (0)
Definition at line 598 of file snapparse.c. |
#define yyclearin (yychar = YYEMPTY)
|
|
#define YYCOPY |
( |
To, |
|
|
From, |
|
|
Count |
|
) |
|
|
|
Value: do \
{ \
register YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (0)
Definition at line 540 of file snapparse.c. |
#define YYDPRINTF |
( |
Args |
|
) |
|
|
#define yyerrok (yyerrstatus = 0)
|
|
#define YYERROR goto yyerrlab1
|
|
#define YYFAIL goto yyerrlab
|
|
#define YYLLOC_DEFAULT |
( |
Current, |
|
|
Rhs, |
|
|
N |
|
) |
|
|
|
Value: Current.last_line = Rhs[N].last_line; \
Current.last_column = Rhs[N].last_column;
Definition at line 627 of file snapparse.c.
Referenced by yyparse(). |
#define YYPARSE_PARAM_ARG
|
|
#define YYPARSE_PARAM_DECL
|
|
#define YYPOPSTACK (yyvsp--, yyssp--)
|
|
#define YYRECOVERING |
( |
|
) |
(!!yyerrstatus)
|
|
#define YYSIZE_T unsigned int
|
|
#define YYSTACK_ALLOC malloc
|
|
#define YYSTACK_BYTES |
( |
N |
|
) |
|
|
#define YYSTACK_FREE free
|
|
#define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
|
|
#define YYSTACK_RELOCATE |
( |
Stack |
|
) |
|
|
|
Value: do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
Definition at line 556 of file snapparse.c.
Referenced by yyparse(). |
#define YYSTYPE_IS_TRIVIAL 1
|
|
#define YYTRANSLATE |
( |
x |
|
) |
((unsigned)(x) <= 352 ? yytranslate[x] : 109)
|
|
Function Documentation
int newho |
( |
buffer_t * |
b, |
|
|
char * |
file, |
|
|
int |
line |
|
) |
|
|
|
Definition at line 1924 of file snapparse.c.
References d_printf(), file, heap_obj::flag, packet_t::h_alloc_ptr, packet_t::heap_max, packet_t::heap_min, heap_obj::len, buffer_t::lenb, MAX_HEAPOBJ_SZ, buffer_t::s, and heap_obj::s.
Referenced by yyparse(). |
int newtup |
( |
list_t * |
vlist, |
|
|
char * |
file, |
|
|
int |
line |
|
) |
|
|
|
Definition at line 1952 of file snapparse.c.
References d_printf(), file, heap_obj::flag, packet_t::h_alloc_ptr, packet_t::heap_max, packet_t::heap_min, heap_obj::len, len, length_list(), MAX_HEAPOBJ_SZ, l::next, heap_obj::s, l::v, and value_t.
Referenced by yyparse(). |
OPCODE_T refine_op |
( |
OPCODE_T |
op, |
|
|
TAG_T |
vtag |
|
) |
|
|
|
Definition at line 1988 of file snapparse.c.
References ADDI, ADDRV, DIVI, EQADR, EQEXC, EQFLT, EQI, EQINT, EQSTR, EQTUP, EXCV, FADDI, FDIVI, FGEQI, FGTI, FLEQI, FLOATV, FLTI, FMULI, FSUBI, GEQI, GTI, INTV, LEQI, LTI, MULTI, NEQI, NQADR, NQEXC, NQFLT, NQINT, NQSTR, NQTUP, OPCODE_T, PADDR, PEXC, PFLT, PINT, PSTR, PTUP, PUSH, STRV, SUBI, TAG_T, and TUPLEV.
Referenced by yyparse(). |
void yyerror |
( |
char * |
s |
) |
|
|
YY_DECL_VARIABLES int yyparse |
( |
YYPARSE_PARAM_ARG |
|
) |
|
|
|
Definition at line 809 of file snapparse.c.
References ADD, ADDI, ADDRV, AND, ANDI, BCAST, BCASTI, BEZ, BNE, CALLS, CHECK_CODE_OVERFLOW, packet_t::code_min, cons(), COPY_VAL, DEMUX, DEMUXI, DFORW, DFORWTO, DIV, DIVI, DSEND, snaphdr::entry_point, EQ, EQI, EXCV, EXIT, FLOATV, FORW, FORWTO, free_list(), GEQ, GEQI, GET_INT, GET_TAG, GETDST, GETLD, GETRB, GETSPT, GETSRC, GT, GTI, packet_t::hdr, HERE, HOP, INTV, ISHERE, ISTUP, ISX, JI, LEN, LEQ, LEQI, LNOT, LSHL, LSHLI, LT, LTI, MAX_VINT, memalloc, MIN_VINT, MKTUP, MOD, MODI, MULT, MULTI, NEG, NEQ, NEQI, newho(), newtup(), noop, NOT, NTH, OPCODE_T, OR, ORI, PAJ, packet_t::pc, POP, POPI, PRINT, PULL, PULLSTACK, PUSH, RAISEX, refine_op(), register_label_def(), register_label_use(), ROUTE, RSHA, RSHAI, RSHL, RSHLI, RTDEV, buffer_t::s, SEND, SET_ADDR, SET_FLOAT, SET_INT, SET_LIT, SET_OFFS, SET_OP, SET_TAG, SETXH, SNET, SNETI, packet_t::sp, packet_t::stack_max, STACKCOUNT, STACKEMPTY, STORE, STRV, SUB, SUBI, SVCV, TPAJ, TUPLEV, value_addr, value_exc, value_float, value_int, value_t, YY_DECL_VARIABLES, YYABORT, YYACCEPT, YYDPRINTF, YYEMPTY, YYEOF, yyerror(), YYFINAL, YYFLAG, YYINITDEPTH, YYLAST, YYLEX, YYLLOC_DEFAULT, yylval, YYMAXDEPTH, YYNTBASE, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL, YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE, YYSTACK_RELOCATE, YYSTYPE, YYTERROR, and YYTRANSLATE. |
Variable Documentation
|