delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/08/05:44:54

Message-Id: <3.0.5.32.19980708114505.0093ed90@hal.nt.tuwien.ac.at>
Date: Wed, 08 Jul 1998 11:45:05 +0200
To: djgpp AT delorie DOT com
From: Anton Helm <tony AT nt DOT tuwien DOT ac DOT at>
Subject: =?iso-8859-1?Q?flex_scanning_a_'=B0'_(degree_sign)?=
Mime-Version: 1.0

I have a program with flex/bison frontend that
needs to scan angles from (text-) inputfiles.
Unfortunately the users of this program which 
(unfortunately too...) live all over the world 
like to use the '°' (degree sign) for their input.

If you don't see it in the line above, you get an idea
what the problem is...

The degree sign is not an ASCII character therefore its 
representation depends on OS, OS language, code page,
current lunar phase etc.

I would like to compile a program that contains such
a flex/bison frontend which is user configurable so
that the user can define which character should be
used on her/his system as the degree sign without
recompiling.

How can I tell flex to use a 'variable' text to scan
the input for tokens ?

Currently I see only 2 possible solutions:
a) modify the *.c-file generated by flex
   (rather tricky, and not such a good idea if someone
    is going to change the *.l-file later...).
b) implement *all* possible representations in the 
   *.l-file. But, first this might be quite a list and
   second, this might result in conflicts with some other
   input tokens (which might be avoided by careful design).


Any suggestions welcome.

Tony





**************************************************************
Dipl.-Ing. Anton HELM   *T*  mailto:tony AT nt DOT tuwien DOT ac DOT at
Institut fuer           *U*  http://www.nt.tuwien.ac.at/~tony/
Nachrichtentechnik und  *W*  http://www.nt.tuwien.ac.at/
Hochfrequenztechnik     *I*  talkto:tony AT eagle DOT nt DOT tuwien DOT ac DOT at
Guszhausstr. 25/389     *E*  phoneto:+43-1-58801-3520
A-1040 Wien, AUSTRIA    *N*  faxto:+43-1-5870583
**************************************************************
finger -l tony AT penguin DOT nt DOT tuwien DOT ac DOT at      for PGP public key
**************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019