Hi,
If the entire structure is just these lines then it is likely that a
parser is overkill to be honest. However you can create a lexer rule
that changes it's definition at runtime, but you must be careful that
set of delimiters would never otherwise appear in the input.
What you do is ad
Thanks, Steve, that looks very promising!
Rob
> Date: Mon, 8 Jun 2009 01:14:19 +0100
> Subject: Re: [antlr-interest] Customizing token separators without recompiling
> From: st...@stevecooper.org
> To: dukie_bander...@hotmail.com
> CC: jsrs...@yahoo.com;
I don't know if this is any closer, but I had this idea.
Your problem seems to be in getting a lexer which will give you the
right stream of tokens, and not in writing the parser that feeds off
them. You could write your own lexer to do the splitting of the
strings, and use ANTLR to write the par
"If you simply want to break apart a line of text based on an arbitrary
delimiter, it would be much easier to write a program in Perl, Python,
Java, etc. that split the text based on a configuration setting."
That's basically what I'm doing right now (in C#, by hand). Are you saying that
ANTLR
I presume that the separator changes other lexing rules, too? If one
customer chooses to use '$' as the separator, their other tokens can't
contain '$'. But if someone chooses '~', then a '$' *can* exist in the
other tokens. So the whole lexer will have to change.
If that's not so, then you can j
Oh, I'm saying you wouldn't want to use a grammar at all. The problem you've
described is lexical, not grammatical. If you simply want to break apart a
line of text based on an arbitrary delimiter, it would be much easier to write
a program in Perl, Python, Java, etc. that split the text based
Hi,
Sorry, I'm not following you. How would that work? E.g. A new customer comes
along, they have their format that uses '_' (or whatever), and how do I get the
lexer/parser to recognize their file format without re-generating/re-compiling
the lexer/parser? What would Perl operate on? The gram
Howdy,
I'm guessing there's more to the problem than just supporting arbitrary field
separation tokens, because if that's all there is, just use something like perl
and store the separator(s) in a config file...?
--S
--- On Sun, 6/7/09, Dukie Banderjee wrote:
From: Dukie Banderjee
Subject:
Hi,
I'm fairly new too, so there might be better ways to do this. From
your description I assume that you're not interested in the
separators, but they may change over time. This is what I came up with
playing a little in ANTLRWorks:
-
grammar Foo;
infoSequence: info+;
info
Hi everyone,
I'm new to the list and new to ANTLR. I have a specific problem I need to solve
and I hope ANTLR can help.
Our client has several end-customers who all have slightly different document
formats used for data interchange.
All the documents are basically 'standard' EDI documents, me
Hi,
I still have a problem concerning if-then-else statement. How do I get
the index of a node with antlr3?
CommonTreeNodeStream.getNodeIndex(Object) seems to be protected and is
not accessible.
thx for your help,
florian
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe
参展邀请书
每年九月定期在上海举办的中国国际鞋类展览会,经过十余年的发展,目前已成为国内最具权威性、最为世界所瞩目的国际性品牌展会,已经成为反映世界鞋类工业发展状况的"晴雨表"。
上届展会于2008年9月3-5日在上海新国际博览中心成功举办。展出面积达到了57500平方米,其中国外展区的面积达到23000平方米,国内展区的面积达到34500平方米。共有来自国内外37个国家和地区的近1200家企业参展,这些国家和地区包括阿根廷、澳大利亚、孟加拉﹑玻利维亚﹑巴西、加拿大、中国、捷克、埃及、埃塞俄比亚、法国、德国、香港、印度、伊朗、意大利、日本、哈萨克斯坦﹑韩国、墨西哥、纽西兰、巴基斯坦、葡萄牙、
12 matches
Mail list logo