Boost logo

Boost Users :

Subject: [Boost-users] How to handle blank space in parsing??
From: Ramon F Herrera (ramon_at_[hidden])
Date: 2011-03-07 11:52:05

Hello all,

Boost::regex has been a Godsent to me. Before it, I performed any
parsing with Perl. Now I am becoming comfortable with the regex package.
(a million thanks to the folks responsible for it, and for Boost in
general, btw)

My only problem is spaces. I design typical mini computer language
syntaxes, for example:

   Table[1, 4] = Value AND Array[8, 4]

My initial approach was to get rid of all spaces before parsing (I
recall being taught ages ago that the FORTRAN compiler does just that).
Such strategy works in some cases, but the above line would become:


Which is obviously bad news. I solved this particular case with this syntax:

Table[1, 4] = Value && Array[8, 4]

My latest "language" looks like this and has the same problem described

Table rows [1758, 1904, 2053, 2201, 2345, 2497]
Table cols [372, 880, 1336, 1756, 2083, 2439]

I guess I could insert a colon or something between the first two words,
but I am sure there has to be a better way.



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at