main.c File Reference

Driver; reads standard in and relays to parse chain. More...

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include "out.h"
#include "in.h"
#include "lexer.h"
#include "parser.h"
#include "main.h"

Include dependency graph for main.c:

Include dependency graph

Go to the source code of this file.

Defines

#define EVAL(expr, err)   if (expr) { errno = err; perror(pcerr); iret = EXIT_FAILURE; goto cleanup; }
 Evaluand gives unto errno, cleans up.

Functions

int main ()
 Driver from a mysterious nether-aether, and thence: Styx.


Detailed Description

Driver; reads standard in and relays to parse chain.

Definition in file main.c.


Define Documentation

#define EVAL expr,
err   )     if (expr) { errno = err; perror(pcerr); iret = EXIT_FAILURE; goto cleanup; }
 

Evaluand gives unto errno, cleans up.

Parameters:
expr evaluand
err errno

Definition at line 17 of file main.c.


Function Documentation

int main  ) 
 

Driver from a mysterious nether-aether, and thence: Styx.

Returns:
nether-aether's fare.

Definition at line 21 of file main.c.

References EVAL, in(), and parse().

00021            {
00022   int iret = EXIT_SUCCESS;
00023   const char *pcerr = "main.c main()";
00024   char *pc;
00025 
00026   /* Unsuccessful read. */
00027   EVAL(in(stdin, &pc) == EXIT_FAILURE, EIO);
00028   /* Else, perform tokenization and thence parse. */
00029   EVAL(parse(pc) != EXIT_SUCCESS, EINVAL);
00030 
00031  cleanup:
00032   free(pc);
00033   return iret;
00034 }

Here is the call graph for this function:


Generated on Tue Dec 7 06:38:25 2004 for CSCI101:ProjectLatex by  doxygen 1.3.9.1