mbouster 0 Light Poster

Dear all,
I am a newbie in this side and I need your assistance.

I need to delelop a compiler that accepts text as input.
I need to manipulate this text as follows. Where there is title to center the text and make it bigger font.
We dont know where to start.Any help is much much apreciated.
As we are 3 members of this project a team member produced this code

%option noyywrap
%{
#include "tokens.h"
#include <stdio.h>
%}
%%
\\begin	{ getToken(BEGIN); }
\\end	{ getToken(END); }
%%
void yyerror (char* error){printf("Error: %80s", error);
}

int getToken(int token) {
printf("%d\n", token);
return token;}

int main(int argc, char* argv[]) {
printf("ghrtr");
yyin = fopen("c:\a.txt", "r");
yylex ();

fclose(yyin);
return 0;

}

Amd as tokens the following:

#define BEGIN 100
#define END 101
#define TITLE 102
#define AUTHOR 103
#define DATE 104
#define PAGESETUP 105
#define TABSIZE 106
#define SECTION 107
#define PARAGRAPH 108
#define NEWLINE 109
#define DOCUMENT 110
#define ITEMIZE 111
#define ENUMERATE 112
#define ITEM 113
#define FLAG 114
#define IF 115
#define THEN 116
#define ELSE 117
#define LEFTBRACE 120
#define RIGHTBRACE 121
#define LEFTPAREN 122
#define RIGHTPAREN 123
#define SLASH 124
#define COMMA 125

#define TRUE 130
#define FALSE 131

#define IDENTIFIER [A-Z,a-z]([A-Z,a-z,0-9])*
#define NUMBER [0-9]+
#define DAY ((0[1-9])|([1-2][0-9])|(3[0,1]))
#define MONTH ((0[1-9])|(1[0-2]))
#define YEAR (20[1-9][0-9])
#define EMPTY [\t\n\r] //ignore whitespace, newline

Is this correct or we need to define it in the .l file , the definitions I mean

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.