1
0
mirror of synced 2026-02-27 01:10:26 +00:00

*** empty log message ***

This commit is contained in:
Eric Smith
2001-12-29 17:45:43 +00:00
parent 2897b33920
commit 1dbfe36f72
6 changed files with 41 additions and 39 deletions

View File

@@ -1,6 +1,6 @@
# tiffg4: reencode a bilevel TIFF file as a single-strip TIFF Class F Group 4
# tiff2pdf: build a PDF file out of one or more TIFF Class F Group 4 files
# Makefile
# $Id: Makefile,v 1.3 2001/12/27 20:44:15 eric Exp $
# $Id: Makefile,v 1.4 2001/12/29 09:44:27 eric Exp $
# Copyright 2001 Eric Smith <eric@brouhaha.com>
#
# This program is free software; you can redistribute it and/or modify
@@ -19,17 +19,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
CFLAGS = -g -I/usr/local/include/panda
CFLAGS = -Wall -g -I/usr/local/include/panda
LDLIBS = -g -ltiff -lm -L/usr/local/lib/panda -lpanda -lpng
YACC = bison
YFLAGS = -d -v
bitblt_test: bitblt_test.o bitblt.o
bitblt.o: bitblt.c
tiff2pdf: tiff2pdf.o scanner.o parser.tab.o
bitblt_test: bitblt_test.o bitblt.o
pandamain: pandamain.o
@@ -37,4 +35,5 @@ pandamain: pandamain.o
$(YACC) $(YFLAGS) $<
# %.c: %.l
# $(LEX) $(LFLAGS) $<
# $(LEX) $(LFLAGS) $<

View File

@@ -1,5 +1,6 @@
#include <stdlib.h>
#include "type.h"
#include "bitblt.h"
static inline u8 pixel_mask (x)

View File

@@ -1,7 +1,3 @@
typedef unsigned char u8;
typedef unsigned int u32;
typedef int boolean;
typedef struct Point
{
u32 x;

View File

@@ -1,5 +1,6 @@
#include <stdio.h>
#include "type.h"
#include "bitblt.h"

View File

@@ -1,12 +1,15 @@
%{
#include <stdio.h>
#include <stdio.h>
#include "type.h"
#include "tiff2pdf.h"
%}
%union {
int integer;
double fp;
char *string;
struct { double width, double height } size;
struct { double width; double height; } size;
struct { int first; int last; } range;
}
%token <integer> INTEGER
@@ -26,12 +29,13 @@
%token PORTRAIT
%token LANDSCAPE
%token FILE
%token FILE_KEYWORD
%token IMAGE
%token IMAGES
%token ROTATE
%token CROP
%token SIZE
%token RESOLUTION
%token INPUT
%token PAGE
@@ -39,10 +43,13 @@
%token BOOKMARK
%token OUTPUT
%type <integer> image_range
%type <integer> image_ranges
%type <integer> page_range
%type <integer> page_ranges
%type <range> range
%type <range> image_ranges
%type <range> page_ranges
%type <fp> unit
%type <fp> length
@@ -57,17 +64,17 @@ statement:
| output_statement ;
image_range:
INTEGER ELIPSIS INTEGER
| INTEGER ;
range:
INTEGER ELIPSIS INTEGER { $$.first = $1; $$.last = $3; }
| INTEGER { $$.first = $1; $$.last = $1; } ;
image_ranges:
image_range
| image_ranges ',' image_range ;
range
| image_ranges ',' range ;
file_clause:
FILE STRING ';' ;
FILE_KEYWORD STRING ';' ;
image_clause:
IMAGE INTEGER ';'
@@ -82,12 +89,12 @@ rotate_clause:
ROTATE INTEGER ';' ;
unit:
CM
| INCH ;
/* empty */ /* default to INCH */ { $$ = 25.4; }
| CM { $$ = 1.0; }
| INCH { $$ = 25.4; } ;
length:
FLOAT
| FLOAT unit ;
FLOAT unit { $$ = $1 * $2; } ;
crop_clause:
CROP PAGE_SIZE ';'
@@ -104,8 +111,11 @@ size_clause:
| SIZE PAGE_SIZE orientation ';'
| SIZE length ',' length ';' ;
resolution_clause:
RESOLUTION FLOAT unit ;
modifier_clause:
rotate_clause | crop_clause | size_clause;
rotate_clause | crop_clause | size_clause | resolution_clause;
modifier_clauses:
modifier_clause
@@ -141,13 +151,9 @@ input_clause_list:
input_statement:
INPUT input_clauses ;
page_range:
INTEGER ELIPSIS INTEGER
| INTEGER ;
page_ranges:
page_range
| page_ranges ',' page_range ;
range
| page_ranges ',' range ;
page_clause:
PAGE INTEGER ';'

View File

@@ -1,10 +1,8 @@
%option case-insensitive
/*
%{
#include "parser.tab.h"
}%
*/
digit [0-9]
alpha [a-zA-Z]
@@ -37,7 +35,7 @@ bookmark { return (BOOKMARK); }
cm { return (CM); }
crop { return (CROP); }
even { return (EVEN); }
file { return (FILE); }
file { return (FILE_KEYWORD); }
image { return (IMAGE); }
images { return (IMAGES); }
inch { return (INCH); }
@@ -48,6 +46,7 @@ output { return (OUTPUT); }
page { return (PAGE); }
pages { return (PAGES); }
portrait { return (PORTRAIT) ; }
resolution { return (RESOLUTION) ; }
rotate { return (ROTATE); }
size { return (SIZE); }