Basically I'm working on a LaTeX + HTML processor.

I'm basically making the syntax easier to write.

Instead of writing
Code:
\documentclass{report}
the client only has to write \report and it makes it \documentclass{report} on a new file.[/CODE]

I had both HTML and LaTeX processor's working fine alone.
When I got both together and changed the main sht started working.

So, instead of having the whole regular expressions I just made a new page with just \report.

So, this is my filter :
Code:
%{#include <stdio.h>
#include <stdlib.h>
#include <string.h>
FILE *trabtotal;
int tipo;
%}
%x TITULO
%x URL
%x AUTOR
%x TEXTO
%x SECCAO
%x ETIQUETA
%x REFERENCIA
%x SUBSECCAO
%x SUBSUBSECCAO
%x ITEM
%x CITACAO
%x FACE
%x SIZE
%x COLOR
%x LINK1
%x SIC
%x LIST
%x ATRIB
%x ATRIB1
%x ATRIBI
%x ATRIBL
%x ATRIBLT
%x ROW
%x LINHA
%x SRC
%x ATRIBP
%x MAR
%x COR
%x PARAGRAFO
%%


^\\(R|r)(E|e)(L|l)(A|a)(T|t)(O|o)(R|r)(I|i)(O|o)                             {if(tipo==1) {fprintf(trabtotal,"\\documentclass{report}\n\n");}
                                                                             if (tipo==2) {fprintf(trabtotal,"Esta expressão não existe em HTML");}}


%%


int yywrap()
{
   return 1;
}


int main(int argc,char *argv[])
{
       if (argc != 4) 
           {printf("ERRO, tem que ter quatro argumentos \n");
                exit(EXIT_FAILURE);
           }
    else
    {
    if ((strcmp(argv[1],"-l")==0)) {tipo=1;}
    if ((strcmp(argv[1],"-h")==0)) {tipo=2;}
    }
    yylex();
    printf("Ficheiro convertido com Sucesso.\n\n");
    return 0;
}
And this is the page I'm writing on the input :

Code:
\relatorio
When giving it this input :
Code:
"./trhtex -l paginateste3.trhtex olaffff"
It just does nothing and keeps waiting :/