Tim Landscheidt | 19 Nov 02:36
Picon

[PATCH] Convert the testsuite to autotest

Hi,

attached is a bzipped patch to convert the testsuite to
autotest.  A fine-grained version that proves that the data
files are imported verbatim can be found at
<URI:https://github.com/scfc/flex/tree/autotest>.

  The patch is based on my previous "m4-nopreproc" patch but
it should be possible to adapt it to HEAD if care is taken
of the "--skeldir" option.

Tim
Attachment (flex-autotest.patch.bz2): application/x-bzip2, 67 KiB
_______________________________________________
help-flex mailing list
help-flex <at> gnu.org
https://lists.gnu.org/mailman/listinfo/help-flex
Tim Landscheidt | 1 Nov 02:30
Picon

m4 and skeleton system

Hi,

I'm looking at adding support for PHP to flex, and it looks
generally feasible.

  What I don't quite understand is the reasoning behind
flex's skeleton system.  While Bison's is pretty straight
forward, - CMIIW - flex processes the skeleton with m4 to a
C array, then implements some "%if-..." control structures
of its own and processes the result again with m4 (offering
the user another set of control structures for his code).
The only technical advantage to Bison's that I can see from
a distance is that in this way the whole shebang is contain-
ed in one binary.

  So with regard to my goal, should I go for "%if-php-only",
or would a patch to streamline the skeleton system first be
met favourably?

TIA,
Tim
sdatta | 23 Jan 21:41
Picon

get "unrecognised rule" error

hi, i m new to flex...pls answer my query! i m getting "unrecognised rule" error in my code cpp.l i figured-out that its due to line 78 where rule for "pp_num" is written. uploaded the codecpp.l plss help.... Thanks sdatta

View this message in context: get "unrecognised rule" error
Sent from the Gnu - Flex mailing list archive at Nabble.com.
_______________________________________________
help-flex mailing list
help-flex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-flex
Una Radovanovic | 4 Jan 00:05
Picon

trouble with assigning values to tokens

Hello everybody!

I'm writting a HTML parser using flex++ and bison++. The trouble is that I cannot assign values to
the tokens. I know how this works in C, but is there some other way to do this in C++?
I would really appreciate if you could take a look at this code
(it's just a small example of the original code).

parser.y
-----------------
%name Parser
%define MEMBERS \
~Parser() {} \
private: \
yyFlexLexer lexer;
%define LEX_BODY {return lexer.yylex();}
%define ERROR_BODY {}
%header{
#include <iostream>
#include <fstream>
#include <FlexLexer.h>
#include <cstdlib>
#include <stdio.h>
#include <string>
#include <string.h>
#define YYSTYPE char *
using namespace std;
%}

%union {

const char *str;
}

%{
ofstream out;
%}
%token <str> STRING
%start html_start
%%
html_start

: text {

$<str>$=$<str>1;
out<<" text2 "<<$<str>$;
}
|{out<<" text1 ";}

;

text
: STRING {$<str>$ = $<str>1;
}
;
%%
int main(int argc, char ** argv )
{
Parser parser;
ifstream inp;
string myFileName;
myFileName = "mydata.txt";
inp.open(myFileName.c_str(), ifstream::in);
inp.close();
inp.clear(ios::failbit);
out.open("mydata.txt", ofstream::out);
parser.yyparse();
return 0;
out.close();
}


scanner.l
------------------
%option c++
%option noyywrap
%{
#include<sstream>
#include <iostream>
#include "parser.h"
#include <cstdlib>
#include <fstream>
#include <malloc.h>
#include <string.h>
yy_Parser_stype yyval;
%}

letter [_a-zA-Z]
DIGIT [0-9]
%%

{letter}({letter}|{DIGIT})* {
yyval.str=(yytext);
return ( Parser::STRING);
}

<<EOF>> {
yyterminate();
}
%%



--
--
Kindest regards,
Una

_______________________________________________
help-flex mailing list
help-flex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-flex
Hans Aberg | 30 Sep 10:11
Picon
Picon

Re: unicode character in flex

[Please keep the cc to the list, so that others can follow.]

On 30 Sep 2009, at 04:37, Mahalingam Arumugam wrote:

>  I think we have to map the keys( ascii chars into tamil unicode  
> chars ) when we type through  the keyboard, so  that it can be  
> displayed in STDOUT in tamil.
>
> Is it possible to do the keymap ( from ascii to unicode chars) in  
> utf -8 editor.
> Please let me know.

On Mac OS X, keymaps can be created using Ukelele
   http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=Ukelele

I don't know what is used on other platforms.

   Hans
Mahalingam Arumugam | 28 Sep 06:05
Picon

unicode character in flex

Dear friends,
I want to input/output  Tamil Unicode characters( U+0B80-U+0BFF)   in Flex  . How to do that.
Please help on this.

 

Regards
Maha
Sivayoga Infotech

_______________________________________________
help-flex mailing list
help-flex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-flex
Thomas Wukasch | 26 Aug 11:31
Favicon

Printing Flex Chart Application with FireFox 2 and later

Hi, I have problem with printing functionality in FireFox. The print preview
shows an empty page. So the user ends with this step and thinks no print is
available. Another problem is when I try to print directly not the whole
application will be printed.

Is there an easy way to get FireFox to print correctly.

Thank you for all your helpful answers.
Rui Maciel | 24 Aug 14:32
Picon
Gravatar

set flex start conditions from bison?

Is it possible to set the flex start conditions from within bison? I've set a couple of lexer start 
conditions in the flex file and added yy_push_state() to the bison file, which already includes a flex-
generated header. Nonetheless, the compiler still complains that the start condition symbol (named
s_element) 
is undeclared. As the start condition symbol is described in the flex file as:

#ifdef YY_HEADER_EXPORT_START_CONDITIONS
#define INITIAL 0
#define s_element 1

#endif

That leads me to believe that some other tweaking is needed to at least define 
YY_HEADER_EXPORT_START_CONDITIONS and therefore declare the start condition symbol.

So, how do we set flex start conditions from within a bison file?

Thanks in advance,
Rui Maciel
Slavik Shen | 14 Jul 03:30

Check out my photos on Facebook

facebook

Check out my photos on Facebook


Hi help-flex <at> gnu.org,

I set up a Facebook profile where I can post my pictures, videos and events and I want to add you as a friend so you can see it. First, you need to join Facebook! Once you join, you can also create your own profile.

Thanks,
Slavik

To sign up for Facebook, follow the link below:
http://www.facebook.com/p.php?i=684408528&k=Z4F3PVUXT23FUCD1QB63U4QZTPFB&r
help-flex <at> gnu.org was invited to join Facebook by Slavik Shen. If you do not wish to receive this type of email from Facebook in the future, please click here to unsubscribe.
Facebook's offices are located at 1601 S. California Ave., Palo Alto, CA 94304.
_______________________________________________
help-flex mailing list
help-flex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-flex
Suan Yeo | 1 Jul 00:41
Picon
Gravatar

Parsing across multiple buffers and maintaining state (prefably without additional memory usage)

I'm trying to search for a particular string within a chain of buffers, say,
"sausage". Right now, it works fine if "sausage" is wholly in one buffer, but if
it is split between 2 buffers, eg, {"........sau", "sage........", ...}, flex
does not match it. This is my current implementation:

while (buf)
{
  buf_state = yy_scan_bytes(...);
  result = yylex();
  yy_delete_buffer(buf_state);
  buf = buf->next;
}

I use yy_scan_bytes because as I understand it does not copy it into a new
buffer (ie. scans in-place). How should I change my implementation to achieve
the above (other than copying everything into a single buffer)?
Yu-zhong shen | 23 Feb 03:34
Picon

Help! How to use unicode in flex?

I am working with flex in GNUWin32.

I want to process some unicode text with it.

Is there any option or patch of flex that support the unicode?

_______________________________________________
help-flex mailing list
help-flex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/help-flex

Gmane