[Cuis] OMeta

H. Hirzel hannes.hirzel at gmail.com
Wed May 20 08:05:44 CDT 2015


This is a file-out of which component from which source?



On 5/20/15, Phil (list) <pbpublist at gmail.com> wrote:
> On Sat, 2015-05-16 at 14:18 -0700, Casey Ransberger wrote:
>> It would be very cool to have a Cuis compiler written in OMeta to compare
>> and contrast with the one we have inherited from Smalltalk. The
>> performance of the two would be interesting to compare, as would be the
>> number of source lines of code, as well as that foggy "legibility" thing.
>>
>
> We've been so busy on the other thread(s), I forgot to show you this
> (just a starting point, but still):
>
> 'From Cuis 2.0 of 4 January 2010 [latest update: #393] on 20 May 2015 at
> 5:21:43 am'!
> !classDefinition: #O2SqueakRecognizer category: #OMeta2!
> OMeta2 subclass: #O2SqueakRecognizer
> 	instanceVariableNames: ''
> 	classVariableNames: 'TypeTable'
> 	poolDictionaries: ''
> 	category: 'OMeta2'!
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 00:43'!
> arrayConstr =
>
> 	"{" expr ("." expr)* ("." | empty) "}"
> |	"{" "}"! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 00:57'!
> arrayLit =
>
> 	"#" "(" (literal | arrayLit | spaces tsArraySymbol)* ")"! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 00:57'!
> binary =
>
> 	spaces tsBinary! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 00:58'!
> binaryExpr =
>
> 	binaryExpr binaryMsg
> |	unaryExpr! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 00:58'!
> binaryMsg =
>
> 	binary unaryExpr! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:08'!
> block =
>
> 	"["
> 		(	(":" identifier)+ "|"
> 		|	empty
> 		)
>
> 		(	"|" identifier* "|"
> 		|	empty
> 		)
>
> 		(	expr ("." expr)* ("." "^" expr | empty)
> 		|	"^" expr
> 		|	empty
> 		)
>
> 		(	"."
> 		|	empty
> 		)
>
> 	"]"! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 00:58'!
> cascade =
>
> 	identifier
> |	binaryMsg
> |	keywordMsg! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 00:59'!
> expr =
>
> 	identifier (":=" | "_") expr
> |	msgExpr! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:18'!
> identifier =
>
> 	spaces tsIdentifier ~$:! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:19'!
> keyword =
>
> 	spaces tsKeyword! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:19'!
> keywordExpr =
>
> 	binaryExpr keywordMsg! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:19'!
> keywordMsg =
>
> 	keywordMsg keywordMsgPart
> |	keywordMsgPart! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:20'!
> keywordMsgPart =
>
> 	keyword binaryExpr! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:20'!
> literal =
>
> 	spaces	(	tsNumber
> 			|	tsCharacter
> 			|	tsString
> 			|	tsSymbol
> 			)
> ! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:21'!
> msgExpr =
>
> 	(keywordExpr | binaryExpr) (";" cascade)*! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:30'!
> squeakExpr =
>
> 	<expr>! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'pb
> 2/11/2010 01:28'!
> squeakExprs =
> 	<expr>$. <squeakExprs>
> |	<expr>! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:23'!
> symbol =
>
> 	"#" spaces
> 		(	tsString
> 		|	tsKeyword (tsIdentifier | empty)
> 		)! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:23'!
> tcBinaryChar =
>
> 	char:x ?[(TypeTable at: x asciiValue) == #xBinary]! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:25'!
> tsArraySymbol =
>
> 	tsKeyword+ (tsIdentifier | empty)
> |	tsIdentifier! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:25'!
> tsBinary =
>
> 	($| | tcBinaryChar) tcBinaryChar*! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:25'!
> tsCharacter =
>
> 	$$ char! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:26'!
> tsIdentifier =
>
> 	letter (letter | digit)*! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:31'!
> tsKeyword =
>
> 	tsIdentifier $:! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:26'!
> tsNatural =
>
> 	digit+! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:27'!
> tsNumber =
>
> 	($+ | $- | empty) tsNatural! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:28'!
> tsString =
>
> 	$' ($' $' | ~$' char)* $'! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:28'!
> tsSymbol =
>
> 	$# spaces (tsString | tsArraySymbol)! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:28'!
> unaryExpr =
>
> 	unit identifier*! !
>
> !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 01:29'!
> unit =
>
> 	literal
> |	identifier
> |	arrayLit
> |	arrayConstr
> |	block
> |	"(" expr ")"
> ! !
>
> "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
> !classDefinition: 'O2SqueakRecognizer class' category: nil!
> O2SqueakRecognizer class
> 	instanceVariableNames: ''!
>
> !O2SqueakRecognizer class methodsFor: 'as yet unclassified' stamp: 'aw
> 2/20/2009 02:04'!
> initialize
>
> 	TypeTable := #(#xBinary #xBinary #xBinary #xBinary #xBinary #xBinary
> #xBinary #xBinary #xDelimiter #xDelimiter #xBinary #xDelimiter
> #xDelimiter #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary
> #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary
> #xBinary #xBinary #doIt #xBinary #xDelimiter #xBinary #xDoubleQuote
> #xLitQuote #xDollar #xBinary #xBinary #xSingleQuote #leftParenthesis
> #rightParenthesis #xBinary #xBinary #xBinary #xBinary #period #xBinary
> #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit
> #xDigit #xColon #semicolon #xBinary #xBinary #xBinary #xBinary #xBinary
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #leftBracket #xBinary #rightBracket #upArrow
> #leftArrow #xBinary #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #leftBrace #verticalBar
> #rightBrace #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary
> #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary
> #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary
> #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary
> #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary
> #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xLetter #xBinary
> #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary
> #xBinary #xLetter #xBinary #xBinary #xBinary #xBinary #xLetter #xBinary
> #xBinary #xBinary #xBinary #xBinary #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xBinary #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xBinary #xLetter #xLetter #xLetter #xLetter
> #xLetter #xLetter #xLetter #xLetter #xBinary)! !
>
>
> O2SqueakRecognizer initialize!
>
>
>
>
> _______________________________________________
> Cuis mailing list
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>




More information about the Cuis mailing list