Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 79 lines (66 sloc) 2.485 kb
5912531 move parser state into new parser object, PL_parser
Dave Mitchell authored
1 /* parser.h
2 *
bc641c2 Update copyright years to include 2007. (Plus a couple of 2006s and
Nicholas Clark authored
3 * Copyright (c) 2006, 2007, Larry Wall and others
5912531 move parser state into new parser object, PL_parser
Dave Mitchell authored
4 *
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
7 *
8 * This file defines the layout of the parser object used by the parser
9 * and lexer (perly.c, toke,c).
10 */
11
acdf0a2 split parser initialisation from parser execution
Dave Mitchell authored
12 #define YYEMPTY (-2)
13
5912531 move parser state into new parser object, PL_parser
Dave Mitchell authored
14 typedef struct {
15 YYSTYPE val; /* semantic value */
16 short state;
17 AV *comppad; /* value of PL_comppad when this value was created */
18 #ifdef DEBUGGING
19 const char *name; /* token/rule name for -Dpv */
20 #endif
21 } yy_stack_frame;
22
2273549 split parser stack from parser object
Dave Mitchell authored
23 typedef struct yy_parser {
199e78b move easy lexer state variables into PL_parser
Dave Mitchell authored
24
25 /* parser state */
26
2273549 split parser stack from parser object
Dave Mitchell authored
27 struct yy_parser *old_parser; /* previous value of PL_parser */
5912531 move parser state into new parser object, PL_parser
Dave Mitchell authored
28 YYSTYPE yylval; /* value of lookahead symbol, set by yylex() */
9bd8781 Rearrange members of structures to reduce memory size on some
Nicholas Clark authored
29 int yychar; /* The lookahead symbol. */
5912531 move parser state into new parser object, PL_parser
Dave Mitchell authored
30
31 /* Number of tokens to shift before error messages enabled. */
32 int yyerrstatus;
33
34 int stack_size;
35 int yylen; /* length of active reduction */
2273549 split parser stack from parser object
Dave Mitchell authored
36 yy_stack_frame *stack; /* base of stack */
5912531 move parser state into new parser object, PL_parser
Dave Mitchell authored
37 yy_stack_frame *ps; /* current stack frame */
199e78b move easy lexer state variables into PL_parser
Dave Mitchell authored
38
39 /* lexer state */
40
41 I32 lex_brackets; /* bracket count */
42 I32 lex_casemods; /* casemod count */
43 char *lex_brackstack;/* what kind of brackets to pop */
44 char *lex_casestack; /* what kind of case mods in effect */
651b5b2 Several members of struct yy_parser can go on a diet. Some I32s were
Nicholas Clark authored
45 U8 lex_defer; /* state after determined token */
46 bool lex_dojoin; /* doing an array interpolation */
47 U8 lex_expect; /* expect after determined token */
199e78b move easy lexer state variables into PL_parser
Dave Mitchell authored
48 I32 lex_formbrack; /* bracket count at outer format level */
49 OP *lex_inpat; /* in pattern $) and $| are special */
50 OP *lex_op; /* extra info to pass back on op */
51 SV *lex_repl; /* runtime replacement from s/// */
651b5b2 Several members of struct yy_parser can go on a diet. Some I32s were
Nicholas Clark authored
52 U16 lex_inwhat; /* what kind of quoting are we in */
199e78b move easy lexer state variables into PL_parser
Dave Mitchell authored
53 I32 lex_starts; /* how many interps done on level */
54 SV *lex_stuff; /* runtime pattern from m// or s/// */
55 I32 multi_start; /* 1st line of multi-line string */
651b5b2 Several members of struct yy_parser can go on a diet. Some I32s were
Nicholas Clark authored
56 char multi_open; /* delimiter of said string */
57 char multi_close; /* delimiter of said string */
199e78b move easy lexer state variables into PL_parser
Dave Mitchell authored
58 char pending_ident; /* pending identifier lookup */
59 bool preambled;
60 SUBLEXINFO sublex_info;
61
62 #ifdef PERL_MAD
63 SV *endwhite;
64 I32 faketokens;
65 I32 lasttoke;
66 SV *nextwhite;
67 I32 realtokenstart;
68 SV *skipwhite;
69 SV *thisclose;
70 MADPROP * thismad;
71 SV *thisopen;
72 SV *thisstuff;
73 SV *thistoken;
74 SV *thiswhite;
75 #endif
5912531 move parser state into new parser object, PL_parser
Dave Mitchell authored
76 } yy_parser;
77
78
Something went wrong with that request. Please try again.