May be the question was not clear. Anyways, i have found the solution, so
thought of updating it.
fragment DOLQ_CONT : ALPH_CAP | ALPH_SMALL | ( '\u0200' .. '\u0377' ) | '_'
| DIGIT;
fragment DOLQ_START : ALPH_CAP | ALPH_SMALL | ( '\u0200' .. '\u0377' ) | '_'
;
fragment DOLQ_DELIM_F1[ string& delim ]
@init{
ANTLR3_MARKER start = GETCHARINDEX();
} : '$' (DOLQ_START) (DOLQ_CONT)* '$'
{
ANTLR3_MARKER stop = GETCHARINDEX();
delim.assign( (char*) start, stop - start );
};
fragment DOLQ_DELIM_F2 : '$' (DOLQ_START) (DOLQ_CONT)* '$' ;
fragment DOLQ_INSIDE: (~'$')+ | '$'
;
DOLQDELIM
@init{
string delim;
}: DOLQ_DELIM_F1[delim]
DOLQ_INSIDE*
{ check_string_delim( delim, GETCHARINDEX() ) }? DOLQ_DELIM_F2
;
Thanks,
Gokul.
On Wed, Jul 27, 2011 at 9:52 PM, Gokulakannan Somasundaram <
[email protected]> wrote:
> Hi,
> I want to match patterns like
>
> $123$..anything here..$123$
>
> Basically it is a way to mention strings between a delimiter. The
> delimiter is not fixed. Can someone help me on how to match these type of
> dollar quoted identifiers?
>
> Thanks,
> Gokul.
>
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.