*** empty log message ***

This commit is contained in:
hyung-hwan 2005-06-23 04:59:00 +00:00
parent a5ec22d457
commit bb35e822fd
6 changed files with 50 additions and 200 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: parser.c,v 1.38 2005-06-23 04:55:44 bacon Exp $ * $Id: parser.c,v 1.39 2005-06-23 04:59:00 bacon Exp $
*/ */
#include <xp/stx/parser.h> #include <xp/stx/parser.h>
@ -572,7 +572,7 @@ static int __parse_primary (xp_stx_parser_t* parser, const xp_char_t* ident)
return 0; return 0;
} }
static int __parse_block (xp_stx_parser_t* parser) static int __parse_block_constructor (xp_stx_parser_t* parser)
{ {
/* /*
* <block constructor> ::= '[' <block body> ']' * <block constructor> ::= '[' <block body> ']'

View File

@ -1,3 +1,43 @@
stx(1) xpkit
NAME
stx - xpkit embeddable smalltalk system
SYNOPSIS
stx [-f imageFile] MainClass
DESCRIPTION
The virtual machine executes "MainClass main" on start-up.
method 1.
push lookup_class(#MainClass) -> receiver.
send a unary(no argument) message with the selector #main.
return the returned value from main and exits.
method 2. - take a command parameter
push lookup_class(#MainClass) -> receiver.
push argc as an argument.
push argv as an argument.
send a double-argument message the the selector #main:withArgv:.
return the returned value from #main:withArgv and exits.
AUTHOR(S)
Chung, Hyung-Hwan (bacon@piowave.com) is the sole designer and implementer of stx.
BUG REPORTS
Report bugs to bacon@piowave.com if you find any bugs. but make sure that it is really a bug before you report it.
COPYRIGHT
Copyright(c) 2005 bacon@piowave.com
SEE ALSO
xpkit(7)
-------------------
/* /*
&unsupportedByte, //--- 00 &unsupportedByte, //--- 00
&bytePushInstance, //--- 01 &bytePushInstance, //--- 01

View File

@ -1,196 +0,0 @@
~~~ method grammar ~~~
<method definition> ::=
<message pattern>
[<temporaries> ]
[<statements>]
<message pattern> ::= <unary pattern> |
<binary pattern> |
<keyword pattern>
<unary pattern> ::= unarySelector
<binary pattern> ::= binarySelector <method argument>
<keyword pattern> ::= (keyword <method argument>)+
<temporaries> ::= '|' <temporary variable list> '|'
<temporary variable list> ::= identifier*
<block constructor> ::= '[' <block body> ']'
<block body> ::= [<block argument>* '|']
[<temporaries>] [<statements>]
<block argument> ::= ':' identifier
<statements> ::=
(<return statement> ['.'] ) |
(<expression> ['.' [<statements>]])
<return statement> ::= returnOperator <expression>
<expression> ::=
<assignment> |
<basic expression>
<assignment> ::= <assignment target> assignmentOperator <expression>
<basic expression> ::=
<primary> [<messages> <cascaded messages>]
<assignment target> := identifier
<primary> ::=
identifier |
<literal> |
<block constructor> |
( '(' <expression> ')' )
<messages> ::=
(<unary message>+ <binary message>* [<keyword message>] ) |
(<binary message>+ [<keyword message>] ) |
<keyword message>
<unary message> ::= unarySelector
<binary message> ::= binarySelector <binary argument>
<binary argument> ::= <primary> <unary message>*
<keyword message> ::= (keyword <keyword argument> )+
<keyword argument> ::= <primary> <unary message>* <binary message>*
<cascaded messages> ::= (';' <messages>)*
<literal> ::=
<number literal> |
<string literal> |
<character literal> |
<symbol literal> |
<selector literal> |
<array literal>
<number literal> ::= ['-'] <number>
<number> ::= integer | float | scaledDecimal
<character literal> ::= quotedCharacter
<string literal> ::= quotedString
<symbol literal> ::= hashedString
<selector literal> ::= quotedSelector
<array literal> ::= '#(' <array element>* ')'
<array element> ::= <literal> | identifier
reserved identifiers -> nil true false self super
~~~ lexical grammar ~~~
character ::=
"Any character in the implementation-defined character set"
whitespace ::=
"Any non-printing character interpreted as white space
including spaces, tabs, and line breaks"
digit ::=
'0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
uppercaseAlphabetic ::=
'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' |
'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' |
'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'
lowercaseAlphabetic ::=
'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' |
'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' |
's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'
nonCaseLetter ::= '_'
letter ::=
uppercaseAlphabetic |
lowercaseAlphabetic |
nonCaseLetter |
"implementation defined letters"
commentDelimiter ::= '"'
nonCommentDelimiter::=
"any character that is not a commentDelimiter "
comment :=
commentDelimiter nonCommentDelimiter * commentDelimiter
identifier ::= letter (letter | digit)*
keyword ::= identifier ':'
binaryCharacter ::=
'!' | '%' | '&' | '*' | '+' | ',' |
'/' | '<' | '=' | '>' | '?' | '@' |
'\' | '~' | '|' | '-'
binarySelector ::= binaryCharacter+
returnOperator ::= '^'
assignmentOperator ::= ':='
integer ::= decimalInteger | radixInteger
decimalInteger ::= digits
digits ::= digit+
radixInteger ::= radixSpecifier 'r' radixDigits
radixSpecifier := digits
radixDigits ::= (digit | uppercaseAlphabetic)+
float ::= mantissa [exponentLetter exponent]
mantissa ::= digits'.' digits
exponent ::= ['-']decimalInteger
exponentLetter ::= 'e' | 'd' | 'q'
scaledDecimal ::= scaledMantissa 's' [fractionalDigits]
scaledMantissa ::= decimalInteger | mantissa
fractionalDigits ::= decimalInteger
quotedCharacter ::= '$' character
quotedString ::= stringDelimiter stringBody stringDelimiter
stringBody ::= (nonStringDelimiter | (stringDelimiter stringDelimiter)*)
stringDelimiter ::= ''' "a single quote"
nonStringDelimiter ::= "any character except stringDelimiter"
hashedString ::= '#' quotedString
quotedSelector ::= '#' (unarySelector | binarySelector | keywordSelector)
keywordSelector ::= keyword+
separator ::= (whitespace | comment)*

View File

@ -1,5 +1,5 @@
/* /*
* $Id: token.h,v 1.16 2005-06-19 16:16:33 bacon Exp $ * $Id: token.h,v 1.17 2005-06-23 04:55:44 bacon Exp $
*/ */
#ifndef _XP_STX_TOKEN_H_ #ifndef _XP_STX_TOKEN_H_
@ -13,6 +13,7 @@ enum
XP_STX_TOKEN_END, XP_STX_TOKEN_END,
XP_STX_TOKEN_CHARLIT, XP_STX_TOKEN_CHARLIT,
XP_STX_TOKEN_STRLIT, XP_STX_TOKEN_STRLIT,
XP_STX_TOKEN_SYMLIT,
XP_STX_TOKEN_NUMLIT, XP_STX_TOKEN_NUMLIT,
XP_STX_TOKEN_IDENT, XP_STX_TOKEN_IDENT,
XP_STX_TOKEN_BINARY, XP_STX_TOKEN_BINARY,
@ -25,6 +26,7 @@ enum
XP_STX_TOKEN_RBRACKET, XP_STX_TOKEN_RBRACKET,
XP_STX_TOKEN_LPAREN, XP_STX_TOKEN_LPAREN,
XP_STX_TOKEN_RPAREN, XP_STX_TOKEN_RPAREN,
XP_STX_TOKEN_APAREN,
XP_STX_TOKEN_PERIOD, XP_STX_TOKEN_PERIOD,
XP_STX_TOKEN_SEMICOLON XP_STX_TOKEN_SEMICOLON
}; };

View File

@ -57,7 +57,6 @@ struct stdio_t
typedef struct stdio_t stdio_t; typedef struct stdio_t stdio_t;
int stdio_func (int cmd, void* owner, void* arg) int stdio_func (int cmd, void* owner, void* arg)
{ {

View File

@ -3,8 +3,13 @@ perform: method with: x with: y with: z with: a with: b with: c
| a b c d e f g | | a b c d e f g |
"
a := 'this is ''good'. a := 'this is ''good'.
a := #xxx niceMethod.
b := -30 xxx nil this. b := -30 xxx nil this.
"
(jjj xxx: 10 xy) zzz: (10 fuck: 20 you: 40) yyy: kkk.
" "
$a. $a.