From bb35e822fda82c3d43e708092e825fc2e070211e Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 23 Jun 2005 04:59:00 +0000 Subject: [PATCH] *** empty log message *** --- ase/stx/parser.c | 4 +- ase/stx/stx.txt | 40 +++++++++ ase/stx/syntax.bnf | 196 ------------------------------------------ ase/stx/token.h | 4 +- ase/test/stx/parser.c | 1 - ase/test/stx/test.st | 5 ++ 6 files changed, 50 insertions(+), 200 deletions(-) delete mode 100644 ase/stx/syntax.bnf diff --git a/ase/stx/parser.c b/ase/stx/parser.c index d3b4efa1..98935706 100644 --- a/ase/stx/parser.c +++ b/ase/stx/parser.c @@ -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 @@ -572,7 +572,7 @@ static int __parse_primary (xp_stx_parser_t* parser, const xp_char_t* ident) return 0; } -static int __parse_block (xp_stx_parser_t* parser) +static int __parse_block_constructor (xp_stx_parser_t* parser) { /* * ::= '[' ']' diff --git a/ase/stx/stx.txt b/ase/stx/stx.txt index da41482b..ab2e8d19 100644 --- a/ase/stx/stx.txt +++ b/ase/stx/stx.txt @@ -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 &bytePushInstance, //--- 01 diff --git a/ase/stx/syntax.bnf b/ase/stx/syntax.bnf deleted file mode 100644 index 81112540..00000000 --- a/ase/stx/syntax.bnf +++ /dev/null @@ -1,196 +0,0 @@ -~~~ method grammar ~~~ - - ::= - - [ ] - [] - - ::= | - | - - - ::= unarySelector - - ::= binarySelector - - ::= (keyword )+ - - ::= '|' '|' - - ::= identifier* - - ::= '[' ']' - - ::= [* '|'] - [] [] - - ::= ':' identifier - - ::= - ( ['.'] ) | - ( ['.' []]) - - ::= returnOperator - - ::= - | - - - ::= assignmentOperator - - ::= - [ ] - - := identifier - - ::= - identifier | - | - | - ( '(' ')' ) - - - ::= - (+ * [] ) | - (+ [] ) | - - - ::= unarySelector - - ::= binarySelector - - ::= * - - ::= (keyword )+ - - ::= * * - - ::= (';' )* - - ::= - | - | - | - | - | - - - ::= ['-'] - - ::= integer | float | scaledDecimal - - ::= quotedCharacter - - ::= quotedString - - ::= hashedString - - ::= quotedSelector - - ::= '#(' * ')' - - ::= | 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)* - - diff --git a/ase/stx/token.h b/ase/stx/token.h index 06a2d8ad..f39b914f 100644 --- a/ase/stx/token.h +++ b/ase/stx/token.h @@ -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_ @@ -13,6 +13,7 @@ enum XP_STX_TOKEN_END, XP_STX_TOKEN_CHARLIT, XP_STX_TOKEN_STRLIT, + XP_STX_TOKEN_SYMLIT, XP_STX_TOKEN_NUMLIT, XP_STX_TOKEN_IDENT, XP_STX_TOKEN_BINARY, @@ -25,6 +26,7 @@ enum XP_STX_TOKEN_RBRACKET, XP_STX_TOKEN_LPAREN, XP_STX_TOKEN_RPAREN, + XP_STX_TOKEN_APAREN, XP_STX_TOKEN_PERIOD, XP_STX_TOKEN_SEMICOLON }; diff --git a/ase/test/stx/parser.c b/ase/test/stx/parser.c index 22439502..4955e2c3 100644 --- a/ase/test/stx/parser.c +++ b/ase/test/stx/parser.c @@ -57,7 +57,6 @@ struct stdio_t typedef struct stdio_t stdio_t; - int stdio_func (int cmd, void* owner, void* arg) { diff --git a/ase/test/stx/test.st b/ase/test/stx/test.st index 191b1db2..b9dc596e 100644 --- a/ase/test/stx/test.st +++ b/ase/test/stx/test.st @@ -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 := 'this is ''good'. + a := #xxx niceMethod. b := -30 xxx nil this. +" + + (jjj xxx: 10 xy) zzz: (10 fuck: 20 you: 40) yyy: kkk. " $a.