#include "spice.h"
#include "cpdefs.h"
#include "suffix.h"
Go to the source code of this file.
#define CONTROLSTACKSIZE 256 /* Better be enough. */ |
Value: cur->co_children->co_parent = cur; \
cur = cur->co_children; \
#define tab |
( |
|
num | ) |
for (i = 0; i < num; i++) out_send(" "); |
static void add_block |
( |
| ) |
|
|
static |
static void add_block |
( |
char * |
name | ) |
|
|
static |
Definition at line 936 of file front.c.
943 if (!name || *name ==
'\0')
return;
945 fprintf(
cp_err,
"Error: block is empty, not added.\n");
static struct control * cend[CONTROLSTACKSIZE]
static void freecontrol()
Definition at line 137 of file front.c.
154 for (ww = wl; wl; wl = wn) {
162 else if (strchr(wl->
wl_word,
'a'))
164 else if (strchr(wl->
wl_word,
'b'))
218 if (!print && !
remove && !add && !bind)
243 fprintf(
cp_err,
"Error: %s not found, no block added.\n",fname);
struct wordlist * wl_prev
void cp_freeblock(char *name)
struct wordlist * wl_next
static void freecontrol()
void cp_addblock |
( |
char * |
name, |
|
|
wordlist * |
wl |
|
) |
| |
Definition at line 264 of file front.c.
int cp_evloop(char *string)
struct wordlist * wl_next
int cp_evloop |
( |
char * |
string | ) |
|
Definition at line 316 of file front.c.
350 for (ww = wlist; ww; ww = ww->
wl_next)
353 "cp_evloop: Internal Error: NULL word pointer.\n");
static struct control * cend[CONTROLSTACKSIZE]
struct wordlist * wl_next
static wordlist * getcommand()
static void freecontrol()
void cp_execcontrol |
( |
char * |
name | ) |
|
Definition at line 965 of file front.c.
979 fprintf(
cp_err,
"Error: named block %s not found.\n",name);
void cp_freeblock |
( |
char * |
name | ) |
|
Definition at line 296 of file front.c.
303 if (!name || *name ==
'\0')
return;
static void freecontrol()
bool cp_isblockdef |
( |
char * |
name | ) |
|
Definition at line 1051 of file front.c.
1058 fprintf(
cp_err,
"cp_popcontrol: Internal Error: stack empty\n");
Definition at line 1066 of file front.c.
1071 fprintf(
cp_err,
"Error: stack overflow -- max depth = %d\n",
static struct control * cend[CONTROLSTACKSIZE]
static void freecontrol()
Definition at line 1033 of file front.c.
1038 fprintf(
cp_err,
"Warning: EOF before block terminated\n");
static struct control * cend[CONTROLSTACKSIZE]
static void freecontrol()
Definition at line 1086 of file front.c.
1092 while (
cend[stackp]->co_parent)
static struct control * cend[CONTROLSTACKSIZE]
struct control * co_parent
Definition at line 630 of file front.c.
656 info->
rt.
num = ri.rt.num - 1;
667 info->
rt.
num = ri.rt.num - 1;
700 info->
rt.
num = ri.rt.num - 1;
711 info->
rt.
num = ri.rt.num - 1;
747 info->
rt.
num = ri.rt.num - 1;
758 info->
rt.
num = ri.rt.num - 1;
781 if (ri.type ==
LABEL) {
790 else if (ri.type !=
NORMAL) {
791 info->
type = ri.type;
792 info->
rt.
num = ri.rt.num;
801 if (ri.type ==
LABEL) {
810 else if (ri.type !=
NORMAL) {
811 info->
type = ri.type;
812 info->
rt.
num = ri.rt.num;
821 for (wl = ww; wl; wl = wl->
wl_next) {
836 info->
rt.
num = ri.rt.num - 1;
847 info->
rt.
num = ri.rt.num - 1;
872 fprintf(
cp_err,
"Warning: break %d a no-op\n",
882 fprintf(
cp_err,
"Warning: continue %d a no-op\n",
908 fprintf(
cp_err,
"Warning: ignoring previous error.\n");
913 "doblock: Internal Error: bad block type %d.\n",
static struct control * findlabel()
struct control * co_elseblock
struct control * co_children
static wordlist * quicksub()
struct wordlist * wl_next
static void docommand |
( |
| ) |
|
|
static |
static void docommand |
( |
wordlist * |
wlist | ) |
|
|
static |
Definition at line 1104 of file front.c.
1112 struct comm *command;
1115 FILE *lastin, *lastout, *lasterr;
1119 printf(
"docommand ");
1121 (void) putc(
'\n', stdout);
1131 pwlist(wlist,
"After variable substitution");
1134 pwlist(wlist,
"After backquote substitution");
1137 pwlist(wlist,
"After globbing");
1139 if (!wlist || !wlist->
wl_word)
1145 for (nextc = wlist; nextc; nextc = nextc->
wl_next)
1156 if (nextc == wlist) {
1168 if (wlist ==
NULL) {
1218 fprintf(
cp_err,
"%s: no such command available in %s\n",
1224 fprintf(
cp_err,
"%s: command available only in spice\n",s);
1237 if (nargs < command->co_minargs) {
1242 fprintf(
cp_err,
"%s: too few args.\n", s);
1246 fprintf(
cp_err,
"%s: too many args.\n", s);
1260 }
while (nextc && wlist);
struct wordlist * wl_prev
static char * noredirect[]
static struct comm * findcom()
struct wordlist * wl_next
static void dodump |
( |
struct control * |
cc | ) |
|
|
static |
Definition at line 1368 of file front.c.
struct control * co_children
static void eval_block |
( |
| ) |
|
|
static |
static void eval_block |
( |
struct control * |
x | ) |
|
|
static |
Definition at line 576 of file front.c.
594 "Error: break not in loop or too many break levels given.\n");
599 "Error: continue not in loop or too many continue levels given.\n");
606 "Error: label %s not found.\n",ri.rt.label);
static struct control * findlabel()
static struct comm* findcom |
( |
| ) |
|
|
static |
static struct comm* findcom |
( |
char * |
cmd | ) |
|
|
static |
Definition at line 1269 of file front.c.
1273 static void *comhash;
static struct control* findlabel |
( |
| ) |
|
|
static |
static void freecontrol |
( |
| ) |
|
|
static |
static void freecontrol |
( |
struct control * |
cntrl | ) |
|
|
static |
Definition at line 1011 of file front.c.
1018 for (cc = cntrl; cc; cc = cd) {
struct control * co_elseblock
struct control * co_children
static void freecontrol()
static wordlist* getcommand |
( |
char * |
string | ) |
|
|
static |
Definition at line 1290 of file front.c.
1296 static char buf[64];
1300 fprintf(
cp_err,
"calling getcommand %s\n",
1301 string ?
string :
"");
1308 for (j = 0; j < i; j++)
1319 printf(
"getcommand ");
1321 (void) putc(
'\n', stdout);
static char buf[MAXPROMPT]
static struct control * cend[CONTROLSTACKSIZE]
struct control * co_parent
static void pwlist |
( |
wordlist * |
wlist, |
|
|
char * |
name |
|
) |
| |
|
static |
Definition at line 1330 of file front.c.
1339 fprintf(
cp_err,
"%s : [ ", name);
1340 for (wl = wlist; wl; wl = wl->
wl_next)
struct wordlist * wl_next
static void set_block |
( |
| ) |
|
|
static |
Definition at line 383 of file front.c.
396 #define newblock cur->co_children = alloc(struct control); \ 397 cur->co_children->co_parent = cur; \ 398 cur = cur->co_children; \ 399 cur->co_type = CO_UNFILLED; 416 fprintf(stderr,
"Error: missing while condition.\n");
424 fprintf(stderr,
"Error: missing dowhile condition.\n");
445 "Error: can't repeat a negative number of times.\n");
452 "Error: bad repeat argument %s.\n",s ? s :
"");
462 fprintf(stderr,
"Error: missing if condition.\n");
475 fprintf(stderr,
"Error: missing foreach variable.\n");
489 "Warning: ignored extra junk after label.\n");
492 fprintf(stderr,
"Error: missing label.\n");
504 "Warning: ignored extra junk after goto.\n");
507 fprintf(stderr,
"Error: missing label.\n");
515 "Warning: ignored extra junk after continue %d.\n",
527 "Warning: ignored extra junk after break %d.\n",
536 fprintf(stderr,
"Error: no block to end.\n");
555 fprintf(stderr,
"Error: misplaced else.\n");
struct control * co_elseblock
static struct control * cend[CONTROLSTACKSIZE]
struct control * co_children
static wordlist * quicksub()
struct wordlist * wl_next
struct control * co_parent
char* noredirect[] = { "stop", NULL } |
|
static |