Object subclass: #ScriptInterpreter2 instanceVariableNames: 'nodes results' classVariableNames: '' poolDictionaries: '' category: 'Coral-DeadCode'! !ScriptInterpreter2 methodsFor: 'as yet unclassified' stamp: 'ms 1/25/2008 15:27'! interpret results := nodes collect: [:each | each execute]! ! !ScriptInterpreter2 methodsFor: 'accessing' stamp: 'ms 1/24/2008 17:33'! nodes ^ nodes! ! !ScriptInterpreter2 methodsFor: 'accessing' stamp: 'ms 1/24/2008 17:33'! nodes: anObject nodes := anObject! ! !ScriptInterpreter2 methodsFor: 'accessing' stamp: 'ms 1/25/2008 15:28'! result ^results last! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! ScriptInterpreter2 class instanceVariableNames: ''! !ScriptInterpreter2 class methodsFor: 'as yet unclassified' stamp: 'ms 1/25/2008 15:29'! interpret: nodes ^self new nodes: nodes; interpret; yourself! ! !ScriptInterpreter2 class methodsFor: 'as yet unclassified' stamp: 'ms 1/24/2008 21:33'! jumpIfBashScript: aStream (aStream peek =$#) ifTrue: [ [| aChar | aChar := aStream next. (aChar = nil) or: [(aChar = Character lf) or: [aChar = Character cr]]] whileFalse]. ^aStream! ! !ScriptInterpreter2 class methodsFor: 'as yet unclassified' stamp: 'ms 1/25/2008 15:28'! parseAndInterpret: aStream ^self interpret: (SaphirParser2 parseScript: (self jumpIfBashScript: aStream)) ! ! SmaCCParser subclass: #SqueakParser instanceVariableNames: 'messageError' classVariableNames: 'DicTokens' poolDictionaries: '' category: 'Coral-DeadCode'! !SqueakParser commentStamp: 'ajh 3/24/2003 18:24' prior: 0! I parse Smalltalk text into a Refactory abstract syntax tree, whose root is RBMethodNode or RBDoItNode. Methods under 'generated-*' categories were automatically generated using SmaCC.! !SqueakParser methodsFor: 'private' stamp: 'ms 7/13/2006 10:02'! actionForCurrentToken | ids action | ids := currentToken id. 1 to: ids size do: [:i | action := self actionFor: (ids at: i). (action bitAnd: self actionMask) = self errorAction ifFalse: [^ action]. "Convert negative number to binarySymbol" (self isNegativeNumberId:(ids at: i)) ifTrue: [ ^self negativeNumberToBinaryString]. "Ignore repeating periods" (self isEmptyStatementId: (ids at: i)) ifTrue: [ ^ self ignoreEmptyStatement]. ]. ^ self errorAction! ! !SqueakParser methodsFor: 'private' stamp: 'ms 9/4/2006 00:20'! externalTypeOn: aNode | xType descriptorClass | descriptorClass := Smalltalk at: #ExternalFunction ifAbsent:[^nil]. xType := descriptorClass atomicTypeNamed: aNode first value. xType == nil ifTrue:["Look up from class scope" Symbol hasInterned: aNode first value ifTrue:[:sym| xType := descriptorClass structTypeNamed: sym]]. xType == nil ifTrue:[ "Raise an error if user is there" self interactive ifTrue:[^nil]. "otherwise go over it silently" xType := descriptorClass forceTypeNamed: aNode first value]. ^xType.! ! !SqueakParser methodsFor: 'private' stamp: 'ms 7/13/2006 09:48'! ignoreEmptyStatement currentToken _ nil. self getNextToken. ^ self actionForCurrentToken! ! !SqueakParser methodsFor: 'private' stamp: 'ms 7/13/2006 09:59'! isEmptyStatementId: id ^ ((id = scanner periodId) and: [nodeStack isEmpty]) or: [(id = scanner periodId) and: [(nodeStack last isKindOf: SmaCCToken) and: [nodeStack last id first = scanner periodId]]] ! ! !SqueakParser methodsFor: 'private' stamp: 'ms 7/13/2006 09:58'! isNegativeNumberId: id ^ scanner negativeNumberId = id! ! !SqueakParser methodsFor: 'private' stamp: 'ms 9/17/2006 15:27'! negativeNumberToBinaryString currentToken := (SqueakToken value: '-' start: currentToken startPosition id: (Array with: scanner binarySymbolId)) substitueTo: currentToken; yourself. scanner position: currentToken stopPosition. ^ self actionForCurrentToken! ! !SqueakParser methodsFor: 'private' stamp: 'ajh 3/6/2003 00:02'! nodeStack ^ nodeStack! ! !SqueakParser methodsFor: 'private' stamp: 'ajh 3/6/2003 00:19'! scanner ^ scanner! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:01'! add3: nodes ^ nodes first copyWith: nodes third! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/14/2003 23:59'! add: nodes ^ nodes first copyWith: nodes second! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/14/2003 23:54'! addMessagePart: nodes ^ {nodes first first copyWith: nodes second. nodes first second copyWith: nodes third}! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/14/2003 23:58'! array ^ #()! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 18:00'! array: nodes ^ (RBArrayNode leftBrace: nodes first start rightBrace: nodes third stop statements: nodes second) firstToken: nodes first; lastToken: nodes last; yourself.! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 22:47'! arrayAddToken: nodes ^OrderedCollection with: #() with: nodes first with: nodes first! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:07'! assignment: nodes ^ RBAssignmentNode variable: nodes first value: nodes third! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 18:43'! blockArgs: nodes ^ (RBBlockNode arguments: nodes second body: (RBSequenceNode statements: #())) left: nodes first start; right: nodes third stop; firstToken: nodes first; lastToken: nodes last; yourself! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 18:43'! blockNoArgs: nodes ^ (RBBlockNode body: nodes second) left: nodes first start; right: nodes third stop; firstToken: nodes first; lastToken: nodes last; yourself! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 18:39'! blockWithArgs: nodes ^ (RBBlockNode arguments: nodes second body: nodes fourth) left: nodes first start; right: nodes fifth stop; firstToken: nodes first; lastToken: nodes last; yourself! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 23:07'! blockWithTemps: nodes ^ (RBBlockNode arguments: nodes second body: ((RBSequenceNode temporaries: nodes fourth statements: nodes sixth) firstToken: nodes third)) left: nodes first start; right: nodes seventh stop; firstToken: nodes first; lastToken: nodes last; yourself! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:23'! byteStream ^ ByteArray new writeStream! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:25'! byteStreamPut: nodes ^ nodes first nextPut: nodes second value asNumber; yourself! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 01:01'! callConvention: nodes | descriptorClass | descriptorClass := Smalltalk at: #ExternalFunction ifAbsent:[^nil]. ^OrderedCollection with:(descriptorClass callingConventionFor: nodes first value) with: nodes first.! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:12'! cascade: nodes ^ (nodes first isKindOf: RBMessageNode) ifTrue: [RBCascadeNode messages: {nodes first. RBMessageNode new receiver: nodes first receiver selectorParts: nodes third first arguments: nodes third last}] ifFalse: [RBCascadeNode messages: (nodes first messages copyWith: (RBMessageNode new receiver: nodes first messages first receiver selectorParts: nodes third first arguments: nodes third last))]! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:27'! contents2: nodes ^ nodes second contents! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 01:40'! externalCall: nodes | fn | Smalltalk at: #ExternalLibraryFunction ifPresent:[:xfn| fn := xfn name: nodes third module: nil callType: nodes first first returnType: nodes second first argumentTypes: nodes fifth first contents. ]. ^ OrderedCollection with: (Pragma keyword: #primitive: arguments: #(120)) with: fn with: 120 with: nodes first second with: nodes fifth second! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 7/25/2006 13:37'! externalFunction: nodes ^nodes first value withoutQuoting asSymbol.! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 7/25/2006 13:37'! externalIndex: nodes ^nodes first value.! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 01:40'! externalModuleCall: nodes | fn | Smalltalk at: #ExternalLibraryFunction ifPresent:[:xfn| fn := xfn name: nodes third module: nodes last value withoutQuoting asSymbol callType: nodes first first returnType: nodes second first argumentTypes: nodes fifth first contents. ]. ^ OrderedCollection with: (Pragma keyword: #primitive: arguments: #(120)) with: fn with: 120 with: nodes first second with: nodes last! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 01:30'! externalType: nodes ^OrderedCollection with: (self externalTypeOn: nodes) with: nodes last ! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 01:34'! externalTypePointer: nodes | xType | xType := self externalTypeOn: nodes. xType ifNil:[^nodes]. ^OrderedCollection with: xType asPointerType with: nodes last! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/14/2003 23:53'! first: nodes ^ nodes first! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:01'! firstIn: nodes ^ {nodes first}! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/19/2006 16:25'! litArray: nodes | litToken | litToken := (SqueakToken value: (String new: (nodes fourth stop - nodes second start + 1)) start: nodes second start). litToken previous: nodes first previous. litToken next: nodes last next. ^ (RBLiteralNode literalToken: litToken value: nodes third contents) firstToken: nodes first; lastToken: nodes last; yourself! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:16'! litChar: nodes ^ RBLiteralNode literalToken: nodes first value: (nodes first value at: 2)! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:14'! litFalse: nodes ^ RBLiteralNode literalToken: nodes first value: false! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:14'! litNil: nodes ^ RBLiteralNode literalToken: nodes first value: nil! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'md 10/18/2004 17:23'! litNumber: nodes | str num | str _ nodes first value readStream. num _ Number readFrom: str. str atEnd ifFalse: [ currentToken _ nil. scanner position: scanner position - (str originalContents size - str position) + 1. self reportErrorMessage: 'Digit out of range']. ^ RBLiteralNode literalToken: nodes first value: num! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:18'! litString: nodes | s | s _ nodes first value. ^ RBLiteralNode literalToken: nodes first value: ((s copyFrom: 2 to: s size - 1) copyReplaceAll: '''''' with: '''')! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 3/31/2007 17:53'! litStringSymbol: nodes | s | s := nodes second value. ^ (RBLiteralNode literalToken: nodes second value: ((s copyFrom: 2 to: s size - 1) copyReplaceAll: '''''' with: '''') asSymbol) firstToken: nodes first; yourself! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 19:12'! litSymbol: nodes ^ (RBLiteralNode literalToken: nodes second value: nodes second value asSymbol) firstToken: nodes first; yourself! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:14'! litTrue: nodes ^ RBLiteralNode literalToken: nodes first value: true! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/14/2003 23:52'! messagePart: nodes ^ {{nodes first}. {nodes second}}! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 01:28'! messagePragma: nodes "self haltIf: [(nodes first first isKindOf: Pragma) not]." ^nodes first ! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:13'! messageSend: nodes ^ RBMessageNode new receiver: nodes first selectorParts: nodes second first arguments: nodes second last! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/14/2003 23:48'! method: nodes ^ RBMethodNode new selectorParts: nodes first first arguments: nodes first last; body: nodes second! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 7/15/2006 19:07'! methodPragma: nodes ^RBMethodNode new selectorParts: nodes first first arguments: nodes first last; body: nodes third; pragmas:nodes second! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'pmm 11/11/2006 14:12'! methodPragmaTempsPragma: nodes | sequence | sequence := (RBSequenceNode temporaries: nodes third first statements: nodes fifth) firstToken: nodes third second; yourself. nodes fifth isEmpty ifFalse: [ sequence lastToken: nodes third third ]. ^ RBMethodNode new selectorParts: nodes first first arguments: nodes first last; body: sequence; pragmas: (nodes second addAll: nodes fourth; yourself)! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'pmm 11/11/2006 14:15'! methodTempsPragma: nodes | sequence | sequence := (RBSequenceNode temporaries: nodes second first statements: nodes fourth) firstToken: nodes second second; yourself. nodes fourth isEmpty ifFalse: [ sequence lastToken: nodes second third ]. ^ RBMethodNode new selectorParts: nodes first first arguments: nodes first last; body: sequence; pragmas: nodes third! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 01:31'! parameterExtCall: nodes | args | args := WriteStream on: Array new. args nextPut: nodes first first. ^OrderedCollection with: args with: nodes first second! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 01:34'! parametersExtCall: nodes | aCol | aCol := nodes first. aCol first nextPut: (nodes second first). aCol at: 2 put: nodes second second. ^aCol! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 17:13'! pragma: nodes "self haltIf: [nodes second first isKindOf: Pragma]." "| pragmaNode | pragmaNode := RBPragmasNode withPragma: nodes second first spec: nodes second second. nodes second third ifNotNil: [pragmaNode primitiveNumber: nodes second third]. ^pragmaNode" | rbPragma | rbPragma := RBPragmaNode pragma: nodes second first spec: nodes second second start: nodes first start stop: nodes third stop firstToken: nodes first lastToken: nodes last. nodes second third ifNotNil: [rbPragma primitiveNumber: nodes second third]. ^OrderedCollection with: rbPragma! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 11/11/2006 17:42'! pragmaMessage: nodes | arguments keyword | keyword := String new. arguments := (nodes first second collect: [:each | each value]). nodes first first do: [:each | keyword := keyword, each value]. ^OrderedCollection with:(Pragma keyword: keyword asSymbol arguments: arguments) with: nil with: nil with: nodes first first first with: nodes first second last token ! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 01:47'! pragmaUnaryMessage: nodes ^OrderedCollection with:(Pragma keyword: nodes first first first value asSymbol arguments: nodes first second) with: nil with: nil with: nodes first first first with: nodes first first first ! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 17:24'! pragmas: nodes "nodes first addPragma: nodes third first withSpec: nodes third second. nodes third third ifNotNil: [nodes first primitiveNumber: nodes third third]. ^nodes first" | rbPragma | rbPragma := RBPragmaNode pragma: nodes third first spec: nodes third second start: nodes second start stop: nodes fourth stop firstToken: nodes second lastToken: nodes last. nodes third third ifNotNil: [rbPragma primitiveNumber: nodes third third]. nodes first add: rbPragma. ^nodes first ! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 00:54'! primitiveModule: nodes ^OrderedCollection with: (Pragma keyword: #primitive:module: arguments: (Array with: nodes second value withoutQuoting asSymbol with: nodes fourth value withoutQuoting asSymbol)) with: (Array with: nodes fourth value withoutQuoting asSymbol with: nodes second value withoutQuoting asSymbol with: 0 with: 0) with: 117 with: nodes first with: nodes last ! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 00:54'! primitiveNumber: nodes ^OrderedCollection with: (Pragma keyword: #primitive: arguments: (Array with: nodes second value asInteger)) with: nil with: nodes second value asInteger with: nodes first with: nodes second ! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/17/2006 00:53'! primitiveString: nodes ^OrderedCollection with: (Pragma keyword: #primitive: arguments: (Array with: nodes second value withoutQuoting asSymbol)) with: (Array with: nil with: nodes second value withoutQuoting asSymbol with: 0 with: 0) with: 117 with: nodes first with: nodes second! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 18:50'! return: nodes ^ {(RBReturnNode return: nodes first start value: nodes second) firstToken: nodes first; yourself}! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/19/2003 13:49'! returnAdd: nodes ^ nodes first copyWith: (RBReturnNode return: nodes third start value: nodes fourth)! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/14/2003 23:58'! second: nodes ^ nodes second! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 3/31/2007 20:31'! secondAddToken: nodes ^OrderedCollection with: nodes second with: nodes first with: nodes last! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:06'! secondIn: nodes ^ {nodes second}! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/18/2006 17:47'! secondPutToken: nodes nodes second firstToken: nodes first. nodes second lastToken: nodes last. ^nodes second! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 3/31/2007 17:51'! secondWithParenthesis: nodes nodes second addParenthesis: (nodes first start to: nodes last stop). nodes second firstToken: nodes first. nodes second lastToken: nodes last. ^nodes second! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/14/2003 23:57'! sequence: nodes ^ RBSequenceNode statements: nodes first! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ms 9/25/2006 12:55'! sequenceWithTemps: nodes nodes second ifNotEmpty: [^ (RBSequenceNode temporaries: nodes first first statements: nodes second) firstToken: nodes first second; yourself] ifEmpty:[^ (RBSequenceNode temporaries: nodes first first statements: nodes second) firstToken: nodes first second; lastToken:nodes first third]! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:23'! stream ^ Array new writeStream! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:26'! streamPut: nodes ^ nodes first nextPut: nodes second; yourself! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/14/2003 23:52'! unaryMessage: nodes ^ {{nodes first}. #()}! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:27'! value: nodes ^ nodes first value! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:27'! valueSymbol: nodes ^ nodes first value asSymbol! ! !SqueakParser methodsFor: 'reduction actions' stamp: 'ajh 3/15/2003 00:13'! variable: nodes ^ RBVariableNode new identifierToken: nodes first! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/10/2006 22:39'! argumentMissing: nodes messageError := 'Argument expected'. ^nodes! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/8/2007 13:52'! argumentNameMissing: nodes messageError := 'Argument name or | expected'. ^nodes! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/10/2006 22:36'! cascadeMMissing: nodes messageError := 'Cascade expected'. ^nodes! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 10/6/2006 15:14'! checkForErrors "If we have an error correction installed, we might have handled the errors. If we did, we don't want to return the result, so we raise a final exception that can't be proceeded." errorToken isNil ifTrue: [^self]. currentToken := errorToken. self reportErrorMessage: (messageError ifNil:['Token not expected']) ! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 10/10/2006 22:23'! collectAcceptableToken ^self class tokensId select:[:each | (self actionFor: each) ~~ self errorAction]! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 10/20/2006 17:52'! expressionMissing: nodes messageError := 'Expression expected'. ^nodes! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/11/2006 17:21'! findErrorHandlerIfNoneUseErrorNumber: anInteger | state reduceEntry items reduceIndex | state := self stateErrorShiftInto. state = 0 ifFalse:[reduceIndex := (self findReduceActionForState: state). stateStack addLast: state. reduceEntry := self reduceTable at: reduceIndex. items := OrderedCollection new: (reduceEntry at: 2). self performReduceMethod: (reduceEntry at: 3) with: items]. self reportError: anInteger ! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 10/20/2006 17:33'! findReduceActionForState: state 1 to: self errorTokenId do: [:i | | action | action := self actionForState: state and: i. (action bitAnd: self actionMask) = self reduceAction ifTrue: [^action bitShift: -2]]. ^0! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 10/20/2006 18:00'! handleError: anInteger errorToken isNil ifTrue: [errorToken := currentToken]. self hasErrorHandler not ifTrue: [self reportError: anInteger]. self findErrorHandlerIfNoneUseErrorNumber: anInteger! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/11/2006 12:29'! literalMissing: nodes messageError := 'Literal constant expected'. ^nodes! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/11/2006 12:12'! moduleArgMissing: nodes messageError := 'Module name expected'. ^nodes! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/1/2006 01:34'! pragmaEndMissing: nodes messageError := '> expected'. ^nodes! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/10/2006 22:32'! pragmaMissing: nodes messageError := 'Pragma declaration expected'. ^ nodes! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/11/2006 12:10'! primitiveArgMissing: nodes messageError := 'String or number primitive expected'. ^nodes! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 10/19/2006 22:15'! reportError: anInteger messageError ifNil:[ | acceptedToken | messageError := ''. acceptedToken := self collectAcceptableToken asArray. acceptedToken do: [:each | acceptedToken last == each ifFalse:[messageError := messageError, (self class tokenDescription: each)] ifTrue:[messageError := messageError, (self class tokenDescription: each), ' expected']] separatedByNext:[:each | acceptedToken last == each ifFalse:[messageError := messageError, ', '] ifTrue:[messageError := messageError, ' or ']]. messageError := messageError capitalized]. self reportErrorMessage: (anInteger = 0 ifTrue: [messageError] ifFalse: [self errorTable at: anInteger]) ! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 11/10/2006 22:31'! stateErrorShiftInto stateStack size to: 1 by: -1 do: [:i | | action | action := self actionForState: (stateStack at: i) and: self errorTokenId. (action bitAnd: self actionMask) = self reduceAction ifTrue:[self reduce:(action bitShift: -2). ^self stateErrorShiftInto]. (action bitAnd: self actionMask) = self shiftAction ifTrue: [^ action bitShift: -2]. stateStack removeLast]. ^ 0! ! !SqueakParser methodsFor: 'error handling' stamp: 'ms 10/20/2006 17:44'! verticalBarMissing: nodes messageError := 'Vertical bar expected'. ^nodes! ! !SqueakParser methodsFor: 'generated-reduction actions' stamp: 'ms 4/7/2007 03:32'! reduceActionForOptionalXXXperiodX1: nodes ^ nil! ! !SqueakParser methodsFor: 'generated-reduction actions' stamp: 'ms 4/7/2007 03:32'! reduceActionForOptionalXXXperiodX2: nodes ^ nodes at: 1! ! !SqueakParser methodsFor: 'generated-tables' stamp: 'ms 4/7/2007 03:32'! reduceTable ^#( #(39 1 #reduceFor:) #(40 1 #variable:) #(41 2 #messagePart:) #(41 2 #argumentNameMissing:) #(41 3 #addMessagePart:) #(41 3 #argumentNameMissing:) #(42 2 #method:) #(42 3 #methodPragma:) #(42 5 #methodPragmaTempsPragma:) #(42 4 #methodTempsPragma:) #(43 0 #array) #(43 2 #add:) #(44 1 #firstIn:) #(44 3 #add3:) #(45 0 #reduceActionForOptionalXXXperiodX1:) #(45 1 #reduceActionForOptionalXXXperiodX2:) #(46 1 #first:) #(46 1 #first:) #(46 1 #first:) #(47 2 #secondIn:) #(47 2 #argumentNameMissing:) #(47 3 #add3:) #(47 3 #argumentNameMissing:) #(48 5 #blockWithArgs:) #(48 3 #blockNoArgs:) #(48 3 #blockArgs:) #(48 7 #blockWithTemps:) #(49 3 #assignment:) #(49 3 #expressionMissing:) #(50 1 #first:) #(50 3 #cascade:) #(50 3 #cascadeMMissing:) #(51 0 #array) #(51 2 #first:) #(51 5 #returnAdd:) #(51 3 #return:) #(52 3 #array:) #(53 1 #litTrue:) #(53 1 #litFalse:) #(53 1 #litNil:) #(53 1 #litNumber:) #(53 1 #litNumber:) #(53 1 #litChar:) #(53 1 #litString:) #(53 2 #litStringSymbol:) #(53 2 #litSymbol:) #(53 2 #litSymbol:) #(53 2 #litSymbol:) #(53 2 #litSymbol:) #(53 2 #litSymbol:) #(53 4 #litArray:) #(53 4 #litArray:) #(53 1 #litString:) #(54 1 #first:) #(54 1 #first:) #(54 1 #first:) #(55 1 #arrayAddToken:) #(55 3 #secondAddToken:) #(55 3 #verticalBarMissing:) #(56 1 #sequence:) #(56 2 #sequenceWithTemps:) #(57 2 #messageSend:) #(57 2 #messageSend:) #(57 2 #messageSend:) #(58 2 #messageSend:) #(58 2 #messageSend:) #(58 2 #messageSend:) #(59 2 #messageSend:) #(59 2 #messageSend:) #(60 1 #unaryMessage:) #(61 2 #messagePart:) #(61 2 #argumentMissing:) #(62 2 #messagePart:) #(62 2 #argumentMissing:) #(62 3 #addMessagePart:) #(62 3 #argumentMissing:) #(63 1 #first:) #(63 1 #first:) #(63 1 #first:) #(64 1 #first:) #(64 1 #first:) #(65 3 #pragma:) #(65 3 #pragmaEndMissing:) #(65 2 #pragmaMissing:) #(65 4 #pragmas:) #(65 4 #pragmaEndMissing:) #(65 3 #pragmaMissing:) #(66 0 #byteStream) #(66 2 #byteStreamPut:) #(67 0 #stream) #(67 2 #streamPut:) #(68 1 #value:) #(68 1 #valueSymbol:) #(68 1 #valueSymbol:) #(68 1 #valueSymbol:) #(68 1 #valueSymbol:) #(68 1 #valueSymbol:) #(68 3 #contents2:) #(68 3 #contents2:) #(68 1 #valueSymbol:) #(69 3 #secondWithParenthesis:) #(69 1 #first:) #(69 1 #first:) #(69 1 #first:) #(69 1 #first:) #(70 6 #externalCall:) #(70 8 #externalModuleCall:) #(71 2 #primitiveString:) #(71 2 #primitiveNumber:) #(71 2 #primitiveArgMissing:) #(71 4 #primitiveModule:) #(71 4 #moduleArgMissing:) #(72 1 #pragmaMessage:) #(72 1 #pragmaMessage:) #(72 1 #pragmaUnaryMessage:) #(73 2 #messagePart:) #(73 2 #literalMissing:) #(73 3 #addMessagePart:) #(73 3 #literalMissing:) #(74 2 #messagePart:) #(74 2 #argumentMissing:) #(75 1 #first:) #(75 1 #first:) #(75 1 #first:) #(75 1 #first:) #(76 1 #callConvention:) #(76 1 #callConvention:) #(77 1 #externalType:) #(77 2 #externalTypePointer:) #(78 1 #externalFunction:) #(78 1 #externalIndex:) #(79 1 #parameterExtCall:) #(79 2 #parametersExtCall:) #(82 1 #unaryMessage:) #(82 2 #messagePart:) #(82 2 #argumentNameMissing:) #(82 1 #first:) #(83 1 #first:) #(83 1 #first:) #(83 1 #first:) #(84 1 #messagePragma:) #(84 1 #messagePragma:) #(84 1 #messagePragma:) )! ! !SqueakParser methodsFor: 'generated-tables' stamp: 'ms 4/7/2007 03:32'! transitionTable ^#( #(3 17 22 21 23 25 25 29 41 33 42 37 82) #(3 41 1 45 2 49 4 53 5 57 8 61 9 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 109 44 113 46 117 48 121 49 125 50 129 51 133 52 137 53 141 54 145 55 149 56 153 57 157 58 161 59 165 69 134 80) #(3 17 22 21 23 25 25 29 41 169 82) #(2 538 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 30 80) #(3 97 22 173 40 177 81) #(3 97 22 181 40 185 81) #(3 550 1 550 2 550 4 550 5 550 6 550 8 550 9 550 10 550 15 550 16 550 17 550 18 550 19 550 20 550 21 550 22 189 23 550 30 550 80) #(2 0 80) #(3 41 1 45 2 49 4 53 5 193 6 57 8 61 9 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 109 44 113 46 117 48 121 49 125 50 129 51 133 52 137 53 141 54 197 55 201 56 153 57 157 58 161 59 205 65 165 69 134 80) #(3 41 1 45 2 49 4 53 5 57 8 61 9 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 134 33 209 36 105 40 109 44 113 46 213 47 117 48 121 49 125 50 129 51 133 52 137 53 141 54 145 55 217 56 153 57 157 58 161 59 165 69) #(3 41 1 45 2 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 221 46 117 48 121 49 125 50 133 52 137 53 141 54 153 57 157 58 161 59 165 69) #(3 41 1 45 2 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 225 46 117 48 121 49 125 50 133 52 137 53 141 54 153 57 157 58 161 59 165 69) #(3 41 1 45 2 49 4 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 134 34 105 40 109 44 113 46 117 48 121 49 125 50 229 51 133 52 137 53 141 54 153 57 157 58 161 59 165 69) #(2 230 1 2 4 5 6 10 15 16 17 18 19 20 21 22 30 33 80) #(3 46 9 46 22 233 43 46 81) #(2 154 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 158 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 162 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(3 237 1 241 2 245 21 249 22 253 23 257 24 261 25 265 27) #(2 214 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 166 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 170 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 178 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 10 1 2 4 5 6 7 8 9 10 15 16 17 18 19 20 21 22 23 25 26 30 31 33 34 35 36 37 80 81) #(2 174 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(3 422 22 422 23 422 25 269 26 422 31 422 33 422 34 422 35 422 80) #(3 273 31 62 33 62 34 277 45 62 80) #(2 54 31 33 34 80) #(2 414 22 23 25 31 33 34 35 37 80) #(2 70 31 33 34 35 80) #(3 74 31 74 33 74 34 74 35 281 37 74 80) #(2 242 33 80) #(2 410 22 23 25 31 33 34 35 37 80) #(2 418 22 23 25 31 33 34 35 37 80) #(2 122 31 33 34 35 37 80) #(3 41 1 45 2 49 4 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 134 33 105 40 109 44 113 46 117 48 121 49 125 50 285 51 133 52 137 53 141 54 153 57 157 58 161 59 165 69 134 80) #(2 0 80) #(2 218 31 33 34 35 37 80) #(3 289 23 293 25 222 31 222 33 222 34 222 35 222 37 297 61 301 62 222 80) #(3 305 22 289 23 293 25 226 31 226 33 226 34 226 35 226 37 309 60 313 61 317 62 226 80) #(3 305 22 289 23 293 25 78 31 78 33 78 34 78 35 321 60 325 61 329 62 78 80) #(2 0 80) #(2 14 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 23 30 80) #(2 18 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 23 30 80) #(2 542 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 30 80) #(2 546 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 30 80) #(3 97 22 333 40 337 81) #(3 341 3 345 11 349 14 305 22 353 23 357 25 361 60 365 62 369 70 373 71 377 72 381 73 385 74 389 76 393 81 397 84) #(3 41 1 45 2 49 4 53 5 193 6 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 109 44 113 46 117 48 121 49 125 50 285 51 133 52 137 53 141 54 153 57 157 58 161 59 401 65 165 69 134 80) #(2 30 80) #(3 41 1 45 2 49 4 53 5 405 6 57 8 61 9 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 109 44 113 46 117 48 121 49 125 50 129 51 133 52 137 53 141 54 409 55 413 56 153 57 157 58 161 59 165 69 134 80) #(3 97 22 417 40 421 81) #(3 425 8 429 9 433 33 437 36) #(2 441 33) #(2 445 35) #(3 449 31 62 33 62 34 453 45 62 80) #(2 457 34) #(3 461 9 97 22 465 40 469 81) #(3 354 19 354 33 473 66) #(3 362 1 362 2 362 10 362 15 362 16 362 17 362 18 362 19 362 20 362 21 362 22 362 23 362 24 362 25 362 27 362 30 362 35 362 38 477 67) #(2 182 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 186 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 194 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 198 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 190 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 202 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(3 41 1 45 2 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 481 46 117 48 121 49 125 50 133 52 137 53 141 54 153 57 157 58 161 59 165 69 485 81) #(3 41 1 45 2 489 4 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 66 33 66 34 105 40 493 46 117 48 121 49 125 50 133 52 137 53 141 54 153 57 157 58 161 59 165 69 66 80) #(2 138 33 34 80) #(3 305 22 289 23 293 25 497 60 501 61 505 62 509 81 513 83) #(2 246 33 80) #(3 41 1 45 2 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 517 40 117 48 133 52 137 53 521 58 525 59 529 63 533 69 537 81) #(3 41 1 45 2 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 517 40 117 48 133 52 137 53 541 59 545 64 549 69 553 81) #(2 262 23 25 31 33 34 35 37 80) #(3 557 23 250 31 250 33 250 34 250 35 250 37 250 80) #(2 282 7 22 23 25 31 33 34 35 37 80 81) #(2 274 22 23 25 31 33 34 35 37 80) #(2 266 23 25 31 33 34 35 37 80) #(3 557 23 254 31 254 33 254 34 254 35 254 37 254 80) #(2 278 22 23 25 31 33 34 35 37 80) #(2 270 23 25 31 33 34 35 37 80) #(3 557 23 258 31 258 33 258 34 258 35 258 37 258 80) #(2 22 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 23 30 80) #(2 26 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 23 30 80) #(3 561 19 565 21 569 81) #(2 510 22) #(2 506 22) #(3 41 1 45 2 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 573 40 577 48 581 52 585 53 521 58 525 59 529 63 533 69 589 75 593 81) #(3 41 1 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 597 40 601 48 605 52 609 53 613 75 617 81) #(2 462 7 81) #(2 621 23) #(2 566 7 81) #(2 570 7 81) #(2 574 7 81) #(2 454 7 81) #(2 458 7 81) #(3 625 22 629 77) #(2 338 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 30 80) #(3 633 7 637 81) #(3 41 1 45 2 49 4 53 5 405 6 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 109 44 113 46 117 48 121 49 125 50 641 51 133 52 137 53 141 54 153 57 157 58 161 59 165 69 134 80) #(3 341 3 345 11 349 14 305 22 353 23 357 25 361 60 365 62 369 70 373 71 377 72 381 73 385 74 389 76 645 81 649 84) #(3 41 1 45 2 49 4 53 5 193 6 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 109 44 113 46 117 48 121 49 125 50 285 51 133 52 137 53 141 54 153 57 157 58 161 59 653 65 165 69 134 80) #(2 34 80) #(2 82 8 9 33 36) #(2 86 8 9 33 36) #(3 46 9 46 22 657 43) #(3 41 1 45 2 49 4 53 5 57 8 61 9 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 134 33 105 40 109 44 113 46 117 48 121 49 125 50 129 51 133 52 137 53 141 54 145 55 661 56 153 57 157 58 161 59 165 69) #(2 106 7 22 23 25 31 33 34 35 37 80 81) #(3 97 22 665 40 669 81) #(2 102 7 22 23 25 31 33 34 35 37 80 81) #(2 406 22 23 25 31 33 34 35 37 80) #(2 66 33 34 80) #(2 146 33 34 80) #(2 150 7 22 23 25 31 33 34 35 37 80 81) #(2 234 1 2 4 5 6 10 15 16 17 18 19 20 21 22 30 33 80) #(2 50 9 22 81) #(2 238 1 2 4 5 6 10 15 16 17 18 19 20 21 22 30 33 80) #(3 673 19 677 33) #(3 681 1 685 2 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 689 22 693 23 697 24 701 25 705 27 101 30 709 35 713 38 717 53 721 68) #(2 114 31 33 34 35 80) #(2 118 31 33 34 35 80) #(3 41 1 45 2 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 725 46 117 48 121 49 125 50 133 52 137 53 141 54 153 57 157 58 161 59 165 69) #(2 58 31 33 34 80) #(2 554 31 33 34 35 37 80) #(2 558 31 33 34 35 37 80) #(3 557 23 562 31 562 33 562 34 562 35 562 37 562 80) #(2 130 31 33 34 35 37 80) #(2 126 31 33 34 35 37 80) #(2 422 22 23 25 31 33 34 35 37 80) #(3 310 23 293 25 310 31 310 33 310 34 310 35 310 37 297 61 310 80) #(3 305 22 314 23 293 25 314 31 314 33 314 34 314 35 314 37 309 60 313 61 314 80) #(2 294 23 31 33 34 35 37 80) #(3 305 22 318 23 293 25 318 31 318 33 318 34 318 35 318 37 321 60 325 61 318 80) #(2 298 23 31 33 34 35 37 80) #(3 305 22 322 23 322 25 322 31 322 33 322 34 322 35 322 37 309 60 322 80) #(2 286 23 25 31 33 34 35 37 80) #(3 305 22 326 23 326 25 326 31 326 33 326 34 326 35 326 37 321 60 326 80) #(2 290 23 25 31 33 34 35 37 80) #(3 41 1 45 2 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 517 40 117 48 133 52 137 53 521 58 525 59 729 63 533 69 733 81) #(2 438 7 81) #(3 434 7 737 13 434 81) #(2 442 7 81) #(3 502 7 422 22 422 23 422 25 502 81) #(3 494 7 414 22 414 23 414 25 494 81) #(3 490 7 410 22 410 23 410 25 490 81) #(3 498 7 418 22 418 23 418 25 498 81) #(2 466 7 81) #(3 470 7 298 23 470 81) #(2 502 7 81) #(2 494 7 81) #(2 490 7 81) #(2 498 7 81) #(2 482 7 81) #(2 486 7 81) #(3 41 1 45 2 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 573 40 577 48 581 52 585 53 521 58 525 59 729 63 533 69 741 75 745 81) #(3 749 12 514 19 514 21 514 22 514 35) #(3 753 19 757 21 761 78) #(2 330 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 30 80) #(2 334 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 30 80) #(2 42 80) #(2 350 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 30 80) #(3 765 7 769 81) #(3 41 1 45 2 49 4 53 5 405 6 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 105 40 109 44 113 46 117 48 121 49 125 50 773 51 133 52 137 53 141 54 153 57 157 58 161 59 165 69 134 80) #(3 777 9 97 22 465 40) #(2 781 33) #(2 90 8 9 33 36) #(2 94 8 9 33 36) #(2 358 19 33) #(2 206 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(3 354 19 354 33 785 66) #(3 362 1 362 2 362 10 362 15 362 16 362 17 362 18 362 19 362 20 362 21 362 22 362 23 362 24 362 25 362 27 362 30 362 35 362 38 789 67) #(2 374 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(2 382 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(2 386 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(2 378 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(2 390 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(2 210 1 2 7 10 15 16 17 18 19 20 21 22 23 24 25 27 30 31 33 34 35 37 38 80 81) #(2 402 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(2 370 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(2 366 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(3 449 31 62 33 62 34 793 45 62 80) #(2 302 23 31 33 34 35 37 80) #(2 306 23 31 33 34 35 37 80) #(3 797 21 801 81) #(2 474 7 81) #(3 478 7 306 23 478 81) #(2 518 19 21 22 35) #(2 526 2) #(2 522 2) #(2 805 2) #(2 342 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 30 80) #(2 346 1 2 4 5 6 8 9 10 15 16 17 18 19 20 21 22 30 80) #(2 38 80) #(3 41 1 45 2 49 4 53 5 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 97 22 101 30 134 33 105 40 109 44 113 46 117 48 121 49 125 50 809 51 133 52 137 53 141 54 153 57 157 58 161 59 165 69) #(2 98 7 22 23 25 31 33 34 35 37 80 81) #(3 673 19 813 33) #(3 681 1 685 2 65 10 69 15 73 16 77 17 81 18 85 19 89 20 93 21 689 22 693 23 697 24 701 25 705 27 101 30 817 35 713 38 717 53 721 68) #(2 142 33 34 80) #(2 446 7 81) #(2 450 7 81) #(3 625 22 821 77 825 79) #(2 829 33) #(2 398 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(2 394 1 2 10 15 16 17 18 19 20 21 22 23 24 25 27 30 35 38) #(2 530 22 35) #(3 625 22 833 35 837 77) #(2 110 7 22 23 25 31 33 34 35 37 80 81) #(3 426 7 841 13 426 81) #(2 534 22 35) #(2 845 21) #(2 430 7 81) )! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! SqueakParser class instanceVariableNames: ''! !SqueakParser class methodsFor: 'initialize' stamp: 'ms 10/10/2006 23:28'! initialize "self initialize" | scanner | super initialize. scanner := SqueakScanner new. DicTokens := Dictionary new. DicTokens at: scanner colonId put: 'colon'. DicTokens at: scanner binarySymbolId put: 'binary symbol'. DicTokens at: scanner nameId put: 'variable'. DicTokens at: scanner negativeNumberId put: 'negative number'. DicTokens at: scanner periodId put: 'period'. DicTokens at: scanner rightBoxBracketsId put: 'right box bracket'. DicTokens at: scanner rightCurlyBracketsId put: 'right curly brackets'. DicTokens at: scanner rightParenthesesId put: 'right parentheses'. DicTokens at: scanner stringId put: 'string'. DicTokens at: scanner multikeywordId put: 'multi keyword'. DicTokens at: scanner keywordId put: 'keyword'. DicTokens at: scanner characterId put: 'character'. DicTokens at: scanner assignmentId put: 'assignment'! ! !SqueakParser class methodsFor: 'parsing' stamp: 'ajh 2/27/2003 16:40'! parseDoIt: stringOrStream | sequence | sequence _ self parseStream: stringOrStream readStream startingAt: self startingStateForSequence. ^ (RBDoItNode body: sequence) source: stringOrStream contents! ! !SqueakParser class methodsFor: 'parsing' stamp: 'ms 12/13/2007 01:35'! parseExpression: stringOrStream ^ self parseStream: stringOrStream readStream startingAt: self startingStateForSequence.! ! !SqueakParser class methodsFor: 'parsing' stamp: 'ms 12/2/2006 22:27'! parseMethod: stringOrStream ^ (self parseStream: stringOrStream readStream startingAt: self startingStateForMethod) source: stringOrStream contents! ! !SqueakParser class methodsFor: 'parsing' stamp: 'ms 11/19/2006 17:16'! parseMethodPattern: stringOrStream ^ SqueakMethodPatternParser parseMethod: stringOrStream! ! !SqueakParser class methodsFor: 'generated-comments' stamp: 'ms 4/7/2007 03:32'! parserDefinitionComment "%id ; %start Sequence MethodPattern; Method: MethodPattern Sequence {#method:} | MethodPattern Pragmas Sequence {#methodPragma:} | MethodPattern Pragmas Temporaries Pragmas Statements {#methodPragmaTempsPragma:} | MethodPattern Temporaries Pragmas Statements {#methodTempsPragma:}; MethodPattern: {#unaryMessage:} | Variable {#messagePart:} | error {#argumentNameMissing:} | KeywordMethodPattern {#first:}; KeywordMethodPattern: Variable {#messagePart:} | error {#argumentNameMissing:} | KeywordMethodPattern Variable {#addMessagePart:} | KeywordMethodPattern error {#argumentNameMissing:}; Pragmas: ""<"" PragmaMessage "">"" {#pragma:} | ""<"" PragmaMessage error {#pragmaEndMissing:} | ""<"" error {#pragmaMissing:} | Pragmas ""<"" PragmaMessage "">"" {#pragmas:} | Pragmas ""<"" PragmaMessage error {#pragmaEndMissing:} | Pragmas ""<"" error {#pragmaMissing:}; Sequence: Statements {#sequence:} | Temporaries Statements {#sequenceWithTemps:}; Temporaries: ""||"" {#arrayAddToken:} | ""|"" TemporaryVariables ""|"" {#secondAddToken:} | ""|"" TemporaryVariables error {#verticalBarMissing:}; TemporaryVariables: {#array} | TemporaryVariables Variable {#add:}; Statements: {#array} | StatementList ? {#first:} | StatementList ""^"" Expression ? {#returnAdd:} | ""^"" Expression ? {#return:}; StatementList: Expression {#firstIn:} | StatementList Expression {#add3:}; Block: ""["" BlockArgs ""|"" Sequence {#blockWithArgs:} | ""["" Sequence {#blockNoArgs:} | ""["" BlockArgs {#blockArgs:} | ""["" BlockArgs ""||"" TemporaryVariables ""|"" Statements {#blockWithTemps:}; BlockArgs: Variable {#secondIn:} | error {#argumentNameMissing:} | BlockArgs Variable {#add3:} | BlockArgs error {#argumentNameMissing:}; Expression: Assignment {#first:} | Cascade {#first:} | Primary {#first:}; Primary: ""("" Expression {#secondWithParenthesis:} | Array {#first:} | Block {#first:} | Literal {#first:} | Variable {#first:}; Assignment: Variable Expression {#assignment:} | Variable error {#expressionMissing:}; Cascade: MessageSend {#first:} | Cascade Message {#cascade:} | Cascade error {#cascadeMMissing:}; MessageSend: KeywordMessageSend {#first:} | BinaryMessageSend {#first:} | UnaryMessageSend {#first:}; Message: UnaryMessage {#first:} | BinaryMessage {#first:} | KeywordMessage {#first:}; KeywordMessageSend: BinaryMessageSend KeywordMessage {#messageSend:} | UnaryMessageSend KeywordMessage {#messageSend:} | Primary KeywordMessage {#messageSend:}; KeywordMessage: KeywordArgument {#messagePart:} | error {#argumentMissing:} | KeywordMessage KeywordArgument {#addMessagePart:} | KeywordMessage error {#argumentMissing:}; KeywordArgument: BinaryMessageSend {#first:} | UnaryMessageSend {#first:} | Primary {#first:}; BinaryMessageSend: BinaryMessageSend BinaryMessage {#messageSend:} | UnaryMessageSend BinaryMessage {#messageSend:} | Primary BinaryMessage {#messageSend:}; BinaryMessage : BinaryArgument {#messagePart:} | error {#argumentMissing:}; BinaryArgument: UnaryMessageSend {#first:} | Primary {#first:}; UnaryMessageSend : UnaryMessageSend UnaryMessage {#messageSend:} | Primary UnaryMessage {#messageSend:}; UnaryMessage : {#unaryMessage:}; Array: ""{"" Statements {#array:}; Variable: {#variable:}; Literal: ""true"" {#litTrue:} | ""false"" {#litFalse:} | ""nil"" {#litNil:} | {#litNumber:} | {#litNumber:} | {#litChar:} | {#litString:} | ""#"" {#litStringSymbol:} | ""#"" {#litSymbol:} | ""#"" {#litSymbol:} | ""#"" {#litSymbol:} | ""#"" {#litSymbol:} | ""#"" {#litSymbol:} | ""#"" ""["" ByteArray {#litArray:} | ""#"" ""("" LiteralArray {#litArray:} | ""#:"" {#litString:}; ByteArray: {#byteStream} | ByteArray {#byteStreamPut:}; LiteralArray: {#stream} | LiteralArray ArrayLiteral {#streamPut:}; ArrayLiteral: Literal {#value:} | {#valueSymbol:} | {#valueSymbol:} | {#valueSymbol:} | {#valueSymbol:} | {#valueSymbol:} | ""("" LiteralArray {#contents2:} | ""["" ByteArray {#contents2:} | {#valueSymbol:}; PragmaMessage: Apicall {#messagePragma:} | Primitive {#messagePragma:} | MessagePragma {#messagePragma:}; MessagePragma: KeyWordMessagePragma {#pragmaMessage:} | BinaryMessagePragma {#pragmaMessage:} | UnaryMessage {#pragmaUnaryMessage:}; BinaryMessagePragma: PrimaryPragma {#messagePart:} | error {#argumentMissing:}; KeyWordMessagePragma: PrimaryPragma {#messagePart:} | error {#literalMissing:} | KeywordMessage PrimaryPragma {#addMessagePart:} | KeywordMessage error {#literalMissing:}; PrimaryPragma: Array {#first:} | Block {#first:} | Literal {#first:} | Variable {#first:}; Apicall: TypeCall ExternalType IndexName ""("" ParameterApicall {#externalCall:} | TypeCall ExternalType IndexName ""("" ParameterApicall ""module:"" {#externalModuleCall:}; IndexName: {#externalFunction:} | {#externalIndex:}; TypeCall: ""apicall:"" {#callConvention:} | ""cdecl:"" {#callConvention:}; ParameterApicall: ExternalType {#parameterExtCall:} | ParameterApicall ExternalType {#parametersExtCall:}; ExternalType: {#externalType:} | ""*"" {#externalTypePointer:}; Primitive: ""primitive:"" {#primitiveString:} | ""primitive:"" {#primitiveNumber:} | ""primitive:"" error {#primitiveArgMissing:} | ""primitive:"" ""module:"" {#primitiveModule:} | ""primitive:"" ""module:"" error {#moduleArgMissing:};"! ! !SqueakParser class methodsFor: 'generated-accessing' stamp: 'ms 4/7/2007 03:32'! scannerClass ^SqueakScanner! ! !SqueakParser class methodsFor: 'generated-starting states' stamp: 'ms 4/7/2007 03:32'! startingStateForMethod ^1! ! !SqueakParser class methodsFor: 'generated-starting states' stamp: 'ms 4/7/2007 03:32'! startingStateForMethodPattern ^3! ! !SqueakParser class methodsFor: 'generated-starting states' stamp: 'ms 4/7/2007 03:32'! startingStateForSequence ^2! ! !SqueakParser class methodsFor: 'tokens' stamp: 'ms 10/10/2006 22:04'! tokenDescription: id ^DicTokens at: id! ! !SqueakParser class methodsFor: 'tokens' stamp: 'ms 10/10/2006 22:24'! tokensId ^DicTokens keys! ! SqueakParser subclass: #SaphirParser2 instanceVariableNames: 'classParseIn' classVariableNames: '' poolDictionaries: '' category: 'Coral-DeadCode'! !SaphirParser2 methodsFor: 'reduction actions' stamp: 'ms 11/17/2007 16:10'! add2: nodes ^nodes first copyWith: nodes second! ! !SaphirParser2 methodsFor: 'reduction actions' stamp: 'ms 1/24/2008 21:40'! classDefinittionMethod: nodes ^RBMethodScript new rbMethodNode: nodes last; homeClass: (RBVariableNode new identifierToken: nodes first); classSide! ! !SaphirParser2 methodsFor: 'reduction actions' stamp: 'ms 1/24/2008 16:51'! doitScript: nodes ^RBDoitScript body: nodes second! ! !SaphirParser2 methodsFor: 'reduction actions' stamp: 'ms 1/24/2008 18:54'! instanceDefinittionMethod: nodes ^RBMethodScript new rbMethodNode: nodes last; homeClass: (RBVariableNode new identifierToken: nodes first); instanceSide! ! !SaphirParser2 methodsFor: 'reduction actions' stamp: 'ms 11/17/2007 12:44'! method: nodes ^ RBMethodNode new selectorParts: nodes first first arguments: nodes first last; body: nodes third! ! !SaphirParser2 methodsFor: 'reduction actions' stamp: 'ms 1/24/2008 21:53'! methodPragma: nodes ^RBMethodNode new selectorParts: nodes first first arguments: nodes first last; body: nodes fourth; pragmas:nodes third! ! !SaphirParser2 methodsFor: 'generated-reduction actions' stamp: 'ms 1/24/2008 16:52'! reduceActionForOptionalXXXperiodX1: nodes ^ nil! ! !SaphirParser2 methodsFor: 'generated-reduction actions' stamp: 'ms 1/24/2008 16:52'! reduceActionForOptionalXXXperiodX2: nodes ^ nodes at: 1! ! !SaphirParser2 methodsFor: 'generated-tables' stamp: 'ms 1/24/2008 16:52'! reduceTable ^#( #(42 4 #classDefinittionMethod:) #(43 3 #instanceDefinittionMethod:) #(44 1 #first:) #(44 1 #first:) #(45 3 #pragma:) #(45 3 #pragmaEndMissing:) #(45 2 #pragmaMissing:) #(45 4 #pragmas:) #(45 4 #pragmaEndMissing:) #(45 3 #pragmaMissing:) #(46 1 #reduceFor:) #(47 0 #array) #(47 2 #first:) #(47 5 #returnAdd:) #(47 3 #return:) #(48 1 #variable:) #(49 2 #messagePart:) #(49 2 #argumentNameMissing:) #(49 3 #addMessagePart:) #(49 3 #argumentNameMissing:) #(50 1 #messagePragma:) #(50 1 #messagePragma:) #(50 1 #messagePragma:) #(51 0 #array) #(51 2 #add:) #(52 1 #firstIn:) #(52 3 #add3:) #(53 0 #reduceActionForOptionalXXXperiodX1:) #(53 1 #reduceActionForOptionalXXXperiodX2:) #(54 1 #first:) #(54 1 #first:) #(54 1 #first:) #(55 2 #secondIn:) #(55 2 #argumentNameMissing:) #(55 3 #add3:) #(55 3 #argumentNameMissing:) #(56 5 #blockWithArgs:) #(56 3 #blockNoArgs:) #(56 3 #blockArgs:) #(56 7 #blockWithTemps:) #(57 3 #assignment:) #(57 3 #expressionMissing:) #(58 1 #first:) #(58 3 #cascade:) #(58 3 #cascadeMMissing:) #(59 3 #secondWithParenthesis:) #(59 1 #first:) #(59 1 #first:) #(59 1 #first:) #(59 1 #first:) #(60 3 #array:) #(61 1 #litTrue:) #(61 1 #litFalse:) #(61 1 #litNil:) #(61 1 #litNumber:) #(61 1 #litNumber:) #(61 1 #litChar:) #(61 1 #litString:) #(61 2 #litStringSymbol:) #(61 2 #litSymbol:) #(61 2 #litSymbol:) #(61 2 #litSymbol:) #(61 2 #litSymbol:) #(61 2 #litSymbol:) #(61 4 #litArray:) #(61 4 #litArray:) #(61 1 #litString:) #(62 1 #sequence:) #(62 2 #sequenceWithTemps:) #(63 3 #doitScript:) #(63 1 #first:) #(64 1 #first:) #(64 1 #first:) #(64 1 #first:) #(65 2 #messageSend:) #(65 2 #messageSend:) #(65 2 #messageSend:) #(66 2 #messageSend:) #(66 2 #messageSend:) #(66 2 #messageSend:) #(67 2 #messageSend:) #(67 2 #messageSend:) #(68 1 #unaryMessage:) #(69 2 #messagePart:) #(69 2 #argumentMissing:) #(70 2 #messagePart:) #(70 2 #argumentMissing:) #(70 3 #addMessagePart:) #(70 3 #argumentMissing:) #(71 1 #first:) #(71 1 #first:) #(71 1 #first:) #(72 1 #first:) #(72 1 #first:) #(73 0 #array) #(73 2 #add2:) #(74 0 #byteStream) #(74 2 #byteStreamPut:) #(75 0 #stream) #(75 2 #streamPut:) #(76 1 #value:) #(76 1 #valueSymbol:) #(76 1 #valueSymbol:) #(76 1 #valueSymbol:) #(76 1 #valueSymbol:) #(76 1 #valueSymbol:) #(76 3 #contents2:) #(76 3 #contents2:) #(76 1 #valueSymbol:) #(77 4 #method:) #(77 5 #methodPragma:) #(77 7 #methodPragmaTempsPragma:) #(77 6 #methodTempsPragma:) #(78 6 #externalCall:) #(78 8 #externalModuleCall:) #(79 2 #primitiveString:) #(79 2 #primitiveNumber:) #(79 2 #primitiveArgMissing:) #(79 4 #primitiveModule:) #(79 4 #moduleArgMissing:) #(80 1 #pragmaMessage:) #(80 1 #pragmaMessage:) #(80 1 #pragmaUnaryMessage:) #(81 2 #messagePart:) #(81 2 #literalMissing:) #(81 3 #addMessagePart:) #(81 3 #literalMissing:) #(82 2 #messagePart:) #(82 2 #argumentMissing:) #(83 1 #first:) #(83 1 #first:) #(83 1 #first:) #(83 1 #first:) #(84 1 #callConvention:) #(84 1 #callConvention:) #(85 1 #externalType:) #(85 2 #externalTypePointer:) #(86 1 #externalFunction:) #(86 1 #externalIndex:) #(87 1 #parameterExtCall:) #(87 2 #parametersExtCall:) #(90 1 #unaryMessage:) #(90 2 #messagePart:) #(90 2 #argumentNameMissing:) #(90 1 #first:) #(91 1 #first:) #(91 1 #first:) #(91 1 #first:) #(92 1 #arrayAddToken:) #(92 3 #secondAddToken:) #(92 3 #verticalBarMissing:) )! ! !SaphirParser2 methodsFor: 'generated-tables' stamp: 'ms 1/24/2008 16:52'! transitionTable ^#( #(3 382 11 382 25 21 73 382 88) #(3 25 1 29 2 33 5 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 89 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 129 62 133 65 137 66 141 67 50 88 145 91 149 92) #(3 153 25 157 26 161 28 165 49 169 90) #(3 382 11 382 25 173 73 382 88) #(3 177 11 181 25 185 42 189 43 193 44 197 63 0 88) #(2 598 4 5 6 10 11 14 17 18 19 20 21 22 23 24 25 33 36 88) #(3 98 2 98 25 201 51 98 89) #(3 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 93 48 205 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 145 91) #(3 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 93 48 209 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 145 91) #(3 25 1 29 2 33 5 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 50 36 213 39 89 47 93 48 97 52 101 54 217 55 105 56 109 57 113 58 117 59 121 60 125 61 221 62 133 65 137 66 141 67 145 91 149 92) #(3 33 5 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 50 37 225 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 145 91) #(2 270 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(3 229 6 233 11 237 24 241 25 245 26 249 27 253 28 257 30) #(2 210 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 214 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 218 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 222 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 226 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 234 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 66 1 2 9 10 11 25 26 28 29 34 36 37 38 39 40 88 89) #(2 230 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 274 10 36 88) #(3 202 10 202 25 202 26 202 28 261 29 202 34 202 36 202 37 202 38 202 88) #(3 114 10 265 34 114 36 114 37 269 53 114 88) #(2 106 10 34 36 37 88) #(2 194 10 25 26 28 34 36 37 38 40 88) #(2 122 10 34 36 37 38 88) #(3 126 10 126 34 126 36 126 37 126 38 273 40 126 88) #(3 130 10 277 25 281 26 285 28 130 34 130 36 130 37 130 38 289 68 293 69 297 70 130 88) #(2 190 10 25 26 28 34 36 37 38 40 88) #(2 198 10 25 26 28 34 36 37 38 40 88) #(2 0 88) #(2 586 10 34 36 37 38 40 88) #(3 590 10 281 26 285 28 590 34 590 36 590 37 590 38 590 40 301 69 305 70 590 88) #(3 594 10 277 25 281 26 285 28 594 34 594 36 594 37 594 38 594 40 309 68 313 69 317 70 594 88) #(2 174 10 34 36 37 38 40 88) #(3 33 5 37 6 50 10 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 50 36 321 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 50 88 145 91) #(2 570 11 88) #(3 81 25 325 48 329 89) #(3 81 25 333 48 337 89) #(3 582 11 341 26 582 88) #(2 0 88) #(3 177 11 181 25 185 42 189 43 193 44 197 63 0 88) #(3 25 1 29 2 33 5 37 6 50 10 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 89 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 345 62 133 65 137 66 141 67 145 91 149 92) #(3 349 7 353 8) #(2 18 11 25 88) #(2 14 11 25 88) #(2 286 11 25 88) #(2 386 11 25 88) #(3 357 2 81 25 361 48 365 89) #(3 114 10 369 34 114 36 114 37 373 53 114 88) #(2 377 38) #(3 81 25 381 48 385 89) #(3 389 1 393 2 397 36 401 39) #(2 405 36) #(2 409 37) #(3 398 6 398 11 398 17 398 18 398 19 398 20 398 21 398 22 398 23 398 24 398 25 398 26 398 27 398 28 398 30 398 33 398 38 398 41 413 75) #(3 390 22 390 36 417 74) #(2 238 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 242 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 250 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 254 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 246 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 258 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(3 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 93 48 421 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 425 89 145 91) #(3 429 5 37 6 118 10 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 118 36 118 37 93 48 433 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 118 88 145 91) #(2 54 10 36 37 88) #(3 277 25 281 26 285 28 437 64 441 68 445 69 449 70 453 89) #(2 334 9 10 25 26 28 34 36 37 38 40 88 89) #(3 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 457 48 105 56 461 59 121 60 125 61 465 66 469 67 473 71 477 89) #(3 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 457 48 105 56 481 59 121 60 125 61 485 67 489 72 493 89) #(2 330 10 25 26 28 34 36 37 38 40 88) #(2 322 10 26 28 34 36 37 38 40 88) #(3 310 10 497 26 310 34 310 36 310 37 310 38 310 40 310 88) #(2 314 10 26 28 34 36 37 38 40 88) #(3 302 10 497 26 302 34 302 36 302 37 302 38 302 40 302 88) #(2 326 10 25 26 28 34 36 37 38 40 88) #(2 318 10 26 28 34 36 37 38 40 88) #(3 306 10 497 26 306 34 306 36 306 37 306 38 306 40 306 88) #(2 278 10 36 88) #(2 70 11 26 88) #(2 74 11 26 88) #(2 574 11 88) #(2 578 11 88) #(3 81 25 501 48 505 89) #(2 509 10) #(2 513 8) #(3 153 25 157 26 161 28 165 49 517 77 521 90) #(2 602 4 5 6 10 11 14 17 18 19 20 21 22 23 24 25 33 36 88) #(2 102 2 25 89) #(2 606 4 5 6 10 11 14 17 18 19 20 21 22 23 24 25 33 36 88) #(2 118 10 36 37 88) #(2 62 10 36 37 88) #(2 186 10 25 26 28 34 36 37 38 40 88) #(2 134 1 2 36 39) #(2 138 1 2 36 39) #(3 98 2 98 25 525 51) #(3 25 1 29 2 33 5 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 50 36 89 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 529 62 133 65 137 66 141 67 145 91 149 92) #(2 158 9 10 25 26 28 34 36 37 38 40 88 89) #(3 81 25 533 48 537 89) #(2 154 9 10 25 26 28 34 36 37 38 40 88 89) #(2 206 9 10 25 26 28 34 36 37 38 40 88 89) #(3 541 6 545 11 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 549 25 553 26 557 27 561 28 565 30 85 33 569 38 573 41 577 61 581 76) #(3 585 22 589 36) #(2 166 10 34 36 37 38 88) #(2 170 10 34 36 37 38 88) #(3 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 93 48 593 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 145 91) #(2 110 10 34 36 37 88) #(2 178 10 34 36 37 38 40 88) #(2 290 10 34 36 37 38 40 88) #(2 294 10 34 36 37 38 40 88) #(3 298 10 497 26 298 34 298 36 298 37 298 38 298 40 298 88) #(2 182 10 34 36 37 38 40 88) #(2 202 10 25 26 28 34 36 37 38 40 88) #(3 370 10 277 25 370 26 285 28 370 34 370 36 370 37 370 38 370 40 289 68 293 69 370 88) #(3 362 10 362 26 285 28 362 34 362 36 362 37 362 38 362 40 301 69 362 88) #(3 366 10 277 25 366 26 285 28 366 34 366 36 366 37 366 38 366 40 309 68 313 69 366 88) #(2 346 10 26 34 36 37 38 40 88) #(2 350 10 26 34 36 37 38 40 88) #(3 378 10 277 25 378 26 378 28 378 34 378 36 378 37 378 38 378 40 289 68 378 88) #(3 374 10 277 25 374 26 374 28 374 34 374 36 374 37 374 38 374 40 309 68 374 88) #(2 338 10 26 28 34 36 37 38 40 88) #(2 342 10 26 28 34 36 37 38 40 88) #(3 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 457 48 105 56 461 59 121 60 125 61 465 66 469 67 597 71 601 89) #(2 78 11 26 88) #(2 82 11 26 88) #(2 282 11 25 88) #(3 153 25 157 26 161 28 165 49 605 77 521 90) #(2 10 11 25 88) #(2 609 11) #(3 613 2 81 25 361 48) #(2 617 36) #(2 142 1 2 36 39) #(2 146 1 2 36 39) #(3 398 6 398 11 398 17 398 18 398 19 398 20 398 21 398 22 398 23 398 24 398 25 398 26 398 27 398 28 398 30 398 33 398 38 398 41 621 75) #(3 390 22 390 36 625 74) #(2 410 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(2 418 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(2 422 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(2 414 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(2 426 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(2 266 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(2 438 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(2 406 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(2 402 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(2 394 22 36) #(2 262 6 9 10 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 34 36 37 38 40 41 88 89) #(3 114 10 369 34 114 36 114 37 629 53 114 88) #(2 354 10 26 34 36 37 38 40 88) #(2 358 10 26 34 36 37 38 40 88) #(2 6 11 25 88) #(3 25 1 29 2 633 4 33 5 37 6 50 10 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 637 45 89 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 641 62 133 65 137 66 141 67 145 91 645 92) #(3 33 5 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 50 36 649 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 145 91) #(2 150 9 10 25 26 28 34 36 37 38 40 88 89) #(3 541 6 545 11 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 549 25 553 26 557 27 561 28 565 30 85 33 653 38 573 41 577 61 581 76) #(3 585 22 657 36) #(2 58 10 36 37 88) #(3 661 3 665 12 669 13 277 25 673 26 677 28 681 50 685 68 689 70 693 78 697 79 701 80 705 81 709 82 713 84 717 89) #(3 25 1 29 2 721 4 33 5 37 6 50 10 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 89 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 725 62 133 65 137 66 141 67 145 91 729 92) #(2 733 10) #(3 633 4 33 5 37 6 50 10 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 737 45 321 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 145 91) #(2 741 36) #(2 430 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(2 434 6 11 17 18 19 20 21 22 23 24 25 26 27 28 30 33 38 41) #(3 745 22 749 24 753 89) #(2 538 25) #(2 542 25) #(3 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 757 48 761 56 461 59 765 60 769 61 465 66 469 67 473 71 773 83 777 89) #(3 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 781 48 785 56 789 60 793 61 797 83 801 89) #(3 805 9 809 89) #(2 494 9 89) #(2 813 26) #(2 86 9 89) #(2 90 9 89) #(2 94 9 89) #(2 486 9 89) #(2 490 9 89) #(3 817 25 821 85) #(2 30 1 2 4 5 6 10 11 14 17 18 19 20 21 22 23 24 25 33) #(3 661 3 665 12 669 13 277 25 673 26 677 28 825 50 685 68 689 70 693 78 697 79 701 80 705 81 709 82 713 84 829 89) #(2 833 10) #(3 633 4 33 5 37 6 50 10 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 837 45 321 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 145 91) #(2 442 11 25 88) #(3 721 4 33 5 37 6 50 10 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 841 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 145 91) #(2 162 9 10 25 26 28 34 36 37 38 40 88 89) #(2 470 9 89) #(3 466 9 845 15 466 89) #(2 474 9 89) #(3 534 9 202 25 202 26 202 28 534 89) #(3 526 9 194 25 194 26 194 28 526 89) #(3 522 9 190 25 190 26 190 28 522 89) #(3 530 9 198 25 198 26 198 28 530 89) #(2 498 9 89) #(3 502 9 350 26 502 89) #(2 534 9 89) #(2 526 9 89) #(2 522 9 89) #(2 530 9 89) #(2 514 9 89) #(2 518 9 89) #(2 22 1 2 4 5 6 10 11 14 17 18 19 20 21 22 23 24 25 33) #(2 26 1 2 4 5 6 10 11 14 17 18 19 20 21 22 23 24 25 33) #(3 37 6 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 757 48 761 56 461 59 765 60 769 61 465 66 469 67 597 71 849 83 853 89) #(3 857 16 546 22 546 24 546 25 546 38) #(3 861 22 865 24 869 86) #(3 873 9 877 89) #(2 42 1 2 4 5 6 10 11 14 17 18 19 20 21 22 23 24 25 33) #(2 446 11 25 88) #(3 721 4 33 5 37 6 50 10 41 11 45 14 49 17 53 18 57 19 61 20 65 21 69 22 73 23 77 24 81 25 85 33 881 47 93 48 97 52 101 54 105 56 109 57 113 58 117 59 121 60 125 61 133 65 137 66 141 67 145 91) #(2 885 10) #(3 889 24 893 89) #(2 506 9 89) #(3 510 9 358 26 510 89) #(2 550 22 24 25 38) #(2 558 6) #(2 554 6) #(2 897 6) #(2 34 1 2 4 5 6 10 11 14 17 18 19 20 21 22 23 24 25 33) #(2 38 1 2 4 5 6 10 11 14 17 18 19 20 21 22 23 24 25 33) #(2 901 10) #(2 454 11 25 88) #(2 478 9 89) #(2 482 9 89) #(3 817 25 905 85 909 87) #(2 450 11 25 88) #(2 562 25 38) #(3 817 25 913 38 917 85) #(3 458 9 921 15 458 89) #(2 566 25 38) #(2 925 24) #(2 462 9 89) )! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! SaphirParser2 class instanceVariableNames: ''! !SaphirParser2 class methodsFor: 'as yet unclassified' stamp: 'ms 11/17/2007 17:12'! parseScript: stringOrStream | aStream | aStream := stringOrStream readStream. aStream atEnd ifTrue: [^#()]. ^self parseStream: aStream startingAt: self startingStateForScript! ! !SaphirParser2 class methodsFor: 'generated-comments' stamp: 'ms 1/24/2008 16:52'! parserDefinitionComment "%id ; %start Sequence MethodPattern Script; Script: {#array} | Script ScriptStatement {#add2:}; ClassMethod: ""class"" "">>"" Method {#classDefinittionMethod:}; InstanceMethod: "">>"" Method {#instanceDefinittionMethod:}; MethodDefinition: InstanceMethod {#first:} | ClassMethod {#first:}; ScriptStatement: ""["" Sequence ""]"" {#doitScript:} | MethodDefinition {#first:}; Method: MethodPattern ""["" Sequence ""]"" {#method:} | MethodPattern ""["" Pragmas Sequence ""]"" {#methodPragma:} | MethodPattern ""["" Pragmas Temporaries Pragmas Statements ""]"" {#methodPragmaTempsPragma:} | MethodPattern ""["" Temporaries Pragmas Statements ""]"" {#methodTempsPragma:}; MethodPattern: {#unaryMessage:} | Variable {#messagePart:} | error {#argumentNameMissing:} | KeywordMethodPattern {#first:}; KeywordMethodPattern: Variable {#messagePart:} | error {#argumentNameMissing:} | KeywordMethodPattern Variable {#addMessagePart:} | KeywordMethodPattern error {#argumentNameMissing:}; Pragmas: ""<"" PragmaMessage "">"" {#pragma:} | ""<"" PragmaMessage error {#pragmaEndMissing:} | ""<"" error {#pragmaMissing:} | Pragmas ""<"" PragmaMessage "">"" {#pragmas:} | Pragmas ""<"" PragmaMessage error {#pragmaEndMissing:} | Pragmas ""<"" error {#pragmaMissing:}; Sequence: Statements {#sequence:} | Temporaries Statements {#sequenceWithTemps:}; Temporaries: ""||"" {#arrayAddToken:} | ""|"" TemporaryVariables ""|"" {#secondAddToken:} | ""|"" TemporaryVariables error {#verticalBarMissing:}; TemporaryVariables: {#array} | TemporaryVariables Variable {#add:}; Statements: {#array} | StatementList ? {#first:} | StatementList ""^"" Expression ? {#returnAdd:} | ""^"" Expression ? {#return:}; StatementList: Expression {#firstIn:} | StatementList Expression {#add3:}; Block: ""["" BlockArgs ""|"" Sequence {#blockWithArgs:} | ""["" Sequence {#blockNoArgs:} | ""["" BlockArgs {#blockArgs:} | ""["" BlockArgs ""||"" TemporaryVariables ""|"" Statements {#blockWithTemps:}; BlockArgs: Variable {#secondIn:} | error {#argumentNameMissing:} | BlockArgs Variable {#add3:} | BlockArgs error {#argumentNameMissing:}; Expression: Assignment {#first:} | Cascade {#first:} | Primary {#first:}; Primary: ""("" Expression {#secondWithParenthesis:} | Array {#first:} | Block {#first:} | Literal {#first:} | Variable {#first:}; Assignment: Variable Expression {#assignment:} | Variable error {#expressionMissing:}; Cascade: MessageSend {#first:} | Cascade Message {#cascade:} | Cascade error {#cascadeMMissing:}; MessageSend: KeywordMessageSend {#first:} | BinaryMessageSend {#first:} | UnaryMessageSend {#first:}; Message: UnaryMessage {#first:} | BinaryMessage {#first:} | KeywordMessage {#first:}; KeywordMessageSend: BinaryMessageSend KeywordMessage {#messageSend:} | UnaryMessageSend KeywordMessage {#messageSend:} | Primary KeywordMessage {#messageSend:}; KeywordMessage: KeywordArgument {#messagePart:} | error {#argumentMissing:} | KeywordMessage KeywordArgument {#addMessagePart:} | KeywordMessage error {#argumentMissing:}; KeywordArgument: BinaryMessageSend {#first:} | UnaryMessageSend {#first:} | Primary {#first:}; BinaryMessageSend: BinaryMessageSend BinaryMessage {#messageSend:} | UnaryMessageSend BinaryMessage {#messageSend:} | Primary BinaryMessage {#messageSend:}; BinaryMessage : BinaryArgument {#messagePart:} | error {#argumentMissing:}; BinaryArgument: UnaryMessageSend {#first:} | Primary {#first:}; UnaryMessageSend : UnaryMessageSend UnaryMessage {#messageSend:} | Primary UnaryMessage {#messageSend:}; UnaryMessage : {#unaryMessage:}; Array: ""{"" Statements {#array:}; Variable: {#variable:}; Literal: ""true"" {#litTrue:} | ""false"" {#litFalse:} | ""nil"" {#litNil:} | {#litNumber:} | {#litNumber:} | {#litChar:} | {#litString:} | ""#"" {#litStringSymbol:} | ""#"" {#litSymbol:} | ""#"" {#litSymbol:} | ""#"" {#litSymbol:} | ""#"" {#litSymbol:} | ""#"" {#litSymbol:} | ""#"" ""["" ByteArray {#litArray:} | ""#"" ""("" LiteralArray {#litArray:} | ""#:"" {#litString:}; ByteArray: {#byteStream} | ByteArray {#byteStreamPut:}; LiteralArray: {#stream} | LiteralArray ArrayLiteral {#streamPut:}; ArrayLiteral: Literal {#value:} | {#valueSymbol:} | {#valueSymbol:} | {#valueSymbol:} | {#valueSymbol:} | {#valueSymbol:} | ""("" LiteralArray {#contents2:} | ""["" ByteArray {#contents2:} | {#valueSymbol:}; PragmaMessage: Apicall {#messagePragma:} | Primitive {#messagePragma:} | MessagePragma {#messagePragma:}; MessagePragma: KeyWordMessagePragma {#pragmaMessage:} | BinaryMessagePragma {#pragmaMessage:} | UnaryMessage {#pragmaUnaryMessage:}; BinaryMessagePragma: PrimaryPragma {#messagePart:} | error {#argumentMissing:}; KeyWordMessagePragma: PrimaryPragma {#messagePart:} | error {#literalMissing:} | KeywordMessage PrimaryPragma {#addMessagePart:} | KeywordMessage error {#literalMissing:}; PrimaryPragma: Array {#first:} | Block {#first:} | Literal {#first:} | Variable {#first:}; Apicall: TypeCall ExternalType IndexName ""("" ParameterApicall {#externalCall:} | TypeCall ExternalType IndexName ""("" ParameterApicall ""module:"" {#externalModuleCall:}; IndexName: {#externalFunction:} | {#externalIndex:}; TypeCall: ""apicall:"" {#callConvention:} | ""cdecl:"" {#callConvention:}; ParameterApicall: ExternalType {#parameterExtCall:} | ParameterApicall ExternalType {#parametersExtCall:}; ExternalType: {#externalType:} | ""*"" {#externalTypePointer:}; Primitive: ""primitive:"" {#primitiveString:} | ""primitive:"" {#primitiveNumber:} | ""primitive:"" error {#primitiveArgMissing:} | ""primitive:"" ""module:"" {#primitiveModule:} | ""primitive:"" ""module:"" error {#moduleArgMissing:};"! ! !SaphirParser2 class methodsFor: 'generated-accessing' stamp: 'ms 1/24/2008 16:52'! scannerClass ^SaphirScanner2! ! !SaphirParser2 class methodsFor: 'generated-starting states' stamp: 'ms 1/24/2008 16:52'! startingStateForMethodPattern ^3! ! !SaphirParser2 class methodsFor: 'generated-starting states' stamp: 'ms 1/24/2008 16:52'! startingStateForScript ^4! ! !SaphirParser2 class methodsFor: 'generated-starting states' stamp: 'ms 1/24/2008 16:52'! startingStateForSequence ^2! ! SmaCCScanner subclass: #SqueakScanner instanceVariableNames: 'previousToken comments' classVariableNames: '' poolDictionaries: '' category: 'Coral-DeadCode'! !SqueakScanner commentStamp: 'ajh 3/24/2003 21:31' prior: 0! I parse Smalltalk text into tokens which are used by the SqueakParser. Methods under 'generated-*' categories were automatically generated using SmaCC.! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! assignmentId ^26! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! binarySymbolId ^25! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! characterId ^30! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! colonId ^36! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! emptySymbolTokenId ^80! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! errorTokenId ^81! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! keywordId ^23! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! multikeywordId ^24! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! nameId ^22! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! negativeNumberId ^20! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! numberId ^19! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! periodId ^31! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! rightBoxBracketsId ^33! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! rightCurlyBracketsId ^34! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! rightParenthesesId ^35! ! !SqueakScanner methodsFor: 'generated-tokens' stamp: 'ms 4/7/2007 03:32'! stringId ^21! ! !SqueakScanner methodsFor: 'token handling' stamp: 'ms 3/31/2007 21:31'! binarySymbol "Negative number takes precedence over binary symbol, so for example, '0@-1' means '0 @ -1', rather than '0 @- 1', which is how the scanner reads it. If the symbol is just $- and the next char is a digit, then the negative number token takes precedence and SqueakParser>>actionForCurrentToken converts it to a binary symbol. If there is space between $- and the digit, then it reaches here and we convert it to a negativeNumber token (and let SqueakParser>>actionForCurrentToken deal with it)." | string negPos prevReturnMatchBlock | string _ outputStream contents. string last = $- ifFalse: [ matchActions _ {self binarySymbolId}. ^ self createTokenFor: outputStream contents]. stream peek ifNil: [ matchActions _ {self binarySymbolId}. ^ self createTokenFor: outputStream contents]. stream peek isDigit ifTrue: [ "Back up one and let scanner find negativeNumber token" outputStream skip: -1. stream skip: -1. matchActions _ {self binarySymbolId}. ^ self createTokenFor: outputStream contents]. (stream peek = $ and: [string size = 1]) ifFalse: [ matchActions _ {self binarySymbolId}. ^ self createTokenFor: outputStream contents]. "Allow space between negative sign and number (wierd, but allowed in Smalltalk ANSI standard)" negPos _ stream position. [stream peek = $ ] whileTrue: [stream next]. stream peek isDigit ifFalse: [ stream position: negPos. matchActions _ {self binarySymbolId}. ^ self createTokenFor: outputStream contents]. "scan number but catch return and convert it to a negative number" prevReturnMatchBlock _ returnMatchBlock. returnMatchBlock _ [:token | returnMatchBlock _ prevReturnMatchBlock. token id first = self numberId ifFalse: [self error: 'unexpected token']. token value: '-', token value start: token start - 1 id: {self negativeNumberId}. returnMatchBlock value: token]. self whitespace. "eats whitespace and scans next token"! ! !SqueakScanner methodsFor: 'token handling' stamp: 'ms 5/10/2007 20:07'! comment | value | value := outputStream contents. comments add: {value. start}. previousToken := SqueakToken value: value start: start id: #comment prevToken: previousToken. self resetScanner. stream atEnd ifFalse: [^self scanForToken] ifTrue:[^self scannerError] ! ! !SqueakScanner methodsFor: 'token handling' stamp: 'ajh 7/16/2004 10:57'! variableAssignment outputStream skip: -2. stream skip: -2. matchActions _ {self nameId}. self createTokenFor: outputStream contents. ! ! !SqueakScanner methodsFor: 'token handling' stamp: 'ms 5/10/2007 20:07'! whitespace | value | value := outputStream contents. previousToken := (SqueakToken value: value start: start id: #whitespace prevToken: previousToken). ^super whitespace. "eats the whitespace" ! ! !SqueakScanner methodsFor: 'private' stamp: 'ajh 3/6/2003 00:16'! comments ^ comments! ! !SqueakScanner methodsFor: 'private' stamp: 'ms 4/7/2007 03:31'! createTokenFor: string | token | token := SqueakToken value: string start: start + 1 id: matchActions prevToken: previousToken. previousToken := token. outputStream reset. matchActions := nil. returnMatchBlock value: token! ! !SqueakScanner methodsFor: 'private' stamp: 'ajh 3/6/2003 00:13'! initialize super initialize. comments _ OrderedCollection new. ! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan1 [self step. currentCharacter ~= $'] whileTrue. currentCharacter = $' ifTrue: [^ self scan2]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan10 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(20 ). self step. currentCharacter between: $0 and: $9] whileTrue. ^ self reportLastMatch]. currentCharacter = $- ifTrue: [^ self scan11]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan11 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(20 ). self step. currentCharacter between: $0 and: $9] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan2 self recordMatch: #(21 ). self step. currentCharacter = $' ifTrue: [^ self scan1]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan3 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(19 ). self step. currentCharacter between: $0 and: $9] whileTrue. currentCharacter = $e ifTrue: [^ self scan4]. currentCharacter = $s ifTrue: [^ self scan5]. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan4 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(19 ). self step. currentCharacter between: $0 and: $9] whileTrue. ^ self reportLastMatch]. currentCharacter = $- ifTrue: [^ self scan5]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan5 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(19 ). self step. currentCharacter between: $0 and: $9] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan6 self step. ((currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]) ifTrue: [ [self recordMatch: #(19 ). self step. (currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]] whileTrue. currentCharacter = $. ifTrue: [self step. ((currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]) ifTrue: [ [self recordMatch: #(19 ). self step. (currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]] whileTrue. currentCharacter = $e ifTrue: [^ self scan4]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $e ifTrue: [^ self scan4]. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan7 [self step. (currentCharacter between: $0 and: $9) or: [(currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]]] whileTrue. currentCharacter = $: ifTrue: [self recordMatch: #(27 ). self step. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [^ self scan7]. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan8 self recordMatch: #(23 ). self step. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [^ self scan9]. currentCharacter = $= ifTrue: [^ self recordAndReportMatch: #variableAssignment]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scan9 [self step. (currentCharacter between: $0 and: $9) or: [(currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]]] whileTrue. currentCharacter = $: ifTrue: [self recordMatch: #(24 ). self step. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [^ self scan9]. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SqueakScanner methodsFor: 'generated-scanner' stamp: 'ms 4/7/2007 03:32'! scanForToken self step. (currentCharacter <= Character backspace or: [(currentCharacter between: (Character value: 14) and: (Character value: 31)) or: [currentCharacter = $` or: [currentCharacter >= $]]]) ifTrue: [^ self recordAndReportMatch: #(38 )]. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [self recordMatch: #(22 38 ). self step. ((currentCharacter between: $0 and: $9) or: [(currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]]) ifTrue: [ [self recordMatch: #(22 ). self step. (currentCharacter between: $0 and: $9) or: [(currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]]] whileTrue. currentCharacter = $: ifTrue: [^ self scan8]. ^ self reportLastMatch]. currentCharacter = $: ifTrue: [^ self scan8]. ^ self reportLastMatch]. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $+ and: $,) or: [currentCharacter = $/ or: [currentCharacter = $= or: [(currentCharacter between: $? and: $@) or: [currentCharacter = $\ or: [currentCharacter = $~]]]]]]]) ifTrue: [self recordMatch: #binarySymbol. self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. (currentCharacter between: $0 and: $9) ifTrue: [self recordMatch: #(19 38 ). self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(19 ). self step. currentCharacter between: $0 and: $9] whileTrue. currentCharacter = $. ifTrue: [^ self scan3]. currentCharacter = $e ifTrue: [^ self scan4]. currentCharacter = $r ifTrue: [^ self scan6]. currentCharacter = $s ifTrue: [^ self scan5]. ^ self reportLastMatch]. currentCharacter = $. ifTrue: [^ self scan3]. currentCharacter = $e ifTrue: [^ self scan4]. currentCharacter = $r ifTrue: [^ self scan6]. currentCharacter = $s ifTrue: [^ self scan5]. ^ self reportLastMatch]. ((currentCharacter between: Character tab and: Character cr) or: [currentCharacter = Character space]) ifTrue: [self recordMatch: #whitespace. self step. ((currentCharacter between: Character tab and: Character cr) or: [currentCharacter = Character space]) ifTrue: [ [self recordMatch: #whitespace. self step. (currentCharacter between: Character tab and: Character cr) or: [currentCharacter = Character space]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $" ifTrue: [self recordMatch: #(38 ). self step. currentCharacter ~= $" ifTrue: [ [self step. currentCharacter ~= $"] whileTrue. currentCharacter = $" ifTrue: [^ self recordAndReportMatch: #comment]. ^ self reportLastMatch]. currentCharacter = $" ifTrue: [^ self recordAndReportMatch: #comment]. ^ self reportLastMatch]. currentCharacter = $# ifTrue: [self recordMatch: #(17 38 ). self step. currentCharacter = $: ifTrue: [^ self recordAndReportMatch: #(18 )]. ^ self reportLastMatch]. currentCharacter = $$ ifTrue: [self recordMatch: #(38 ). self step. currentCharacter <= $þ ifTrue: [^ self recordAndReportMatch: #(30 )]. ^ self reportLastMatch]. currentCharacter = $' ifTrue: [self recordMatch: #(38 ). self step. currentCharacter ~= $' ifTrue: [^ self scan1]. currentCharacter = $' ifTrue: [^ self scan2]. ^ self reportLastMatch]. currentCharacter = $( ifTrue: [^ self recordAndReportMatch: #(2 38 )]. currentCharacter = $) ifTrue: [^ self recordAndReportMatch: #(35 38 )]. currentCharacter = $* ifTrue: [self recordMatch: #(12 25 38 ). self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $- ifTrue: [self recordMatch: #binarySymbol. self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(20 ). self step. currentCharacter between: $0 and: $9] whileTrue. currentCharacter = $. ifTrue: [self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(20 ). self step. currentCharacter between: $0 and: $9] whileTrue. currentCharacter = $e ifTrue: [^ self scan10]. currentCharacter = $s ifTrue: [^ self scan11]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $e ifTrue: [^ self scan10]. currentCharacter = $r ifTrue: [self step. ((currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]) ifTrue: [ [self recordMatch: #(20 ). self step. (currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]] whileTrue. currentCharacter = $. ifTrue: [self step. ((currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]) ifTrue: [ [self recordMatch: #(20 ). self step. (currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]] whileTrue. currentCharacter = $e ifTrue: [^ self scan10]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $e ifTrue: [^ self scan10]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $s ifTrue: [^ self scan11]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $. ifTrue: [^ self recordAndReportMatch: #(31 38 )]. currentCharacter = $: ifTrue: [self recordMatch: #(36 38 ). self step. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [^ self scan7]. currentCharacter = $= ifTrue: [^ self recordAndReportMatch: #(26 )]. ^ self reportLastMatch]. currentCharacter = $; ifTrue: [^ self recordAndReportMatch: #(37 38 )]. currentCharacter = $< ifTrue: [self recordMatch: #(6 25 38 ). self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $> ifTrue: [self recordMatch: #(7 25 38 ). self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $[ ifTrue: [^ self recordAndReportMatch: #(1 38 )]. currentCharacter = $] ifTrue: [^ self recordAndReportMatch: #(33 38 )]. currentCharacter = $^ ifTrue: [^ self recordAndReportMatch: #(4 38 )]. currentCharacter = $_ ifTrue: [^ self recordAndReportMatch: #(26 38 )]. currentCharacter = ${ ifTrue: [^ self recordAndReportMatch: #(5 38 )]. currentCharacter = $| ifTrue: [self recordMatch: #(9 25 38 ). self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $} ifTrue: [^ self recordAndReportMatch: #(34 38 )]. ^ self reportLastMatch! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! SqueakScanner class instanceVariableNames: ''! !SqueakScanner class methodsFor: 'generated-initialization' stamp: 'ms 4/7/2007 03:32'! initializeKeywordMap keywordMap := Dictionary new. #( #(#binarySymbol '||' 8 ) #(22 'false' 15 ) #(22 'nil' 16 ) #(22 'true' 10 ) #(23 'apicall:' 14 ) #(23 'cdecl:' 11 ) #(23 'module:' 13 ) #(23 'primitive:' 3 ) ) do: [:each | (keywordMap at: each first ifAbsentPut: [Dictionary new]) at: (each at: 2) put: each last]. ^ keywordMap! ! !SqueakScanner class methodsFor: 'generated-comments' stamp: 'ms 4/7/2007 03:32'! scannerDefinitionComment ": [0-9]+ (\. [0-9]+)? ; : [0-9]+ r [0-9A-Z]+ (\. [0-9A-Z]+)? ; : s [0-9]+ ; : ( | ) e \-? [0-9]+ ; : | | | ; : \- ; : \' [^\']* \' (\' [^\']* \')* ; : [a-zA-Z] [a-zA-Z0-9]* ; : \: ; : \: ( \: )+ ; : [\~\!!\@\%\&\*\-\+\=\\\|\?\/\>\<\,] [\~\!!\@\%\&\*\-\+\=\\\|\?\/\>\<\,]* ; : \: \= | \_ ; : \: \: ( \:)* ; : \s+ ; : \"" [^\""]* \"" ; : \$ . ; : \. ; : \: \= ; : ]; : }; : \); : \:; : \;; : . ; # For VW literal arrays that handle #(;) -> #(#';');"! ! SqueakScanner subclass: #SaphirScanner2 instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Coral-DeadCode'! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! assignmentId ^29! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! binarySymbolId ^28! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! characterId ^33! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! colonId ^39! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! emptySymbolTokenId ^88! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! errorTokenId ^89! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! keywordId ^26! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! multikeywordId ^27! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! nameId ^25! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! negativeNumberId ^23! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! numberId ^22! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! periodId ^34! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! rightBoxBracketsId ^36! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! rightCurlyBracketsId ^37! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! rightParenthesesId ^38! ! !SaphirScanner2 methodsFor: 'generated-tokens' stamp: 'ms 1/24/2008 16:52'! stringId ^24! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan1 [self step. currentCharacter ~= $'] whileTrue. currentCharacter = $' ifTrue: [^ self scan2]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan10 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(23 ). self step. currentCharacter between: $0 and: $9] whileTrue. ^ self reportLastMatch]. currentCharacter = $- ifTrue: [^ self scan11]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan11 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(23 ). self step. currentCharacter between: $0 and: $9] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan2 self recordMatch: #(24 ). self step. currentCharacter = $' ifTrue: [^ self scan1]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan3 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(22 ). self step. currentCharacter between: $0 and: $9] whileTrue. currentCharacter = $e ifTrue: [^ self scan4]. currentCharacter = $s ifTrue: [^ self scan5]. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan4 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(22 ). self step. currentCharacter between: $0 and: $9] whileTrue. ^ self reportLastMatch]. currentCharacter = $- ifTrue: [^ self scan5]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan5 self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(22 ). self step. currentCharacter between: $0 and: $9] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan6 self step. ((currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]) ifTrue: [ [self recordMatch: #(22 ). self step. (currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]] whileTrue. currentCharacter = $. ifTrue: [self step. ((currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]) ifTrue: [ [self recordMatch: #(22 ). self step. (currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]] whileTrue. currentCharacter = $e ifTrue: [^ self scan4]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $e ifTrue: [^ self scan4]. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan7 [self step. (currentCharacter between: $0 and: $9) or: [(currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]]] whileTrue. currentCharacter = $: ifTrue: [self recordMatch: #(30 ). self step. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [^ self scan7]. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan8 self recordMatch: #(26 ). self step. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [^ self scan9]. currentCharacter = $= ifTrue: [^ self recordAndReportMatch: #variableAssignment]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scan9 [self step. (currentCharacter between: $0 and: $9) or: [(currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]]] whileTrue. currentCharacter = $: ifTrue: [self recordMatch: #(27 ). self step. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [^ self scan9]. ^ self reportLastMatch]. ^ self reportLastMatch! ! !SaphirScanner2 methodsFor: 'generated-scanner' stamp: 'ms 1/24/2008 16:52'! scanForToken self step. (currentCharacter <= Character backspace or: [(currentCharacter between: (Character value: 14) and: (Character value: 31)) or: [currentCharacter = $` or: [currentCharacter >= $]]]) ifTrue: [^ self recordAndReportMatch: #(41 )]. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [self recordMatch: #(25 41 ). self step. ((currentCharacter between: $0 and: $9) or: [(currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]]) ifTrue: [ [self recordMatch: #(25 ). self step. (currentCharacter between: $0 and: $9) or: [(currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]]] whileTrue. currentCharacter = $: ifTrue: [^ self scan8]. ^ self reportLastMatch]. currentCharacter = $: ifTrue: [^ self scan8]. ^ self reportLastMatch]. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $+ and: $,) or: [currentCharacter = $/ or: [currentCharacter = $= or: [(currentCharacter between: $? and: $@) or: [currentCharacter = $\ or: [currentCharacter = $~]]]]]]]) ifTrue: [self recordMatch: #binarySymbol. self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. (currentCharacter between: $0 and: $9) ifTrue: [self recordMatch: #(22 41 ). self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(22 ). self step. currentCharacter between: $0 and: $9] whileTrue. currentCharacter = $. ifTrue: [^ self scan3]. currentCharacter = $e ifTrue: [^ self scan4]. currentCharacter = $r ifTrue: [^ self scan6]. currentCharacter = $s ifTrue: [^ self scan5]. ^ self reportLastMatch]. currentCharacter = $. ifTrue: [^ self scan3]. currentCharacter = $e ifTrue: [^ self scan4]. currentCharacter = $r ifTrue: [^ self scan6]. currentCharacter = $s ifTrue: [^ self scan5]. ^ self reportLastMatch]. ((currentCharacter between: Character tab and: Character cr) or: [currentCharacter = Character space]) ifTrue: [self recordMatch: #whitespace. self step. ((currentCharacter between: Character tab and: Character cr) or: [currentCharacter = Character space]) ifTrue: [ [self recordMatch: #whitespace. self step. (currentCharacter between: Character tab and: Character cr) or: [currentCharacter = Character space]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $" ifTrue: [self recordMatch: #(41 ). self step. currentCharacter ~= $" ifTrue: [ [self step. currentCharacter ~= $"] whileTrue. currentCharacter = $" ifTrue: [^ self recordAndReportMatch: #comment]. ^ self reportLastMatch]. currentCharacter = $" ifTrue: [^ self recordAndReportMatch: #comment]. ^ self reportLastMatch]. currentCharacter = $# ifTrue: [self recordMatch: #(18 41 ). self step. currentCharacter = $: ifTrue: [^ self recordAndReportMatch: #(17 )]. ^ self reportLastMatch]. currentCharacter = $$ ifTrue: [self recordMatch: #(41 ). self step. currentCharacter <= $þ ifTrue: [^ self recordAndReportMatch: #(33 )]. ^ self reportLastMatch]. currentCharacter = $' ifTrue: [self recordMatch: #(41 ). self step. currentCharacter ~= $' ifTrue: [^ self scan1]. currentCharacter = $' ifTrue: [^ self scan2]. ^ self reportLastMatch]. currentCharacter = $( ifTrue: [^ self recordAndReportMatch: #(6 41 )]. currentCharacter = $) ifTrue: [^ self recordAndReportMatch: #(38 41 )]. currentCharacter = $* ifTrue: [self recordMatch: #(16 28 41 ). self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $- ifTrue: [self recordMatch: #binarySymbol. self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(23 ). self step. currentCharacter between: $0 and: $9] whileTrue. currentCharacter = $. ifTrue: [self step. (currentCharacter between: $0 and: $9) ifTrue: [ [self recordMatch: #(23 ). self step. currentCharacter between: $0 and: $9] whileTrue. currentCharacter = $e ifTrue: [^ self scan10]. currentCharacter = $s ifTrue: [^ self scan11]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $e ifTrue: [^ self scan10]. currentCharacter = $r ifTrue: [self step. ((currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]) ifTrue: [ [self recordMatch: #(23 ). self step. (currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]] whileTrue. currentCharacter = $. ifTrue: [self step. ((currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]) ifTrue: [ [self recordMatch: #(23 ). self step. (currentCharacter between: $0 and: $9) or: [currentCharacter between: $A and: $Z]] whileTrue. currentCharacter = $e ifTrue: [^ self scan10]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $e ifTrue: [^ self scan10]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $s ifTrue: [^ self scan11]. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $. ifTrue: [^ self recordAndReportMatch: #(34 41 )]. currentCharacter = $: ifTrue: [self recordMatch: #(39 41 ). self step. ((currentCharacter between: $A and: $Z) or: [currentCharacter between: $a and: $z]) ifTrue: [^ self scan7]. currentCharacter = $= ifTrue: [^ self recordAndReportMatch: #(29 )]. ^ self reportLastMatch]. currentCharacter = $; ifTrue: [^ self recordAndReportMatch: #(40 41 )]. currentCharacter = $< ifTrue: [self recordMatch: #(4 28 41 ). self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $> ifTrue: [self recordMatch: #(9 28 41 ). self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $[ ifTrue: [^ self recordAndReportMatch: #(11 41 )]. currentCharacter = $] ifTrue: [^ self recordAndReportMatch: #(10 36 41 )]. currentCharacter = $^ ifTrue: [^ self recordAndReportMatch: #(5 41 )]. currentCharacter = $_ ifTrue: [^ self recordAndReportMatch: #(29 41 )]. currentCharacter = ${ ifTrue: [^ self recordAndReportMatch: #(14 41 )]. currentCharacter = $| ifTrue: [self recordMatch: #(2 28 41 ). self step. (currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]) ifTrue: [ [self recordMatch: #binarySymbol. self step. currentCharacter = $!! or: [(currentCharacter between: $% and: $&) or: [(currentCharacter between: $* and: $-) or: [currentCharacter = $/ or: [(currentCharacter between: $< and: $@) or: [currentCharacter = $\ or: [currentCharacter = $| or: [currentCharacter = $~]]]]]]]] whileTrue. ^ self reportLastMatch]. ^ self reportLastMatch]. currentCharacter = $} ifTrue: [^ self recordAndReportMatch: #(37 41 )]. ^ self reportLastMatch! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! SaphirScanner2 class instanceVariableNames: ''! !SaphirScanner2 class methodsFor: 'generated-initialization' stamp: 'ms 1/24/2008 16:52'! initializeKeywordMap keywordMap := Dictionary new. #( #(25 'class' 7 ) #(25 'false' 20 ) #(25 'nil' 21 ) #(25 'true' 19 ) #(26 'apicall:' 12 ) #(26 'cdecl:' 13 ) #(26 'module:' 15 ) #(26 'primitive:' 3 ) #(#binarySymbol '>>' 8 ) #(#binarySymbol '||' 1 ) ) do: [:each | (keywordMap at: each first ifAbsentPut: [Dictionary new]) at: (each at: 2) put: each last]. ^ keywordMap! ! !SaphirScanner2 class methodsFor: 'generated-comments' stamp: 'ms 1/24/2008 16:52'! scannerDefinitionComment ": [0-9]+ (\. [0-9]+)? ; : [0-9]+ r [0-9A-Z]+ (\. [0-9A-Z]+)? ; : s [0-9]+ ; : ( | ) e \-? [0-9]+ ; : | | | ; : \- ; : \' [^\']* \' (\' [^\']* \')* ; : [a-zA-Z] [a-zA-Z0-9]* ; : \: ; : \: ( \: )+ ; : [\~\!!\@\%\&\*\-\+\=\\\|\?\/\>\<\,] [\~\!!\@\%\&\*\-\+\=\\\|\?\/\>\<\,]* ; : \: \= | \_ ; : \: \: ( \:)* ; : \s+ ; : \"" [^\""]* \"" ; : \$ . ; : \. ; : \: \= ; : ]; : }; : \); : \:; : \;; : . ; # For VW literal arrays that handle #(;) -> #(#';');"! ! SmaCCToken subclass: #SqueakToken instanceVariableNames: 'next previous eat' classVariableNames: '' poolDictionaries: '' category: 'Coral-DeadCode'! !SqueakToken methodsFor: 'accessing' stamp: 'ms 9/19/2006 13:19'! eatToken eat := true. ^self! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 9/17/2006 19:57'! eatValue eat := true. ^self value! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 4/1/2007 13:43'! length ^(self stop - self start) + 1! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 9/16/2006 17:18'! next ^next! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 9/16/2006 23:24'! next: aToken next := aToken! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 9/17/2006 18:41'! nextSignificant | nextSign | nextSign := self next. [nextSign isInsignificant] whileTrue: [nextSign := nextSign next. nextSign ifNil:[^nil]]. ^nextSign! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 9/16/2006 17:19'! previous ^previous! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 9/16/2006 17:29'! previous: aToken aToken ifNotNil:[aToken next: self]. previous := aToken! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 3/31/2007 22:01'! start ^self startPosition! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 3/31/2007 21:18'! start: aSmallInteger start := aSmallInteger! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 3/31/2007 22:02'! stop ^self stopPosition! ! !SqueakToken methodsFor: 'accessing' stamp: 'ms 3/31/2007 21:17'! value: aValue value := aValue! ! !SqueakToken methodsFor: 'initialize' stamp: 'ms 9/17/2006 19:56'! initialize eat := false! ! !SqueakToken methodsFor: 'add' stamp: 'ms 9/17/2006 14:47'! insertAfterMe: aToken self next previous: aToken. aToken previous: self! ! !SqueakToken methodsFor: 'add' stamp: 'ms 9/17/2006 14:41'! insertBeforMe: aToken aToken previous: self previous. self previous: aToken! ! !SqueakToken methodsFor: 'testing' stamp: 'ms 5/2/2007 11:48'! isComment ^id == #comment! ! !SqueakToken methodsFor: 'testing' stamp: 'ms 9/17/2006 19:59'! isEaten ^eat! ! !SqueakToken methodsFor: 'testing' stamp: 'ms 9/19/2006 15:32'! isInsignificant ^false! ! !SqueakToken methodsFor: 'testing' stamp: 'ms 5/2/2007 11:51'! isNewLine ^self isWhitespace and:[(self value indexOf: Character cr) > 0 or: [(self value indexOf: Character lf) > 0]]! ! !SqueakToken methodsFor: 'testing' stamp: 'ms 3/31/2007 21:16'! isRBToken ^false! ! !SqueakToken methodsFor: 'testing' stamp: 'ms 4/1/2007 18:39'! isSignificant ^(self isComment or:[self isWhitespace] or: [self value = '|'] or: [self value = '.'] or: [self isWhitespace]) not! ! !SqueakToken methodsFor: 'testing' stamp: 'ms 5/2/2007 11:49'! isWhitespace ^id == #whitespace! ! !SqueakToken methodsFor: 'testing' stamp: 'ms 9/17/2006 19:59'! notEaten ^eat not! ! !SqueakToken methodsFor: 'replace' stamp: 'ms 11/11/2006 19:13'! substitueTo: aToken self previous: aToken previous. aToken next ifNotNilDo:[:nextToken | nextToken previous: self]! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! SqueakToken class instanceVariableNames: ''! !SqueakToken class methodsFor: 'instance creation' stamp: 'ms 9/17/2006 14:43'! value: aString start: anInteger ^(self new) value: aString; start: anInteger; yourself! ! !SqueakToken class methodsFor: 'instance creation' stamp: 'ms 9/17/2006 15:25'! value: aString start: anInteger id: anObject ^(self new) value: aString start: anInteger id: anObject; yourself! ! !SqueakToken class methodsFor: 'instance creation' stamp: 'ms 9/16/2006 17:26'! value: aString start: anInteger id: anObject prevToken: aToken ^(self new) value: aString start: anInteger id: anObject; previous: aToken; yourself! ! !SqueakToken class methodsFor: 'instance creation' stamp: 'ms 9/17/2006 14:33'! value: aString start: anInteger prevToken: aToken ^(self new) value: aString; start: anInteger; previous: aToken; yourself! ! Stream subclass: #SqueakTokenStream instanceVariableNames: 'token goNext' classVariableNames: '' poolDictionaries: '' category: 'Coral-DeadCode'! !SqueakTokenStream methodsFor: 'accessing' stamp: 'ms 9/17/2006 19:00'! atEnd ^token isNil! ! !SqueakTokenStream methodsFor: 'accessing' stamp: 'ms 9/19/2006 00:42'! contents | cont nextToken | cont := OrderedCollection new. nextToken := token. [nextToken isNil] whileFalse: [cont add: nextToken. nextToken := nextToken perform: goNext]. ^cont asArray! ! !SqueakTokenStream methodsFor: 'accessing' stamp: 'ms 9/19/2006 02:09'! next | next | next := token. self atEnd ifFalse:[token := token perform: goNext]. ^next! ! !SqueakTokenStream methodsFor: 'accessing' stamp: 'ms 9/19/2006 01:03'! peek ^token! ! !SqueakTokenStream methodsFor: 'accessing' stamp: 'ms 9/19/2006 13:08'! selectCommentNewLine ^SelectSqueakTokenStream selectCommentNewLineOn: self! ! !SqueakTokenStream methodsFor: 'accessing' stamp: 'ms 5/28/2007 14:03'! selectCommentNewLineWithPipe ^SelectSqueakTokenStream selectCommentNewLineWithPipeOn: self! ! !SqueakTokenStream methodsFor: 'initialize' stamp: 'ms 9/19/2006 00:41'! backwardOn: aToken token := aToken. goNext := #previous! ! !SqueakTokenStream methodsFor: 'initialize' stamp: 'ms 9/19/2006 00:41'! forwardOn: aToken token := aToken. goNext := #next! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! SqueakTokenStream class instanceVariableNames: ''! !SqueakTokenStream class methodsFor: 'instance creation' stamp: 'ms 9/17/2006 19:05'! backwardOn: aToken ^(self basicNew) initialize; backwardOn: aToken; yourself ! ! !SqueakTokenStream class methodsFor: 'instance creation' stamp: 'ms 9/19/2006 14:42'! forwardOn: aToken ^(self basicNew) initialize; forwardOn: aToken ! ! SqueakParser initialize!