[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Including mathematical symbols in STRING token
From: |
Hans Aberg |
Subject: |
Re: Including mathematical symbols in STRING token |
Date: |
Tue, 24 Jun 2003 11:12:06 +0200 |
At 13:05 +0530 2003/06/24, <address@hidden> wrote:
>Hi,
> I am working on a parser in which STRING token consists of all the
>possible characters, like =,/,+ etc. But these are also needed to be
>taken as having its usual meaning (mathematical operators, etc). What
>is the best method to get the desired result. Is it necessary to use
>only quoted strings (between " ") or we can do with usual unquoted
>strings ?
A drawback with "..." is that the opening and closing delimiters are the
same, which makes typos harder to detect.
So I ended up using `...' with ` prohibited inside the string (as a
safeguard against human typos) plus the usual C style \ (backslash) escape
sequences.
There is an example in the Flex manual how to implement C strings.
Hans Aberg