smalltalk parser and comments 
Author Message
 smalltalk parser and comments

Evaluating the line of code

  exampleApplication newPart open"ApplicationModal"Widget.

I expected to message the app with #openWidget but got a walkback
informing that #open was not understood.  Evidently, rather than
reading the entire expression (until the period), only up to the
first comment (") was read.

Is this the expected behavior for all Smalltalk implementations?

BTW:  in VisualAge 4.02, when opening an app with
#openApplicationModalWidget, the fonts of the opened app are different
from an app opened with just #openWidget.  The OS used here is
Windows NT.  

- Alexis



Wed, 18 Jun 1902 08:00:00 GMT  
 smalltalk parser and comments


Quote:
> Evaluating the line of code

>   exampleApplication newPart open"ApplicationModal"Widget.

> I expected to message the app with #openWidget but got a walkback
> informing that #open was not understood.

Assuming that #open is not a message that should have been understood, I'm
surprised that you would have expected anything else.

Quote:
> Evidently, rather than reading the entire expression (until the
> period), only up to the first comment (") was read.

No. The expression was correctly parsed as "exampleApplication newPart open
Widget" (e.g., the message #Widget being sent to the result of sending the
#open message). A comment is treated as white space for the purposes of
compilation. IOW, you *can't* embed a comment within a method selector like
that.

Quote:
> Is this the expected behavior for all smalltalk implementations?

Gosh, I sure hope so.

Quote:
> BTW:  in VisualAge 4.02, when opening an app with
> #openApplicationModalWidget, the fonts of the opened app are different
> from an app opened with just #openWidget.  The OS used here is
> Windows NT.  

This is exactly the expected behavior. A window opened with #openWidget is
a regular application window. The default font for normal application
windows under Win95 or NT 4.0 is the default system font. A window opened
using #openApplicationModalWidget is a dialog window. The default font for
dialogs under Win95/NT is MS Sans Serif 8 (or slightly larger at higher
resolutions). If you haven't specified a font for the widgets in your
window, the system defaults will be used (which are different depending on
the type of window).

BTW, if you have any doubts that two different fonts are used within the
system, look at the Win95/NT "Display" control panel. Then click on the
"Appearance" tab and compare "Window Text" (in the default system font) to
"Message Text" (in the default dialog font). You can even change the
default dialog font to match the default system font so that the windows
look the same no matter how they are opened.

-Eric Clayberg
President                      
Smalltalk Systems (StS), a division of Instantiations, Inc.



   Web: http://www.smalltalksystems.com
        http://www.instantiations.com

GO SMALLTALK!



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. syntax parser in tcl8.1 - wrong usage of braces in comments or strings

2. Look for XML Parsers for VA/Smalltalk V4.5 and VisualWorks V3.0

3. Smalltalk XML parser

4. XML parser for Smalltalk

5. T-Gen -- parser generator in Smalltalk

6. Q: T-gen/Smalltalk parsers generator tools ?

7. RTF Parser for Smalltalk??

8. Smalltalk grammer/parser

9. XML parser in Smalltalk

10. YACC that generates Smalltalk Parser

11. CGM Parser/Presenter in Smalltalk?

12. Smalltalk Parser generator wanted (Tgen?)

 

 
Powered by phpBB® Forum Software