Piethon  1.0
A Python-like interpreter using flex and bison.
Functions | Variables
main.cpp File Reference
#include <iostream>
#include <cstdio>
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int yyparse ()
 
int main (int argc, char **argv)
 

Variables

int parseResult
 
FILE * yyin
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 11 of file main.cpp.

11  {
12 
13  // if a filename was passed on the command line, attempt to open handle for parsing
14  if (argc > 1) {
15  yyin = fopen(argv[1], "r+");
16 
17  if (yyin == NULL) {
18  cerr << "error: could not open file \"" << argv[1] << "\" for reading" << endl;
19  return 3;
20  }
21  }
22 
23  // else, we are reading from STDIN
24  yyparse();
25 
26  return parseResult;
27 }
FILE * yyin
int parseResult
int yyparse()

◆ yyparse()

int yyparse ( )

Variable Documentation

◆ parseResult

int parseResult

◆ yyin

FILE* yyin