#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#include <stdio.h>
#include <unistd.h>
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
#ifdef __cplusplus
#include <stdlib.h>
#define YY_USE_PROTOS
#define YY_USE_CONST
#else
#if __STDC__
#define YY_USE_PROTOS
#define YY_USE_CONST
#endif
#endif
#ifdef __TURBOC__
#pragma warn -rch
#pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif
#ifdef YY_USE_CONST
#define aagconst const
#else
#define aagconst
#endif
#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif
#define YY_NULL 0
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
#define BEGIN aag_start = 1 + 2 *
#define YY_START ((aag_start - 1) / 2)
#define YYSTATE YY_START
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
#define YY_NEW_FILE aagrestart( aagin )
#define YY_END_OF_BUFFER_CHAR 0
#define YY_BUF_SIZE 16384
typedef struct aag_buffer_state *YY_BUFFER_STATE;
extern int aagleng;
extern FILE *aagin, *aagout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
#define aagless(n) \
do \
{ \
\
*aag_cp = aag_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
aag_c_buf_p = aag_cp = aag_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; \
} \
while ( 0 )
#define unput(c) aagunput( c, aagtext_ptr )
typedef unsigned int aag_size_t;
struct aag_buffer_state
{
FILE *aag_input_file;
char *aag_ch_buf;
char *aag_buf_pos;
aag_size_t aag_buf_size;
int aag_n_chars;
int aag_is_our_buffer;
int aag_is_interactive;
int aag_at_bol;
int aag_fill_buffer;
int aag_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
#define YY_BUFFER_EOF_PENDING 2
};
static YY_BUFFER_STATE aag_current_buffer = 0;
#define YY_CURRENT_BUFFER aag_current_buffer
static char aag_hold_char;
static int aag_n_chars;
int aagleng;
static char *aag_c_buf_p = (char *) 0;
static int aag_init = 1;
static int aag_start = 0;
static int aag_did_buffer_switch_on_eof;
void aagrestart YY_PROTO(( FILE *input_file ));
void aag_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void aag_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE aag_create_buffer YY_PROTO(( FILE *file, int size ));
void aag_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void aag_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void aag_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER aag_flush_buffer( aag_current_buffer )
YY_BUFFER_STATE aag_scan_buffer YY_PROTO(( char *base, aag_size_t size ));
YY_BUFFER_STATE aag_scan_string YY_PROTO(( aagconst char *aag_str ));
YY_BUFFER_STATE aag_scan_bytes YY_PROTO(( aagconst char *bytes, int len ));
static void *aag_flex_alloc YY_PROTO(( aag_size_t ));
static void *aag_flex_realloc YY_PROTO(( void *, aag_size_t ));
static void aag_flex_free YY_PROTO(( void * ));
#define aag_new_buffer aag_create_buffer
#define aag_set_interactive(is_interactive) \
{ \
if ( ! aag_current_buffer ) \
aag_current_buffer = aag_create_buffer( aagin, YY_BUF_SIZE ); \
aag_current_buffer->aag_is_interactive = is_interactive; \
}
#define aag_set_bol(at_bol) \
{ \
if ( ! aag_current_buffer ) \
aag_current_buffer = aag_create_buffer( aagin, YY_BUF_SIZE ); \
aag_current_buffer->aag_at_bol = at_bol; \
}
#define YY_AT_BOL() (aag_current_buffer->aag_at_bol)
typedef unsigned char YY_CHAR;
FILE *aagin = (FILE *) 0, *aagout = (FILE *) 0;
typedef int aag_state_type;
extern char *aagtext;
#define aagtext_ptr aagtext
static aag_state_type aag_get_previous_state YY_PROTO(( void ));
static aag_state_type aag_try_NUL_trans YY_PROTO(( aag_state_type current_state ));
static int aag_get_next_buffer YY_PROTO(( void ));
static void aag_fatal_error YY_PROTO(( aagconst char msg[] ));
#define YY_DO_BEFORE_ACTION \
aagtext_ptr = aag_bp; \
aagleng = (int) (aag_cp - aag_bp); \
aag_hold_char = *aag_cp; \
*aag_cp = '\0'; \
aag_c_buf_p = aag_cp;
#define YY_NUM_RULES 31
#define YY_END_OF_BUFFER 32
static aagconst short int aag_accept[91] =
{ 0,
0, 0, 4, 4, 22, 22, 29, 29, 32, 30,
9, 2, 19, 8, 30, 30, 30, 18, 23, 1,
17, 17, 17, 17, 17, 17, 4, 5, 22, 2,
20, 31, 29, 2, 25, 24, 31, 8, 16, 0,
18, 18, 3, 7, 18, 18, 17, 17, 17, 17,
17, 17, 17, 4, 5, 5, 6, 22, 22, 21,
29, 29, 28, 26, 27, 7, 18, 17, 17, 17,
17, 17, 17, 17, 11, 17, 10, 17, 17, 17,
12, 17, 17, 17, 14, 17, 13, 17, 15, 0
} ;
static aagconst int aag_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
1, 6, 1, 1, 7, 8, 9, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 1, 1, 11,
1, 12, 1, 13, 16, 17, 18, 19, 20, 15,
21, 22, 23, 15, 15, 15, 15, 24, 25, 26,
15, 27, 28, 29, 30, 15, 15, 15, 15, 15,
1, 14, 1, 1, 15, 1, 16, 17, 18, 19,
20, 15, 21, 22, 23, 15, 15, 15, 15, 24,
25, 26, 15, 27, 28, 29, 30, 15, 15, 15,
15, 15, 1, 1, 1, 1, 1, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15
} ;
static aagconst int aag_meta[31] =
{ 0,
1, 1, 2, 3, 1, 4, 1, 5, 1, 6,
7, 7, 1, 8, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6
} ;
static aagconst short int aag_base[104] =
{ 0,
0, 0, 28, 29, 33, 35, 30, 40, 187, 188,
188, 188, 188, 0, 38, 176, 47, 47, 188, 188,
0, 162, 165, 156, 157, 29, 0, 54, 0, 0,
188, 178, 0, 0, 188, 188, 58, 0, 188, 170,
54, 57, 188, 0, 58, 188, 0, 158, 157, 161,
157, 148, 157, 0, 65, 66, 188, 0, 188, 188,
0, 188, 188, 188, 188, 0, 68, 146, 152, 145,
150, 146, 147, 151, 0, 144, 0, 141, 104, 96,
0, 87, 98, 82, 0, 51, 0, 51, 0, 188,
78, 86, 94, 102, 106, 34, 112, 120, 128, 135,
143, 149, 157
} ;
static aagconst short int aag_def[104] =
{ 0,
90, 1, 91, 91, 92, 92, 93, 93, 90, 90,
90, 90, 90, 94, 90, 90, 90, 95, 90, 90,
96, 96, 96, 96, 96, 96, 97, 98, 99, 99,
90, 100, 101, 101, 90, 90, 102, 94, 90, 90,
95, 95, 90, 103, 95, 90, 96, 96, 96, 96,
96, 96, 96, 97, 98, 98, 90, 99, 90, 90,
101, 90, 90, 90, 90, 103, 95, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 0,
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 90
} ;
static aagconst short int aag_nxt[219] =
{ 0,
10, 11, 12, 13, 14, 10, 15, 16, 17, 18,
19, 10, 20, 10, 21, 21, 21, 21, 22, 23,
24, 21, 21, 25, 21, 21, 21, 26, 21, 21,
12, 12, 34, 28, 28, 30, 31, 30, 31, 47,
35, 36, 34, 37, 39, 40, 32, 41, 32, 39,
35, 36, 43, 37, 45, 44, 41, 52, 53, 56,
63, 45, 57, 41, 90, 90, 42, 67, 64, 65,
90, 56, 89, 90, 57, 90, 88, 67, 27, 27,
27, 27, 27, 27, 27, 27, 29, 29, 29, 29,
29, 29, 29, 29, 33, 33, 33, 33, 33, 33,
33, 33, 38, 87, 38, 38, 38, 38, 38, 38,
46, 46, 54, 86, 54, 85, 54, 54, 54, 54,
55, 84, 55, 55, 55, 55, 55, 55, 58, 58,
83, 58, 58, 58, 58, 59, 59, 59, 59, 59,
59, 59, 59, 61, 61, 61, 61, 61, 61, 62,
62, 62, 62, 62, 62, 62, 62, 66, 82, 66,
66, 66, 66, 66, 66, 81, 80, 79, 78, 77,
76, 75, 74, 73, 72, 71, 70, 69, 68, 42,
60, 51, 50, 49, 48, 42, 90, 9, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90
} ;
static aagconst short int aag_chk[219] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
3, 4, 7, 3, 4, 5, 5, 6, 6, 96,
7, 7, 8, 7, 15, 15, 5, 15, 6, 15,
8, 8, 17, 8, 18, 17, 18, 26, 26, 28,
37, 41, 28, 41, 42, 45, 42, 45, 37, 37,
55, 56, 88, 55, 56, 67, 86, 67, 91, 91,
91, 91, 91, 91, 91, 91, 92, 92, 92, 92,
92, 92, 92, 92, 93, 93, 93, 93, 93, 93,
93, 93, 94, 84, 94, 94, 94, 94, 94, 94,
95, 95, 97, 83, 97, 82, 97, 97, 97, 97,
98, 80, 98, 98, 98, 98, 98, 98, 99, 99,
79, 99, 99, 99, 99, 100, 100, 100, 100, 100,
100, 100, 100, 101, 101, 101, 101, 101, 101, 102,
102, 102, 102, 102, 102, 102, 102, 103, 78, 103,
103, 103, 103, 103, 103, 76, 74, 73, 72, 71,
70, 69, 68, 53, 52, 51, 50, 49, 48, 40,
32, 25, 24, 23, 22, 16, 9, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90
} ;
static aag_state_type aag_last_accepting_state;
static char *aag_last_accepting_cpos;
#define REJECT reject_used_but_not_detected
#define aagmore() aagmore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *aagtext;
#line 1 "/home/ellson/graphviz/agraph/scan.l"
#define INITIAL 0
#line 13 "/home/ellson/graphviz/agraph/scan.l"
#pragma prototyped
#include <grammar.h>
#include <aghdr.h>
#define GRAPH_EOF_TOKEN '@'
static int line_num = 1;
static int html_nest = 0;
static char* InputFile;
static Agdisc_t *Disc;
static void *Ifile;
void agreadline(int n) { line_num = n; }
void agsetfile(char* f) { InputFile = f; line_num = 1; }
void aglexinit(Agdisc_t *disc, void *ifile) { Disc = disc; Ifile = ifile;}
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ((result = Disc->io->afread(Ifile, buf, max_size)) < 0) \
YY_FATAL_ERROR( "input in flex scanner failed" )
#endif
static char *Sbuf,*Sptr,*Send;
static void beginstr(void) {
if (Sbuf == NIL(char*)) {
Sbuf = malloc(BUFSIZ);
Send = Sbuf + BUFSIZ;
}
Sptr = Sbuf;
*Sptr = 0;
}
static void addstr(char *src) {
char c;
if (Sptr > Sbuf) Sptr--;
do {
do {c = *Sptr++ = *src++;} while (c && (Sptr < Send));
if (c) {
long sz = Send - Sbuf;
long off = Sptr - Sbuf;
sz *= 2;
Sbuf = (char*)realloc(Sbuf,sz);
Send = Sbuf + sz;
Sptr = Sbuf + off;
}
} while (c);
}
static void endstr(void) {
aaglval.str = (char*)agstrdup(Ag_G_global,Sbuf);
}
static int chkNum(void) {
char c = aagtext[aagleng-1];
if (!isdigit(c) && (c != '.')) {
char buf[BUFSIZ];
sprintf(buf,"badly formed number '%s' in line %d\n",aagtext,line_num);
strcat (buf, "Splits into two name tokens");
agerror(AGERROR_SYNTAX,buf);
return 1;
}
else return 0;
}
#define comment 1
#define qstring 2
#define hstring 3
#line 543 "lex.aag.c"
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int aagwrap YY_PROTO(( void ));
#else
extern int aagwrap YY_PROTO(( void ));
#endif
#endif
#ifndef YY_NO_UNPUT
static void aagunput YY_PROTO(( int c, char *buf_ptr ));
#endif
#ifndef aagtext_ptr
static void aag_flex_strncpy YY_PROTO(( char *, aagconst char *, int ));
#endif
#ifdef YY_NEED_STRLEN
static int aag_flex_strlen YY_PROTO(( aagconst char * ));
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int aaginput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif
#endif
#if YY_STACK_USED
static int aag_start_stack_ptr = 0;
static int aag_start_stack_depth = 0;
static int *aag_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void aag_push_state YY_PROTO(( int new_state ));
#endif
#ifndef YY_NO_POP_STATE
static void aag_pop_state YY_PROTO(( void ));
#endif
#ifndef YY_NO_TOP_STATE
static int aag_top_state YY_PROTO(( void ));
#endif
#else
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#endif
#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
#endif
#endif
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif
#ifndef ECHO
#define ECHO (void) fwrite( aagtext, aagleng, 1, aagout )
#endif
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( aag_current_buffer->aag_is_interactive ) \
{ \
int c = '*', n; \
for ( n = 0; n < max_size && \
(c = getc( aagin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( aagin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else if ( ((result = fread( buf, 1, max_size, aagin )) == 0) \
&& ferror( aagin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
#ifndef aagterminate
#define aagterminate() return YY_NULL
#endif
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) aag_fatal_error( msg )
#endif
#ifndef YY_DECL
#define YY_DECL int aaglex YY_PROTO(( void ))
#endif
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
#ifndef YY_BREAK
#define YY_BREAK break;
#endif
#define YY_RULE_SETUP \
YY_USER_ACTION
YY_DECL
{
register aag_state_type aag_current_state;
register char *aag_cp = NULL, *aag_bp = NULL;
register int aag_act;
#line 108 "/home/ellson/graphviz/agraph/scan.l"
#line 696 "lex.aag.c"
if ( aag_init )
{
aag_init = 0;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
if ( ! aag_start )
aag_start = 1;
if ( ! aagin )
aagin = stdin;
if ( ! aagout )
aagout = stdout;
if ( ! aag_current_buffer )
aag_current_buffer =
aag_create_buffer( aagin, YY_BUF_SIZE );
aag_load_buffer_state();
}
while ( 1 )
{
aag_cp = aag_c_buf_p;
*aag_cp = aag_hold_char;
aag_bp = aag_cp;
aag_current_state = aag_start;
aag_match:
do
{
register YY_CHAR aag_c = aag_ec[YY_SC_TO_UI(*aag_cp)];
if ( aag_accept[aag_current_state] )
{
aag_last_accepting_state = aag_current_state;
aag_last_accepting_cpos = aag_cp;
}
while ( aag_chk[aag_base[aag_current_state] + aag_c] != aag_current_state )
{
aag_current_state = (int) aag_def[aag_current_state];
if ( aag_current_state >= 91 )
aag_c = aag_meta[(unsigned int) aag_c];
}
aag_current_state = aag_nxt[aag_base[aag_current_state] + (unsigned int) aag_c];
++aag_cp;
}
while ( aag_base[aag_current_state] != 188 );
aag_find_action:
aag_act = aag_accept[aag_current_state];
if ( aag_act == 0 )
{
aag_cp = aag_last_accepting_cpos;
aag_current_state = aag_last_accepting_state;
aag_act = aag_accept[aag_current_state];
}
YY_DO_BEFORE_ACTION;
do_action:
switch ( aag_act )
{
case 0:
*aag_cp = aag_hold_char;
aag_cp = aag_last_accepting_cpos;
aag_current_state = aag_last_accepting_state;
goto aag_find_action;
case 1:
YY_RULE_SETUP
#line 109 "/home/ellson/graphviz/agraph/scan.l"
return(EOF);
YY_BREAK
case 2:
YY_RULE_SETUP
#line 110 "/home/ellson/graphviz/agraph/scan.l"
line_num++;
YY_BREAK
case 3:
YY_RULE_SETUP
#line 111 "/home/ellson/graphviz/agraph/scan.l"
BEGIN(comment);
YY_BREAK
case 4:
YY_RULE_SETUP
#line 112 "/home/ellson/graphviz/agraph/scan.l"
YY_BREAK
case 5:
YY_RULE_SETUP
#line 113 "/home/ellson/graphviz/agraph/scan.l"
YY_BREAK
case 6:
YY_RULE_SETUP
#line 114 "/home/ellson/graphviz/agraph/scan.l"
BEGIN(INITIAL);
YY_BREAK
case 7:
YY_RULE_SETUP
#line 115 "/home/ellson/graphviz/agraph/scan.l"
YY_BREAK
case 8:
YY_RULE_SETUP
#line 116 "/home/ellson/graphviz/agraph/scan.l"
YY_BREAK
case 9:
YY_RULE_SETUP
#line 117 "/home/ellson/graphviz/agraph/scan.l"
YY_BREAK
case 10:
YY_RULE_SETUP
#line 118 "/home/ellson/graphviz/agraph/scan.l"
return(T_node);
YY_BREAK
case 11:
YY_RULE_SETUP
#line 119 "/home/ellson/graphviz/agraph/scan.l"
return(T_edge);
YY_BREAK
case 12:
YY_RULE_SETUP
#line 120 "/home/ellson/graphviz/agraph/scan.l"
return(T_graph);
YY_BREAK
case 13:
YY_RULE_SETUP
#line 121 "/home/ellson/graphviz/agraph/scan.l"
return(T_digraph);
YY_BREAK
case 14:
YY_RULE_SETUP
#line 122 "/home/ellson/graphviz/agraph/scan.l"
return(T_strict);
YY_BREAK
case 15:
YY_RULE_SETUP
#line 123 "/home/ellson/graphviz/agraph/scan.l"
return(T_subgraph);
YY_BREAK
case 16:
YY_RULE_SETUP
#line 124 "/home/ellson/graphviz/agraph/scan.l"
return(T_edgeop);
YY_BREAK
case 17:
YY_RULE_SETUP
#line 125 "/home/ellson/graphviz/agraph/scan.l"
{ aaglval.str = (char*)agstrdup(Ag_G_global,aagtext); return(T_atom); }
YY_BREAK
case 18:
YY_RULE_SETUP
#line 126 "/home/ellson/graphviz/agraph/scan.l"
{ if (chkNum()) aagless(aagleng-1); aaglval.str = (char*)agstrdup(Ag_G_global,aagtext); return(T_atom); }
YY_BREAK
case 19:
YY_RULE_SETUP
#line 127 "/home/ellson/graphviz/agraph/scan.l"
BEGIN(qstring); beginstr();
YY_BREAK
case 20:
YY_RULE_SETUP
#line 128 "/home/ellson/graphviz/agraph/scan.l"
BEGIN(INITIAL); endstr(); return (T_qatom);
YY_BREAK
case 21:
YY_RULE_SETUP
#line 129 "/home/ellson/graphviz/agraph/scan.l"
line_num++;
YY_BREAK
case 22:
YY_RULE_SETUP
#line 130 "/home/ellson/graphviz/agraph/scan.l"
addstr(aagtext);
YY_BREAK
case 23:
YY_RULE_SETUP
#line 131 "/home/ellson/graphviz/agraph/scan.l"
BEGIN(hstring); html_nest = 1; beginstr();
YY_BREAK
case 24:
YY_RULE_SETUP
#line 132 "/home/ellson/graphviz/agraph/scan.l"
html_nest--; if (html_nest) addstr(aagtext); else {BEGIN(INITIAL); endstr(); return (T_qatom);}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 133 "/home/ellson/graphviz/agraph/scan.l"
html_nest++; addstr(aagtext);
YY_BREAK
case 26:
YY_RULE_SETUP
#line 134 "/home/ellson/graphviz/agraph/scan.l"
addstr("<");
YY_BREAK
case 27:
YY_RULE_SETUP
#line 135 "/home/ellson/graphviz/agraph/scan.l"
addstr(">");
YY_BREAK
case 28:
YY_RULE_SETUP
#line 136 "/home/ellson/graphviz/agraph/scan.l"
line_num++;
YY_BREAK
case 29:
YY_RULE_SETUP
#line 137 "/home/ellson/graphviz/agraph/scan.l"
addstr(aagtext);
YY_BREAK
case 30:
YY_RULE_SETUP
#line 138 "/home/ellson/graphviz/agraph/scan.l"
return (aagtext[0]);
YY_BREAK
case 31:
YY_RULE_SETUP
#line 139 "/home/ellson/graphviz/agraph/scan.l"
ECHO;
YY_BREAK
#line 934 "lex.aag.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(comment):
case YY_STATE_EOF(qstring):
case YY_STATE_EOF(hstring):
aagterminate();
case YY_END_OF_BUFFER:
{
int aag_amount_of_matched_text = (int) (aag_cp - aagtext_ptr) - 1;
*aag_cp = aag_hold_char;
YY_RESTORE_YY_MORE_OFFSET
if ( aag_current_buffer->aag_buffer_status == YY_BUFFER_NEW )
{
aag_n_chars = aag_current_buffer->aag_n_chars;
aag_current_buffer->aag_input_file = aagin;
aag_current_buffer->aag_buffer_status = YY_BUFFER_NORMAL;
}
if ( aag_c_buf_p <= &aag_current_buffer->aag_ch_buf[aag_n_chars] )
{
aag_state_type aag_next_state;
aag_c_buf_p = aagtext_ptr + aag_amount_of_matched_text;
aag_current_state = aag_get_previous_state();
aag_next_state = aag_try_NUL_trans( aag_current_state );
aag_bp = aagtext_ptr + YY_MORE_ADJ;
if ( aag_next_state )
{
aag_cp = ++aag_c_buf_p;
aag_current_state = aag_next_state;
goto aag_match;
}
else
{
aag_cp = aag_c_buf_p;
goto aag_find_action;
}
}
else switch ( aag_get_next_buffer() )
{
case EOB_ACT_END_OF_FILE:
{
aag_did_buffer_switch_on_eof = 0;
if ( aagwrap() )
{
aag_c_buf_p = aagtext_ptr + YY_MORE_ADJ;
aag_act = YY_STATE_EOF(YY_START);
goto do_action;
}
else
{
if ( ! aag_did_buffer_switch_on_eof )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
aag_c_buf_p =
aagtext_ptr + aag_amount_of_matched_text;
aag_current_state = aag_get_previous_state();
aag_cp = aag_c_buf_p;
aag_bp = aagtext_ptr + YY_MORE_ADJ;
goto aag_match;
case EOB_ACT_LAST_MATCH:
aag_c_buf_p =
&aag_current_buffer->aag_ch_buf[aag_n_chars];
aag_current_state = aag_get_previous_state();
aag_cp = aag_c_buf_p;
aag_bp = aagtext_ptr + YY_MORE_ADJ;
goto aag_find_action;
}
break;
}
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
}
}
}
static int aag_get_next_buffer()
{
register char *dest = aag_current_buffer->aag_ch_buf;
register char *source = aagtext_ptr;
register int number_to_move, i;
int ret_val;
if ( aag_c_buf_p > &aag_current_buffer->aag_ch_buf[aag_n_chars + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( aag_current_buffer->aag_fill_buffer == 0 )
{
if ( aag_c_buf_p - aagtext_ptr - YY_MORE_ADJ == 1 )
{
return EOB_ACT_END_OF_FILE;
}
else
{
return EOB_ACT_LAST_MATCH;
}
}
number_to_move = (int) (aag_c_buf_p - aagtext_ptr) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( aag_current_buffer->aag_buffer_status == YY_BUFFER_EOF_PENDING )
aag_current_buffer->aag_n_chars = aag_n_chars = 0;
else
{
int num_to_read =
aag_current_buffer->aag_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{
#ifdef YY_USES_REJECT
YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else
YY_BUFFER_STATE b = aag_current_buffer;
int aag_c_buf_p_offset =
(int) (aag_c_buf_p - b->aag_ch_buf);
if ( b->aag_is_our_buffer )
{
int new_size = b->aag_buf_size * 2;
if ( new_size <= 0 )
b->aag_buf_size += b->aag_buf_size / 8;
else
b->aag_buf_size *= 2;
b->aag_ch_buf = (char *)
aag_flex_realloc( (void *) b->aag_ch_buf,
b->aag_buf_size + 2 );
}
else
b->aag_ch_buf = 0;
if ( ! b->aag_ch_buf )
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
aag_c_buf_p = &b->aag_ch_buf[aag_c_buf_p_offset];
num_to_read = aag_current_buffer->aag_buf_size -
number_to_move - 1;
#endif
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
YY_INPUT( (&aag_current_buffer->aag_ch_buf[number_to_move]),
aag_n_chars, num_to_read );
aag_current_buffer->aag_n_chars = aag_n_chars;
}
if ( aag_n_chars == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
aagrestart( aagin );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
aag_current_buffer->aag_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
aag_n_chars += number_to_move;
aag_current_buffer->aag_ch_buf[aag_n_chars] = YY_END_OF_BUFFER_CHAR;
aag_current_buffer->aag_ch_buf[aag_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
aagtext_ptr = &aag_current_buffer->aag_ch_buf[0];
return ret_val;
}
static aag_state_type aag_get_previous_state()
{
register aag_state_type aag_current_state;
register char *aag_cp;
aag_current_state = aag_start;
for ( aag_cp = aagtext_ptr + YY_MORE_ADJ; aag_cp < aag_c_buf_p; ++aag_cp )
{
register YY_CHAR aag_c = (*aag_cp ? aag_ec[YY_SC_TO_UI(*aag_cp)] : 1);
if ( aag_accept[aag_current_state] )
{
aag_last_accepting_state = aag_current_state;
aag_last_accepting_cpos = aag_cp;
}
while ( aag_chk[aag_base[aag_current_state] + aag_c] != aag_current_state )
{
aag_current_state = (int) aag_def[aag_current_state];
if ( aag_current_state >= 91 )
aag_c = aag_meta[(unsigned int) aag_c];
}
aag_current_state = aag_nxt[aag_base[aag_current_state] + (unsigned int) aag_c];
}
return aag_current_state;
}
#ifdef YY_USE_PROTOS
static aag_state_type aag_try_NUL_trans( aag_state_type aag_current_state )
#else
static aag_state_type aag_try_NUL_trans( aag_current_state )
aag_state_type aag_current_state;
#endif
{
register int aag_is_jam;
register char *aag_cp = aag_c_buf_p;
register YY_CHAR aag_c = 1;
if ( aag_accept[aag_current_state] )
{
aag_last_accepting_state = aag_current_state;
aag_last_accepting_cpos = aag_cp;
}
while ( aag_chk[aag_base[aag_current_state] + aag_c] != aag_current_state )
{
aag_current_state = (int) aag_def[aag_current_state];
if ( aag_current_state >= 91 )
aag_c = aag_meta[(unsigned int) aag_c];
}
aag_current_state = aag_nxt[aag_base[aag_current_state] + (unsigned int) aag_c];
aag_is_jam = (aag_current_state == 90);
return aag_is_jam ? 0 : aag_current_state;
}
#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void aagunput( int c, register char *aag_bp )
#else
static void aagunput( c, aag_bp )
int c;
register char *aag_bp;
#endif
{
register char *aag_cp = aag_c_buf_p;
*aag_cp = aag_hold_char;
if ( aag_cp < aag_current_buffer->aag_ch_buf + 2 )
{
register int number_to_move = aag_n_chars + 2;
register char *dest = &aag_current_buffer->aag_ch_buf[
aag_current_buffer->aag_buf_size + 2];
register char *source =
&aag_current_buffer->aag_ch_buf[number_to_move];
while ( source > aag_current_buffer->aag_ch_buf )
*--dest = *--source;
aag_cp += (int) (dest - source);
aag_bp += (int) (dest - source);
aag_current_buffer->aag_n_chars =
aag_n_chars = aag_current_buffer->aag_buf_size;
if ( aag_cp < aag_current_buffer->aag_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--aag_cp = (char) c;
aagtext_ptr = aag_bp;
aag_hold_char = *aag_cp;
aag_c_buf_p = aag_cp;
}
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int aaginput()
#else
static int input()
#endif
{
int c;
*aag_c_buf_p = aag_hold_char;
if ( *aag_c_buf_p == YY_END_OF_BUFFER_CHAR )
{
if ( aag_c_buf_p < &aag_current_buffer->aag_ch_buf[aag_n_chars] )
*aag_c_buf_p = '\0';
else
{
int offset = aag_c_buf_p - aagtext_ptr;
++aag_c_buf_p;
switch ( aag_get_next_buffer() )
{
case EOB_ACT_LAST_MATCH:
aagrestart( aagin );
case EOB_ACT_END_OF_FILE:
{
if ( aagwrap() )
return EOF;
if ( ! aag_did_buffer_switch_on_eof )
YY_NEW_FILE;
#ifdef __cplusplus
return aaginput();
#else
return input();
#endif
}
case EOB_ACT_CONTINUE_SCAN:
aag_c_buf_p = aagtext_ptr + offset;
break;
}
}
}
c = *(unsigned char *) aag_c_buf_p;
*aag_c_buf_p = '\0';
aag_hold_char = *++aag_c_buf_p;
return c;
}
#endif
#ifdef YY_USE_PROTOS
void aagrestart( FILE *input_file )
#else
void aagrestart( input_file )
FILE *input_file;
#endif
{
if ( ! aag_current_buffer )
aag_current_buffer = aag_create_buffer( aagin, YY_BUF_SIZE );
aag_init_buffer( aag_current_buffer, input_file );
aag_load_buffer_state();
}
#ifdef YY_USE_PROTOS
void aag_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void aag_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
{
if ( aag_current_buffer == new_buffer )
return;
if ( aag_current_buffer )
{
*aag_c_buf_p = aag_hold_char;
aag_current_buffer->aag_buf_pos = aag_c_buf_p;
aag_current_buffer->aag_n_chars = aag_n_chars;
}
aag_current_buffer = new_buffer;
aag_load_buffer_state();
aag_did_buffer_switch_on_eof = 1;
}
#ifdef YY_USE_PROTOS
void aag_load_buffer_state( void )
#else
void aag_load_buffer_state()
#endif
{
aag_n_chars = aag_current_buffer->aag_n_chars;
aagtext_ptr = aag_c_buf_p = aag_current_buffer->aag_buf_pos;
aagin = aag_current_buffer->aag_input_file;
aag_hold_char = *aag_c_buf_p;
}
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE aag_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE aag_create_buffer( file, size )
FILE *file;
int size;
#endif
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) aag_flex_alloc( sizeof( struct aag_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in aag_create_buffer()" );
b->aag_buf_size = size;
b->aag_ch_buf = (char *) aag_flex_alloc( b->aag_buf_size + 2 );
if ( ! b->aag_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in aag_create_buffer()" );
b->aag_is_our_buffer = 1;
aag_init_buffer( b, file );
return b;
}
#ifdef YY_USE_PROTOS
void aag_delete_buffer( YY_BUFFER_STATE b )
#else
void aag_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
{
if ( ! b )
return;
if ( b == aag_current_buffer )
aag_current_buffer = (YY_BUFFER_STATE) 0;
if ( b->aag_is_our_buffer )
aag_flex_free( (void *) b->aag_ch_buf );
aag_flex_free( (void *) b );
}
#ifdef YY_USE_PROTOS
void aag_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void aag_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif
{
aag_flush_buffer( b );
b->aag_input_file = file;
b->aag_fill_buffer = 1;
#if YY_ALWAYS_INTERACTIVE
b->aag_is_interactive = 1;
#else
#if YY_NEVER_INTERACTIVE
b->aag_is_interactive = 0;
#else
b->aag_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif
#endif
}
#ifdef YY_USE_PROTOS
void aag_flush_buffer( YY_BUFFER_STATE b )
#else
void aag_flush_buffer( b )
YY_BUFFER_STATE b;
#endif
{
if ( ! b )
return;
b->aag_n_chars = 0;
b->aag_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->aag_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->aag_buf_pos = &b->aag_ch_buf[0];
b->aag_at_bol = 1;
b->aag_buffer_status = YY_BUFFER_NEW;
if ( b == aag_current_buffer )
aag_load_buffer_state();
}
#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE aag_scan_buffer( char *base, aag_size_t size )
#else
YY_BUFFER_STATE aag_scan_buffer( base, size )
char *base;
aag_size_t size;
#endif
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
return 0;
b = (YY_BUFFER_STATE) aag_flex_alloc( sizeof( struct aag_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in aag_scan_buffer()" );
b->aag_buf_size = size - 2;
b->aag_buf_pos = b->aag_ch_buf = base;
b->aag_is_our_buffer = 0;
b->aag_input_file = 0;
b->aag_n_chars = b->aag_buf_size;
b->aag_is_interactive = 0;
b->aag_at_bol = 1;
b->aag_fill_buffer = 0;
b->aag_buffer_status = YY_BUFFER_NEW;
aag_switch_to_buffer( b );
return b;
}
#endif
#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE aag_scan_string( aagconst char *aag_str )
#else
YY_BUFFER_STATE aag_scan_string( aag_str )
aagconst char *aag_str;
#endif
{
int len;
for ( len = 0; aag_str[len]; ++len )
;
return aag_scan_bytes( aag_str, len );
}
#endif
#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE aag_scan_bytes( aagconst char *bytes, int len )
#else
YY_BUFFER_STATE aag_scan_bytes( bytes, len )
aagconst char *bytes;
int len;
#endif
{
YY_BUFFER_STATE b;
char *buf;
aag_size_t n;
int i;
n = len + 2;
buf = (char *) aag_flex_alloc( n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in aag_scan_bytes()" );
for ( i = 0; i < len; ++i )
buf[i] = bytes[i];
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
b = aag_scan_buffer( buf, n );
if ( ! b )
YY_FATAL_ERROR( "bad buffer in aag_scan_bytes()" );
b->aag_is_our_buffer = 1;
return b;
}
#endif
#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void aag_push_state( int new_state )
#else
static void aag_push_state( new_state )
int new_state;
#endif
{
if ( aag_start_stack_ptr >= aag_start_stack_depth )
{
aag_size_t new_size;
aag_start_stack_depth += YY_START_STACK_INCR;
new_size = aag_start_stack_depth * sizeof( int );
if ( ! aag_start_stack )
aag_start_stack = (int *) aag_flex_alloc( new_size );
else
aag_start_stack = (int *) aag_flex_realloc(
(void *) aag_start_stack, new_size );
if ( ! aag_start_stack )
YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
}
aag_start_stack[aag_start_stack_ptr++] = YY_START;
BEGIN(new_state);
}
#endif
#ifndef YY_NO_POP_STATE
static void aag_pop_state()
{
if ( --aag_start_stack_ptr < 0 )
YY_FATAL_ERROR( "start-condition stack underflow" );
BEGIN(aag_start_stack[aag_start_stack_ptr]);
}
#endif
#ifndef YY_NO_TOP_STATE
static int aag_top_state()
{
return aag_start_stack[aag_start_stack_ptr - 1];
}
#endif
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif
#ifdef YY_USE_PROTOS
static void aag_fatal_error( aagconst char msg[] )
#else
static void aag_fatal_error( msg )
char msg[];
#endif
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
#undef aagless
#define aagless(n) \
do \
{ \
\
aagtext[aagleng] = aag_hold_char; \
aag_c_buf_p = aagtext + n; \
aag_hold_char = *aag_c_buf_p; \
*aag_c_buf_p = '\0'; \
aagleng = n; \
} \
while ( 0 )
#ifndef aagtext_ptr
#ifdef YY_USE_PROTOS
static void aag_flex_strncpy( char *s1, aagconst char *s2, int n )
#else
static void aag_flex_strncpy( s1, s2, n )
char *s1;
aagconst char *s2;
int n;
#endif
{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
#ifdef YY_USE_PROTOS
static int aag_flex_strlen( aagconst char *s )
#else
static int aag_flex_strlen( s )
aagconst char *s;
#endif
{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
#ifdef YY_USE_PROTOS
static void *aag_flex_alloc( aag_size_t size )
#else
static void *aag_flex_alloc( size )
aag_size_t size;
#endif
{
return (void *) malloc( size );
}
#ifdef YY_USE_PROTOS
static void *aag_flex_realloc( void *ptr, aag_size_t size )
#else
static void *aag_flex_realloc( ptr, size )
void *ptr;
aag_size_t size;
#endif
{
return (void *) realloc( (char *) ptr, size );
}
#ifdef YY_USE_PROTOS
static void aag_flex_free( void *ptr )
#else
static void aag_flex_free( ptr )
void *ptr;
#endif
{
free( ptr );
}
#if YY_MAIN
int main()
{
aaglex();
return 0;
}
#endif
#line 139 "/home/ellson/graphviz/agraph/scan.l"
void aagerror(char *str)
{
char buf[BUFSIZ];
if (InputFile)
sprintf(buf,"%s:%d: %s in line %d near '%s'",InputFile, line_num,
str,line_num,aagtext);
else
sprintf(buf," %s in line %d near '%s'", str,line_num,aagtext);
agerror(AGERROR_SYNTAX,buf);
}
void aglexeof() { unput(GRAPH_EOF_TOKEN); }
#ifndef YY_CALL_ONLY_ARG
# define YY_CALL_ONLY_ARG void
#endif
int aagwrap(YY_CALL_ONLY_ARG)
{
return 1;
}