Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28296

Re: [LONG POST] Re: Parser

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: [LONG POST] Re: Parser
Date 2014-04-28 02:09 -0700
Organization Canadian Mind Products
Message-ID <4f5sl9t5in2dut9a08ri5dcejoqketu4kc@4ax.com> (permalink)
References <ur1rl9pb9bkqgd7dg87cqqt56bt4jljbc2@4ax.com> <ljk5n6$dcb$1@dont-email.me>

Show all headers | View raw


On Sun, 27 Apr 2014 19:59:35 -0400, Jeff Higgins
<jeff@invalid.invalid> wrote, quoted or indirectly quoted someone who
said :

>>
>
>Not parser generator but some issues to be aware of.
><http://openjdk.java.net/projects/compiler-grammar/>

I don't a full language parser because it would fail on fine points of
grammar unrelated to tidying the order of methods.  It would also need
eternal maintenance as new esoteric features are added. 

I wrote a finite state machine for parsing Java fragments for
colourising. It has the advantage of surviving fragments or
grammatical errors. I might do it that way or try ANTLR/JavaCC to
invent a sort "birdseye" grammar of Java that should stable. It would
have a generic code element that must have balanced {} inside
excluding "..." ' ' and comments. I don't care what is inside a method
body, so long as I am sure I know where the method ends.


One of my big complaints with java is you can't tell where something
ends without a detailed analysis of every {} inside. The eye cannot do
that.  You have to use a tool to do it that creates indentation which
the eye can understand. But often the two are out of sync.

I hope some day the IDE will mark the ends of ifs, loops, classes with
some subtle but distinct visual clue in addition to indentation.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
Computers are like Old Testament gods; lots of rules and no mercy. 
~ Joseph Campbell (born: 1904-03-26 died: 1987-10-31 at age: 83)

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Parser Roedy Green <see_website@mindprod.com.invalid> - 2014-04-27 15:46 -0700
  [LONG POST] Re: Parser Jeff Higgins <jeff@invalid.invalid> - 2014-04-27 19:59 -0400
    Re: [LONG POST] Re: Parser Jeff Higgins <jeff@invalid.invalid> - 2014-04-27 20:00 -0400
    Re: [LONG POST] Re: Parser Roedy Green <see_website@mindprod.com.invalid> - 2014-04-28 02:09 -0700
  Re: Parser Silvio <silvio@internet.com> - 2014-04-28 11:30 +0200
    Re: Parser Roedy Green <see_website@mindprod.com.invalid> - 2014-04-29 13:15 -0700
      Re: Parser Joerg Meier <joergmmeier@arcor.de> - 2014-04-29 22:55 +0200
        Re: Parser Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-05-05 08:13 +0000
      Re: Parser Jeff Higgins <jeff@invalid.invalid> - 2014-04-29 18:28 -0400
        Re: Parser Jeff Higgins <jeff@invalid.invalid> - 2014-04-29 18:35 -0400
      Re: Parser Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-04-29 17:31 -0500
      Re: Parser Simon Lewis <simonlewis2001@gmail.com> - 2014-04-30 15:13 +0200

csiph-web