From: Thiago A. <thi...@gm...> - 2005-11-26 22:19:49
|
2005/11/26, Leif Frenzel <hi...@le...>: > Thiago Arrais wrote: > So I'd say once we take layout into account and also consider the > braces, we should be able to rely on the structure that we get so; else > we would have a parse error. Right, I see your point. But the problem here is we don't parse the whole stream, so we can't be sure when an expression ends. Unless, of course, there is some kind of markup for this (a semicolon, for example). > Right. Another problem might be that we get confused with the > line/column numbers in the code. The trouble is that Eclipse uses > document coordinates in terms of offset/lengths (offset being the offset > from the file beginning), and not line/column/length. So we have to be > at least very careful that additiional inserted characters don't spoil > our coordinates :-) I think the current strategy is enough to deal with this issue. The column/line numbers are recorded by the lexer, which is the first agent on the queue and runs on a raw character stream without any kind of pre-processing. They are recorded as read from the original input, so I think there is no danger of getting lost (at least because of this). I have tried (not very hard) to record the coordinates in terms of offset, but it would take a good amount of antlr-hackery the way I was doing it. So I rolled it back. Do you think it would be better for us to have offset coordinates? Which coordinate system do we use more often? Is column/line information actually needed anywhere? Best wishes, Thiago Arrais |