~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/c/dpp.c

  • Committer: Bazaar Package Importer
  • Author(s): Albin Tonnerre
  • Date: 2008-06-20 18:00:19 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080620180019-7fbz1ln5444vtkkr
Tags: 0.9j-20080306-2ubuntu1
* Enabled unicode support. (Closes: LP #123530)
* Modify Maintainer value to match the DebianMaintainerField specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c; c-basic-offset: 8 -*- */
1
2
/*
2
3
    dpp.c -- Defun preprocessor.
3
4
*/
57
58
        Each supplied-p parameter becomes a boolean C variable.
58
59
 
59
60
        Initforms are C expressions.
60
 
        It an expression contain non-alphanumeric characters,
 
61
        If an expression contains non-alphanumeric characters,
61
62
        it should be surrounded by backquotes (`).
62
63
 
63
64
 
138
139
put_lineno(void)
139
140
{
140
141
        static int flag = 0;
141
 
#if 1
142
142
        if (flag)
143
143
                fprintf(out, "#line %d\n", lineno);
144
144
        else {
145
145
                flag++;
146
146
                fprintf(out, "#line %d \"%s\"\n", lineno, filename);
147
147
        }
148
 
#endif
149
148
}
150
149
 
151
150
error(char *s)
160
159
        exit(1);
161
160
}
162
161
 
 
162
int
163
163
readc(void)
164
164
{
165
165
        int c;
178
178
        return(c);
179
179
}
180
180
 
 
181
int
181
182
nextc(void)
182
183
{
183
184
        int c;
187
188
        return(c);
188
189
}
189
190
 
 
191
void
190
192
unreadc(int c)
191
193
{
192
194
        if (c == '\n')
196
198
        ungetc(c, in);
197
199
}
198
200
 
 
201
void
199
202
put_tabs(int n)
200
203
{
201
204
        put_lineno();
203
206
                putc('\t', out);
204
207
}
205
208
 
 
209
void
206
210
pushc(int c)
207
211
{
208
212
        if (poolp >= &pool[POOLSIZE])
210
214
        *poolp++ = c;
211
215
}
212
216
 
 
217
void
213
218
pushstr(const char *s)
214
219
{
215
220
        while (*s)
391
396
        return(p);
392
397
}
393
398
 
 
399
void
394
400
reset(void)
395
401
{
396
402
        int i;
426
432
                = NULL;
427
433
}
428
434
 
 
435
void
429
436
get_function(void)
430
437
{
431
438
        function = read_function();
438
445
        function_c_name = translate_function(function);
439
446
}
440
447
 
 
448
void
441
449
get_lambda_list(void)
442
450
{
443
451
        int c;
585
593
        }
586
594
}
587
595
 
 
596
void
588
597
get_return(void)
589
598
{
590
599
        int c;
598
607
        }
599
608
}
600
609
 
 
610
void
601
611
put_fhead(void)
602
612
{
603
613
        int i;
611
621
        fprintf(out, ")\n{\n");
612
622
}
613
623
 
 
624
void
614
625
put_declaration(void)
615
626
{
616
627
  int i;
736
747
  }
737
748
}
738
749
 
 
750
void
739
751
put_return(void)
740
752
{
741
753
        int i, t;
765
777
        }
766
778
}
767
779
 
768
 
char
 
780
int
769
781
jump_to_at(void)
770
782
{
771
 
        char c;
 
783
        int c;
772
784
 GO_ON:
773
785
        while ((c = readc()) != '@')
774
786
                putc(c, out);
779
791
        return c;
780
792
}
781
793
 
 
794
void
782
795
main_loop(void)
783
796
{
784
797
        int c;
834
847
        goto LOOP;
835
848
}
836
849
 
 
850
int
837
851
main(int argc, char **argv)
838
852
{
839
853
        char *p, *q;
867
881
                error("can't open output file");
868
882
        printf("dpp: %s -> %s\n", filename, outfile);
869
883
        main_loop();
 
884
        return 0;
870
885
}