Browse Source

Still some organizing: everything compile well!

TODO now: the parser!
remotes/origin/master
Skia 6 years ago
parent
commit
b3ca188c8b
8 changed files with 21 additions and 86 deletions
  1. BIN
      Parser/debug/ParserTest
  2. +2
    -2
      Parser/makefile
  3. +1
    -0
      Parser/src/Parser.cpp
  4. +7
    -0
      Parser/src/TList.cpp
  5. +5
    -2
      Scanner/makefile
  6. +2
    -81
      Symboltable/src/Symboltable.cpp
  7. +2
    -0
      includes/Token.h
  8. +2
    -1
      makefile

BIN
Parser/debug/ParserTest View File


+ 2
- 2
Parser/makefile View File

@@ -53,10 +53,10 @@ makeTestParser: $(OBJS)
g++ $(FLAGS) $^ -L../sharedlib -lList -lScanner -o $(BINDIR)/ParserTest


list: $(SRCDIR)/list.cpp $(SRCDIR)/TestList.cpp
list: $(SRCDIR)/TList.cpp $(SRCDIR)/TestList.cpp
g++ $(FLAGS) $^ -o $(BINDIR)/ListTest

listLib: $(SRCDIR)/list.cpp
listLib: $(SRCDIR)/TList.cpp
g++ $(FLAGS) -fPIC $^ -shared -o $(SHAREDLIB)/libList.so

run:


+ 1
- 0
Parser/src/Parser.cpp View File

@@ -10,6 +10,7 @@
#include <fstream>
#include <Parser.h>
#include <TList.h>
#include <Token.h>


void printTokenType( TokenType t );


Parser/src/list.cpp → Parser/src/TList.cpp View File

@@ -1,3 +1,10 @@
/*
*
* cpp file for the token linked list
*
* Author: Skia
* Date: 31 May 2014
*/
#include <TList.h>
#include <stdlib.h>
#include <stdio.h>

+ 5
- 2
Scanner/makefile View File

@@ -17,7 +17,6 @@ FLAGS=-g -Wall -Werror -ansi -pedantic -I$(INCLUDES)
## darauf achten, dass letzte Zeile ohne "\" eingetragen wird

OBJS = $(OBJDIR)/Scanner.o \
$(OBJDIR)/TestScanner.o \
$(OBJDIR)/Token.o

#$(OBJDIR)/xx1.o \
@@ -44,9 +43,13 @@ OBJS = $(OBJDIR)/Scanner.o \


#Variante mit guten Kenntnissen
makeTestScanner: $(OBJS)
makeTestScanner: $(OBJS) src/TestScanner.cpp
g++ $(FLAGS) $^ -L../sharedlib -lAutomat -lBuffer -lSymboltable -o $(BINDIR)/ScannerTest

# compilieren des Files Automat.cpp zu Automat.o mit dem Flag -fPIC (Position Independant Code)
ScannerLibTarget : src/Token.cpp src/Scanner.cpp
g++ $(FLAGS) -c -fPIC src/Token.cpp -o lib/Token.o
g++ $(FLAGS) -c -fPIC src/Scanner.cpp -o lib/Scanner.o


# $^ liste der abhaengigkeiten


+ 2
- 81
Symboltable/src/Symboltable.cpp View File

@@ -8,7 +8,8 @@
* Author: mino & Skia
*/

#include "Symboltable.h"
#include <Symboltable.h>
#include <Token.h>

/*
===========================================================================
@@ -253,86 +254,6 @@ PRINTING OF SYMTAB (REMOVE ME LATER)
===========================================================================
*/

void printTokenType(TokenType t)
{
switch(t) {
case T_PLUS:
std::cout << "T_PLUS" << std::endl;
break;
case T_MINUS:
std::cout << "T_MINUS" << std::endl;
break;
case T_DIVIDE:
std::cout << "T_DIVIDE" << std::endl;
break;
case T_MULTI:
std::cout << "T_MULTI" << std::endl;
break;
case T_LESSTHAN:
std::cout << "T_LESSTHAN" << std::endl;
break;
case T_MORETHAN:
std::cout << "T_MORETHAN" << std::endl;
break;
case T_ASSIGN:
std::cout << "T_ASSIGN" << std::endl;
break;
case T_EQUAL:
std::cout << "T_EQUAL" << std::endl;
break;
case T_UNEQUAL:
std::cout << "T_UNEQUAL" << std::endl;
break;
case T_EXCLAMATION:
std::cout << "T_EXCLAMATION" << std::endl;
break;
case T_AND:
std::cout << "T_AND" << std::endl;
break;
case T_SEMICOLON:
std::cout << "T_SEMICOLON" << std::endl;
break;
case T_LPARENT:
std::cout << "T_LPARENT" << std::endl;
break;
case T_RPARENT:
std::cout << "T_RPARENT" << std::endl;
break;
case T_RBRACKET:
std::cout << "T_RBRACKET" << std::endl;
break;
case T_LBRACKET:
std::cout << "T_LBRACKET" << std::endl;
break;
case T_LBRACE:
std::cout << "T_LBRACE" << std::endl;
break;
case T_RBRACE:
std::cout << "T_RBRACE" << std::endl;
break;
case T_INTEGER:
std::cout << "T_INTEGER" << std::endl;
break;
case T_IF:
std::cout << "T_IF" << std::endl;
break;
case T_WHILE:
std::cout << "T_WHILE" << std::endl;
break;
case T_IDENTIFIER:
std::cout << "T_IDENTIFIER" << std::endl;
break;
case T_INT:
std::cout << "T_INT" << std::endl;
break;
case T_END:
std::cout << "T_END" << std::endl;
break;
default:
std::cout << "T_UNKNOWN" << std::endl;
break;
}
}

void Symboltable::print( void )
{


+ 2
- 0
includes/Token.h View File

@@ -66,5 +66,7 @@ class Token
};


void printTokenType( TokenType t );


#endif

+ 2
- 1
makefile View File

@@ -109,5 +109,6 @@ scannerLib: empty-dirs automatObj bufferObj symboltableObj scannerObj
$(AUTOMATDIR)/lib/Automat.o \
$(BUFFERDIR)/lib/Buffer.o \
$(SYMBOLTABLEDIR)/lib/Symboltable.o \
$(SCANNERDIR)/lib/Scanner.o
$(SCANNERDIR)/lib/Scanner.o \
$(SCANNERDIR)/lib/Token.o


Loading…
Cancel
Save