• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

Demonstration of groff .psbb request handling code, for EPS and PDF input files


Commit MetaInfo

Revision71f0d7d8734a02164e3d372579f30e415d1ca2f6 (tree)
Zeit2021-10-21 03:06:09
AutorKeith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Report PDF context when tracing lexer state pushes.

* psbblex.l [DEBUG] (DEBUG_PUSH_STATE): Redefine in terms of...
(DEBUG_PUSH_NAMED_STATE): ...this new macro; it is also used by...
(DEBUG_PUSH_KEY_STATE): ...this further new macro; use it instead of
DEBUG_PUSH_STATE, to report PDF context at change of lexer state.

Ändern Zusammenfassung

Diff

--- a/psbblex.l
+++ b/psbblex.l
@@ -42,11 +42,22 @@
4242
4343 # define DEBUG_MSG(ARGLIST) do { debug_msg ARGLIST; } while(0)
4444
45+# define DEBUG_PUSH_KEY_STATE(NAME) \
46+ do { debug_msg("%d: processing entry with key '%s'\n", \
47+ YYSTATE, yytext \
48+ ); \
49+ DEBUG_PUSH_NAMED_STATE( #NAME, NAME ); \
50+ } while(0)
51+
4552 # define DEBUG_PUSH_STATE(NAME) \
53+ do { DEBUG_PUSH_NAMED_STATE( #NAME, NAME ); \
54+ } while(0)
55+
56+# define DEBUG_PUSH_NAMED_STATE(NAME, INDEX) \
4657 do { debug_msg("%d: switching to temporary state %s (%d)\n", \
47- YYSTATE, #NAME, NAME \
58+ YYSTATE, NAME, INDEX \
4859 ); \
49- yy_push_state( NAME ); \
60+ yy_push_state( INDEX ); \
5061 } while(0)
5162
5263 # define DEBUG_POP_STATE() \
@@ -80,6 +91,7 @@ static void debug_msg (const char *fmt, ...)
8091 # define DEBUG_ECHO
8192 # define DEBUG_MSG(ARGLIST)
8293 # define DEBUG_PUSH_STATE(NAME) yy_push_state( NAME )
94+# define DEBUG_PUSH_KEY_STATE(NAME) yy_push_state( NAME )
8395 # define DEBUG_POP_STATE() yy_pop_state()
8496 # define DEBUG_RETURN(TOKEN, NAME) return TOKEN
8597 # define DEBUG_RETURN_VALUE return VALUE
@@ -94,10 +106,7 @@ enum { PSBB_PHASE_INIT = 0, PSBB_IN_HEADER, PSBB_IN_TRAILER };
94106 static int psbb_phase, psbb_crescendo_seek( void ), psbb_parse_status;
95107
96108 #define DEBUG_PDFINVOKE(STATE, TOKEN, NAME) \
97- do { DEBUG_MSG(("%d: processing entry with key '%s'\n", \
98- YYSTATE, yytext \
99- )); \
100- yy_push_state( STATE ); DEBUG_RETURN(TOKEN, NAME); \
109+ do { DEBUG_PUSH_KEY_STATE( STATE ); DEBUG_RETURN(TOKEN, NAME); \
101110 } while(0)
102111
103112 #define PDFINVOKE(STATE, TOKEN) DEBUG_PDFINVOKE(STATE, TOKEN, #TOKEN)
@@ -352,10 +361,10 @@ static int pdf_trailer( void )
352361 "/Prev"/{PDFSEP} { if( yy_top_state() == PDFXREFCONT ) BEGIN PDFXREFWALK;
353362 else yy_push_state( PDFIGNORE );
354363 }
355-"/Type"/{PDFSEP} { DEBUG_PUSH_STATE( PDFOBJTYPE ); }
356-"/Pages"/{PDFSEP} { DEBUG_PUSH_STATE( PDFREFER ); }
357-"/Kids"/{PDFSEP} { DEBUG_PUSH_STATE( PDFALLKIDS ); }
358-"/MediaBox"/{PDFSEP} { DEBUG_PUSH_STATE( PDFMEDIABOX ); }
364+"/Type"/{PDFSEP} { DEBUG_PUSH_KEY_STATE( PDFOBJTYPE ); }
365+"/Pages"/{PDFSEP} { DEBUG_PUSH_KEY_STATE( PDFREFER ); }
366+"/Kids"/{PDFSEP} { DEBUG_PUSH_KEY_STATE( PDFALLKIDS ); }
367+"/MediaBox"/{PDFSEP} { DEBUG_PUSH_KEY_STATE( PDFMEDIABOX ); }
359368 "/"{PDFNAME}/{PDFSEP} { DEBUG_MSG(("%d: skipping entry with key '%s'\n",
360369 YYSTATE, yytext
361370 ));