[Laszlo-dev] For Review: Change 20080820-dda-z Summary: Allow public/protected/private/internal as identifiers; better error messages for other keywords

Donald Anderson dda at ddanderson.com
Wed Aug 20 14:11:42 PDT 2008


Change 20080820-dda-z by dda at lester.local on 2008-08-20 16:47:43 EDT
     in /Users/dda/laszlo/src/svn/openlaszlo/trunk-c
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Allow public/protected/private/internal as identifiers;  
better error messages for other keywords

New Features:

Bugs Fixed: LPP-6576 [Syntax error without reporting file name or line  
number w/ 4.1]

Technical Reviewer: ptw (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
     The two problems discussed in the JIRA are:
       - 'public/protected/private/internal' are not allowed as  
identifiers
       - when certain kinds of errors occur, no line number is given

     The first of these is straightforward to fix - public/protected/ 
private/internal
     are no longer keywords in the grammar, but they are recognized as
     'special' namespace identifiers.  This allows them to be also  
used as
     names of classes, vars, etc. so that previously working programs  
that happened
     to use 'public' as the name of a view, or other variable, can  
continue to work.

     The second is more difficult to solve in the general case -  
syntax errors are
     apparently not well handled by our version of JavaCC.  Upgrading  
to a newer
     JavaCC is not a trivial exercise - I did spend a few hours on it,  
and it may
     be something we want/need to do eventually.  For the time being,  
I ensured that
     every keyword known in our grammar can either be used as an  
identifier for
     view, etc. *or* it is known by the tag compiler to be forbidden,  
so a proper error
     message can be given.  This does not completely solve the general  
problem of being
     able to create programs that have mysterious syntax errors, but  
it should solve
     to class of problems where a view or other tag is named with a  
keyword.

Tests:
     - Test case given in LPP-6576.

     - Enhanced the same test case using all keywords found in  
Parser.jjt, for example
       <view name="true"/>  will no longer give a mysterious error  
message.

     - Regression: smokecheck (DHTML,SWF8), lzpix (ALL), weather  
(ALL), hello (SWF9)

Files:
M      WEB-INF/lps/server/src/org/openlaszlo/sc/ScriptCompiler.java
M      WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
M      WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ 
ASTModifiedDefinition.java

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080820-dda-z.tar



--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-547-7881
email: dda at ddanderson.com
www: http://www.ddanderson.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080820/3776ee97/attachment.html


More information about the Laszlo-dev mailing list