Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!mit.eternal-september.org!.POSTED!not-for-mail From: Simon Lewis Newsgroups: comp.lang.java.programmer Subject: Re: Parser Date: Wed, 30 Apr 2014 15:13:54 +0200 Organization: Lewis Lines: 32 Message-ID: <87oazjvu25.fsf@gmail.com> References: <535e1fc6$0$2975$e4fe514c@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mit.eternal-september.org; posting-host="a14f73acc4a8a7d92e915b9f935c3b69"; logging-data="1579"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191ko70+ZxFbmRJe8FQ/SI/3w9aihwdbEs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:Bq+vDDW93KlkPAEwVnUysjJf4/8= sha1:1LH4eolNiNBb8vCl3qxWr4xnDeA= Xref: csiph.com comp.lang.java.programmer:28321 Roedy Green writes: > On Mon, 28 Apr 2014 11:30:45 +0200, Silvio > wrote, quoted or indirectly quoted someone who said : > >> >>The fact that a no such keywords exist does not make parsing slower by >>definition. In the Java case it unlikely that such keywords would make >>parsing faster. The language grammar defines how fast a parser can be. >>Although the Java grammar is not strictly LALR(x) Java can be parsed >>pretty left-to-right with the use of some simple tweaks and assumptions >>to prevent expensive things like backtracking > > Consider how far you have to parse into definition to tell if you have > a variable or a method definition. > > An IDE could insert visible markers to mark the begins and end of > things. I must waste at least an hour a day trying to figure out which > { } balances with what. It is not a task my eyes can do, especially > when the other half is offscreen. Huh? Use expand/collapse then in any good editor. Its easy. Especially with colour hiliting parenthesis matching. > > Another solution would be a SCID which would not let you cut/copy > paste an unbalanced block of code. You would think of program as > composed on units -- like plumbing, not a stream of characters. You mean like all programmers already do? And pretty much all editors treat them?