Skip to content

JacobLondon/spider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spider

C++ Generation Language

Requirements

  • make
  • g++
  • flex
  • bison

Building

Enter the main project directory and run the make command.

Generating C++ Programs

To start generating C++ programs, you will have to use the binaries generated by make. The binaries are called spider and web.

Web

  • The Lexer, Parser, and AST tool.
  • cat files or echo text, pipe (|) it into spider, and redirect (>) the output to a file.

Spider

  • spider The tool for interfacing with the spider binary.
  • Arguments
    • -c Clean files after compiling a binary.
    • -g Specify a non-default C++ generated file (sp.out.cpp by default)
    • -o Specify a non-default binary to generate from the C++ file (a.out by default)
    • -r Run the generated binary after compiling.

Examples

  1. spider <file>.sp
    • Generates a C++ file with a default name.
  2. spider <file>.sp -g Example.cpp
    • Generates a C++ file called Example.cpp.
  3. spider <file>.sp -c -o Example
    • Generates a binary called Example and cleans the intermediate files.
  4. spider <file>.sp -o Example -r
    • Generates a binary called Example and runs it.