Re: Re: C++ Question: switch / case vs. "chained" if elses for dealing with the ASCII character set
2011-05-01 00:26:24 GMT
On 1 May 2011 07:45, Philippe Lhoste <PhiLho <at> gmx.net> wrote: > On 30/04/2011 00:51, Lex Trotman wrote: >> >> 2. Scintilla does not parse a file from beginning to end, it can start >> anywhere, since the parser methods above generate state as they parse, >> they cannot start at an arbitrary point > > To be clear: AFAIK, Scintilla always lexes the document from the start. > There is no other way to know in which state it is in the middle of the > file. > Perhaps you wanted to mean that a Scintilla lexer can resume lexing from the > middle of the document because it can look at the state just before, keeping > the information in memory. Yes, I was only thinking about the re-lexing as edits occur (after all thats most of the time lexing will occur). Scintilla tells the lexer from where to re-lex from. And the saved state used by most current Scintilla lexers is minimal, often the style of the character before is sufficient. In particular they don't keep a recursive descent stack at every character or every token of the file, which was the real point. Recursive descent and Yacc parsers are interested in much more detail and so have much more state, and so are much less appropriate for restarting at an arbitrary point. Cheers Lex > > -- > Philippe Lhoste(Continue reading)
we opened the buffer and set it to modified -- the user can only save and close the buffer if it compiles again.
RSS Feed