Exemplo n.º 1
0
static void print3ai(char* op, SYM_ENTRY* arg1, SYM_ENTRY* arg2, SYM_ENTRY* result)
{
	printf("%s = ", result->syminf->name); /* e.g. t0 =  */
	if(arg1)
		printarg(arg1);
	printf("%s ",op);
	if(arg2)
		printarg(arg2);
	printf("\n");
}
Exemplo n.º 2
0
static void printIf(char* op, SYM_ENTRY* arg1, SYM_ENTRY* arg2, SYM_ENTRY* result)
{
	/* Statement one */
	printf("IF ");
	printarg(arg1);
	printf(" %s ",op);
	printarg(arg2);
	printf(" GOTO ");
	printf("-- \n");
	//printf("%d\n", result->syminf->lit_int_val);
	/* Statement two: E.value ‘=’ ‘0’*/
}
Exemplo n.º 3
0
Arquivo: secho.c Projeto: Orc/secho
/* read arguments from a file.
 */
void
filetokens(FILE *in, FILE *out)
{
    char c;
    char mydelim = zero ? 0 : (delim ? delim : '\n');

    do { 
	S(arg) = 0;

	while ( (c = getc(in)) != EOF && c != mydelim )
	    EXPAND(arg) = c;
	if ( (c == EOF) && (S(arg) == 0) )
	    break;

	EXPAND(arg) = 0;
	S(arg)--;

	if ( !match_re(T(arg)) )
	    continue;
	
	counter++;
	if ( cmd )
	    docommand(out);
	else if ( out )
	    printarg(out);
    } while ( c != EOF );
}
Exemplo n.º 4
0
static void printParam(char* op, SYM_ENTRY* result)
{
	//DEBUG("Function: %s --- File: %s \n ", __func__, __FILE__);
	printf("%s ",op);
	if(result)
	{
		printarg(result);
		printf(" \n");
	}
	else
		printf(" \n");
}
Exemplo n.º 5
0
int
main(int argc, char** argv)
{
    /*
    printf("foo: %s\n", FOO_STR(FOO));
    */
    printf("tag: %s\n", convert(tag));
    printf("addstr: %s\n", addstr(bar));
    int varform(bar, bar2);
    /* if empty then it'll not show up in the final concatination. */
    int varform(bar,);
    decvar(std::string);
    printarg("foo: %s\n", "bar");

    DBG(1);
    DBG(2);
}
Exemplo n.º 6
0
Arquivo: filecmd.c Projeto: badcodes/c
int process_line(const TCHAR* appname,const TCHAR* line) {
    static TCHAR** argv_l = NULL;
    static int argc_l = 0;
    if(argv_l) {
        while(argc_l-->0)
            free(argv_l[argc_l]);
    }
    else {
       argv_l = (TCHAR**)malloc(MAX_ARGC*sizeof(TCHAR*));
    }
    argc_l = 1;
    argv_l[0] = _tcsdup(appname);
    argc_l = break_cmdline(argv_l+1,line,MAX_ARGC);
    if(argc_l>0) {
        argc_l++;
        DEBUG_CODE_BEGIN
            printarg(TEXT("process_line"),argc_l,argv_l);
        DEBUG_CODE_END
        zcmd_process(argc_l,argv_l);
        return 1;
    }
    return 1;
}
Exemplo n.º 7
0
Arquivo: secho.c Projeto: Orc/secho
/* read arguments off the command line
 */
void
cmdtokens(char *in, FILE *out)
{
    do {
	S(arg) = 0;

	while ( *in && (*in != delim) )
	    EXPAND(arg) = *in++;

	if ( *in ) ++in;

	EXPAND(arg) = 0;
	S(arg)--;

	if ( !match_re(T(arg)) )
	    continue;
	
	counter++;
	if ( cmd )
	    docommand(out);
	else if ( out )
	    printarg(out);
    } while ( *in );
}
Exemplo n.º 8
0
void expand(Args ... args) {
	int arr[] = { (printarg(args), 0)... };
}