Commit Graph

645 Commits

Author SHA1 Message Date
Thomas Jensen
3baafb88f2 Added begin_speedmode() which is called by parser.y
Added state SPEEDMODE for fast skipping of designs
Introduced definitions for PWORD, PBOX, and PWHITE (whitespace)
Added %options nounput and noyywrap for easier compilation/linking
1999-07-02 11:58:15 +00:00
Thomas Jensen
dcaccc130c Some minor changes to please compiler
Communication of speed mode to lexer
Bugfix: Forgot to check for opt.l before calling YYACCEPT
1999-07-02 11:54:52 +00:00
Thomas Jensen
bc4f97a31b Added parser.h header file for lexer-parser communication
Moved from yacc to GNU "bison --yacc"
No longer linking with flex library
Activated -Wall -W for parser.y
Removed -DYY_NO_UNPUT from lexer compilation (now done via file option)
1999-07-02 11:50:35 +00:00
Thomas Jensen
66e1c2b429 Initial revision 1999-07-02 11:47:11 +00:00
Thomas Jensen
529c3f1f65 Added [lcr] "shorthand" to -a option 1999-06-30 12:37:25 +00:00
Thomas Jensen
27c41667ef Removed DEF_DESIGN macro, because it now defaults to first design
Removed some porting code, hoping for autoconf future
Added PARSER_DEBUG and LEXER_DEBUG macros
1999-06-30 12:19:12 +00:00
Thomas Jensen
bce140bf46 Removed entire select_design stuff, because the parser now return much
smaller data structures. The first design pointed to by designs is always
the one we need (except for ops on *all* designs).
The first design in config file is now default design (no DEF_DESIGN anymore).
1999-06-30 12:16:38 +00:00
Thomas Jensen
d8f249e53f Now parsing only those designs which will be needed later on
Checks formerly done in boxes.c now done here (no valid designs etc.)
1999-06-30 12:13:47 +00:00
Thomas Jensen
49f83560b0 Moved "C" design to first position in file, so it remains the default
Changed netdata design to use padding option and reversion
1999-06-28 18:42:19 +00:00
Thomas Jensen
3640421283 Replaced DEBUG macro with LEXER_DEBUG, which is now activated in boxes.h
New tokens to, with, global, once
Added LEX_MAX_WARN macro to limit number of lex errors printed per design
Replaced exit()s with return YUNREC where errors are not fatal
1999-06-28 18:37:38 +00:00
Thomas Jensen
93793ba1a2 Unified appearance of error messages, which are now all based on yyerror()
Eliminated duplicate code by introducing intermediate rules
New tokens YTO, YWITH, and YRXPFLAG to reduce strcasecmp() usage
New token YUNREC for integration of lexer into error handling
Some code restructuring and rule renaming for better consistency
Added out-of-memory-checks to many strdup()s and such
1999-06-28 18:32:51 +00:00
Thomas Jensen
ef582a464c Added macro SNAPFILE for boxes-SNAP-date +%Y%m%d
Added target rcstest
Now builds optimized code by default
Added debug target for non-optimized code w/ debugging info
1999-06-28 12:21:34 +00:00
Thomas Jensen
5717471559 Moved parser init and cleanup from main() to parser.y
Some further cleanup in main()
1999-06-28 12:19:29 +00:00
Thomas Jensen
9020675926 Added tokens YBOX and YEND (thus, BOX and END are no longer YKEYWORDs)
Added #define FILE_LEXER_L around #include boxes.h to please compiler
1999-06-28 12:17:46 +00:00
Thomas Jensen
884e18072d Added error handling. Now skips to next design on error.
Replaced DEBUG macro with PARSER_DEBUG, which is now activated in boxes.h
Added rule first_rule, which performs init and cleanup formerly done in main()
Introduced symbols YBOX and YEND
1999-06-28 12:15:47 +00:00
Thomas Jensen
8ca615b7b0 Added design c-cmt2
Added padding entries to a few designs
A few cosmetic corrections in sample blocks etc.
1999-06-27 17:59:50 +00:00
Thomas Jensen
b3fb4bade2 Commented out regerror() protoype which is now exported by tools.h 1999-06-25 18:53:51 +00:00
Thomas Jensen
b51b8e108a Added empty_side() prototype 1999-06-25 18:52:59 +00:00
Thomas Jensen
0038f52681 Added empty_side() function from boxes.c
Removed #include regexp.h
1999-06-25 18:52:28 +00:00
Thomas Jensen
6e23417d1f Removed empty_side() prototype (now in shape.h)
Added indentmode and justify members to command line options struct
1999-06-25 18:51:04 +00:00
Thomas Jensen
e9f3b88ef9 Bugfix: Mixed up SW and NE in padding calculation (tricky, that one)
Added indent mode command line option for grammar overrides
Moved empty_side() to shape.c after small change in signature
Added text-in-block justification (j) to alignment option (-a)
1999-06-25 18:46:39 +00:00
Thomas Jensen
93763e64ec Added initialization of mmok to please compiler
Changed parameters of empty_side() calls to comply with new signature
1999-06-25 18:45:33 +00:00
Thomas Jensen
1996a361ed Added output_box() function 1999-06-25 18:45:12 +00:00
Thomas Jensen
0c9f7cb04f Added justify_line() function for alignment of lines inside the text block
Cleaned up hfill calculation in output_box()
Changed parameters of empty_side() calls to comply with new signature
1999-06-25 18:42:50 +00:00
Thomas Jensen
26e3a95bbe Added remove.o and generate.o
Introduced implicit rule .c.o, simplifying commands for most sources
1999-06-23 19:35:17 +00:00
Thomas Jensen
d983743471 Added output_box() from boxes.c 1999-06-23 19:23:55 +00:00
Thomas Jensen
f8774543a9 Now exporting anz_designs, input, and empty_side()
Added #include regexp.h back
1999-06-23 19:21:15 +00:00
Thomas Jensen
e88470677d Removed snprintf() and vsnprintf() prototypes (why were they in anyway?)
along with stdarg.h include
Exported input global data and empty_side() function
Declared non-exported functions static
Moved horiz_precalc(), vert_precalc(), horiz_assemble(), vert_assemble(),
horiz_generate(), vert_generate(), generate_box() and output_box() to a
new file generate.c
Moved best_match(), hmm(), detect_horiz(), detect_design(), remove_box()
and output_input() to a new file remove.c
1999-06-23 19:17:27 +00:00
Thomas Jensen
79555dbf29 Initial revision 1999-06-23 19:14:53 +00:00
Thomas Jensen
16ecdbb777 Initial revision 1999-06-23 18:52:54 +00:00
Thomas Jensen
0202a4edab Moved some data structures and macros related to shapes to shape.h
Added #ifdef DEBUG around __TJ() macro for convenience
1999-06-23 12:33:49 +00:00
Thomas Jensen
5ffccab2b7 Improvements on design detection (could still be better though)
Moved iscorner(), on_side(), isempty(), shapecmp(), both_on_side(),
shape_distance(), empty_side(), highest(), and widest() as well as
some data structures and macros related to shapes to new file shape.c
1999-06-23 12:31:26 +00:00
Thomas Jensen
b73a59a3e0 Added tools.o and shape.o
Change in snapshot target directory (download)
Added GENSRC, HSSRC, ORIGSRC, ALLSRC, and ALLOBJ macros for more order
1999-06-23 12:27:50 +00:00
Thomas Jensen
b5630aa4dc Initial revision 1999-06-23 12:26:59 +00:00
Thomas Jensen
77e0ce8550 Initial revision 1999-06-23 11:19:30 +00:00
Thomas Jensen
20b4ff599b Removed #pragma ident string and added version comment instead 1999-06-22 12:12:05 +00:00
Thomas Jensen
46844f8983 DEBUGging is now activated in boxes.h
Moved MAX_TABSTOP, LINE_MAX macros to boxes.h
Moved BMAX, strrstr, btrim(), yyerror(), expand_tabs_into(), regerror(),
empty_line() to a new file tools.c, added #include tools.h
Some cleanup in main()
Declared style_sort() helper function static
Renamed strrstr() to my_strnrstr() (now defined in tools.c)
Default design is now defined by DEF_DESIGN macro
Moved struct opt_t to boxes.h
Bugfix: segfaulted if shape was bigger than input when detecting design
Bugfix: Padding was not removed when box was removed
Bugfix: Forgot null byte when removing west box side
Changed select_design(), because default design value now set in process_commandline()
1999-06-22 12:03:33 +00:00
Thomas Jensen
3f8cdd1803 Added DEF_DESIGN (default design name)
Added opt_t and opt global variable from boxes.c
Moved BFREE macro and yyerror() and empty_line() prototypes to tools.h
Added LINE_MAX and MAX_TABSTOP macros from boxes.c
Added #define DEBUG and REGEXP_DEBUG. This will centrally activate
debugging.
1999-06-22 12:01:24 +00:00
Thomas Jensen
43e877f2f9 Added #undef DEBUG, because DEBUGging is now activated in boxes.h
Added #include tools.h
1999-06-22 12:00:05 +00:00
Thomas Jensen
e0b1b6f9bb Added code for padding handling (-p)
Added BMAX macro (returns maximum of two values)
1999-06-20 14:20:29 +00:00
Thomas Jensen
a95cc59dff Added padding member to design struct 1999-06-20 14:19:31 +00:00
Thomas Jensen
7d265b2273 Adden YPADDING and YNUMBER tokens plus code for padding blocks 1999-06-20 14:18:51 +00:00
Thomas Jensen
d1079fdf7f Added "padding" keyword and recogintion of numbers (YNUMBER) 1999-06-20 14:17:58 +00:00
Thomas Jensen
56de91b3c8 Removed #pragma ident "string"
Changed VERSION to 1.0 beta
Added line_t and empty_line() prototype
1999-06-17 19:08:50 +00:00
Thomas Jensen
c4cfb92c8a Moved line_t to boxes.h
empty_line() now also considers \r and \n whitespace
Added empty_side() function
Added handling of empty box sides in output_box()
1999-06-17 19:07:06 +00:00
Thomas Jensen
5cd3e9f898 Bugfix: Sample block analysis didn't handle empty blocks 1999-06-17 19:05:46 +00:00
Thomas Jensen
80fb0649a8 Added detection of empty sample blocks (we don't want that)
Added detection of duplicate sample blocks
1999-06-17 19:04:45 +00:00
Thomas Jensen
215f312b73 Added designs c-cmt, pound-cmt, java-cmt, html-cmt, right, vim-cmt
They have become possible because boxes now checks for empty sides.
1999-06-17 19:03:09 +00:00
Thomas Jensen
c19d1b0977 Added "reverse" entry for testing, more "reverse" entries needed still
Added "peek" design for C funtion headers
Simplified some replacement entries
1999-06-16 10:52:59 +00:00
Thomas Jensen
f3bdc853b3 Removed a stray debug message
Move apply_substitutions() regexp handling function up in file
Use apply_substitutions() in read_input() routine also
Moved "extern int yyparse()" prototype to start of file
1999-06-15 12:07:39 +00:00