All pastes #31142 Raw Edit

Opentalk stst url

public text v1 · immutable
#31142 ·published 2005-11-25 11:03 UTC
rendered paste body
<?xml version="1.0"?>

<st-source>
<time-stamp>From VisualWorks®, Pre-Release 7.3.1 (jan05.1) of January 24, 2005 on November 25, 2005 at 11:49:11 am</time-stamp>


<class>
<name>StstURL</name>
<environment>Roots.Distributed</environment>
<super>Net.URLwithPath</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>application host port user password type variant </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Roots-Distributed-Opentalk</category>
<attributes>
<package>Roots-Distributed-Stst</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>Roots.Distributed.StstURL class</class-id> <category>accessing</category>

<body package="Roots-Distributed-Stst" selector="protocol">protocol

	^'stst'</body>
</methods>

<methods>
<class-id>Roots.Distributed.StstURL class</class-id> <category>instance creation</category>

<body package="Roots-Distributed-Stst" selector="fromString:">fromString: aString
	"URI class removes the protocol, and the parser expects it"

	^self parse:
		(((aString copyFrom: 1 to: self protocol size) = self protocol)
			ifTrue: [aString]
			ifFalse: [self protocol, ':', aString])</body>

<body package="Roots-Distributed-Stst" selector="parse:">parse: aString

	^StstURLParser parse: aString</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>Roots.Distributed.StstURL</class-id> <category>accessing</category>

<body package="Roots-Distributed-Stst" selector="application">application
	^application</body>

<body package="Roots-Distributed-Stst" selector="application:">application: anObject
	application := anObject</body>

<body package="Roots-Distributed-Stst" selector="host">host
	^host</body>

<body package="Roots-Distributed-Stst" selector="host:">host: anObject
	host := anObject</body>

<body package="Roots-Distributed-Stst" selector="password">password
	^password</body>

<body package="Roots-Distributed-Stst" selector="password:">password: anObject
	password := anObject</body>

<body package="Roots-Distributed-Stst" selector="port">port
	^port</body>

<body package="Roots-Distributed-Stst" selector="port:">port: anObject
	port := anObject</body>

<body package="Roots-Distributed-Stst" selector="type">type
	^type</body>

<body package="Roots-Distributed-Stst" selector="type:">type: anObject
	type := anObject</body>

<body package="Roots-Distributed-Stst" selector="user">user
	^user</body>

<body package="Roots-Distributed-Stst" selector="user:">user: anObject
	user := anObject</body>
</methods>

<methods>
<class-id>Roots.Distributed.StstURL</class-id> <category>converting</category>

<body package="Roots-Distributed-Stst" selector="asContext">asContext

	^StstContext fromURL: self</body>

<body package="Roots-Distributed-Stst" selector="asString">asString

	^self printString</body>
</methods>

<methods>
<class-id>Roots.Distributed.StstURL</class-id> <category>printing</category>

<body package="Roots-Distributed-Stst" selector="printOn:">printOn: aStream

	aStream
		nextPutAll: self class protocol;
		nextPutAll: '://'.
	self user notNil ifTrue: [
		aStream nextPutAll: self user.
		self password notNil ifTrue: [
			aStream
				nextPut: $:;
				nextPutAll: self password].
		aStream nextPut: $@].
	self host notNil ifTrue: [
		aStream nextPutAll: self host.
		self port notNil ifTrue: [
			aStream
				nextPut: $:;
				nextPutAll: self port printString].
		aStream
			nextPut: $/].
	aStream nextPutAll: self application.</body>
</methods>

<class>
<name>StstURLParser</name>
<environment>Roots.Distributed</environment>
<super>Refactory.SmaCC.SmaCCParser</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>url </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>SmaCC Generated Scanner/Parser</category>
<attributes>
<package>Roots-Distributed-Stst</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>Roots.Distributed.StstURLParser class</class-id> <category>generated-accessing</category>

<body package="Roots-Distributed-Stst" selector="scannerClass">scannerClass
	^StstURLScanner</body>
</methods>

<methods>
<class-id>Roots.Distributed.StstURLParser class</class-id> <category>generated-starting states</category>

<body package="Roots-Distributed-Stst" selector="startingStateForStstURL">startingStateForStstURL
	^1</body>
</methods>

<methods>
<class-id>Roots.Distributed.StstURLParser class</class-id> <category>generated-comments</category>

<body package="Roots-Distributed-Stst" selector="parserDefinitionComment">parserDefinitionComment

	"StstURL: ""stst://"" ( login ""@"" )? hostport ""/"" application { url } ;
login: user ( "":"" password )? ;
hostport: host ( "":"" port )? ;
user: &lt;IDENTIFIER&gt; { url user: '1' value } ;
password: &lt;IDENTIFIER&gt; { url password: '1' value } ;
host: ( &lt;HOST_NAME&gt; | &lt;IP_ADDRESS&gt; ) { url host: '1' value } ;
port: &lt;NUMBER&gt; { url port: '1' value asNumber } ;
application: &lt;IDENTIFIER&gt;  { url application: '1' value } ;"</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>Roots.Distributed.StstURLParser</class-id> <category>initialize-release</category>

<body package="Roots-Distributed-Stst" selector="initialize">initialize

	super initialize.
	url := StstURL new.</body>
</methods>

<methods>
<class-id>Roots.Distributed.StstURLParser</class-id> <category>generated-reduction actions</category>

<body package="Roots-Distributed-Stst" selector="reduceActionForapplication1:">reduceActionForapplication1: nodes 
	^url application: (nodes at: 1) value</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForGroup______HOST_NAME_____IP_ADDRESS_1:">reduceActionForGroup______HOST_NAME_____IP_ADDRESS_1: nodes 
	^nodes at: 1</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForGroup______HOST_NAME_____IP_ADDRESS_2:">reduceActionForGroup______HOST_NAME_____IP_ADDRESS_2: nodes 
	^nodes at: 1</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForhost1:">reduceActionForhost1: nodes 
	^url host: (nodes at: 1) value</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForOptional__Group_____login____1:">reduceActionForOptional__Group_____login____1: nodes 
	^nil</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForOptional__Group_____login____2:">reduceActionForOptional__Group_____login____2: nodes 
	^nodes at: 1</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForOptional__Group_________password1:">reduceActionForOptional__Group_________password1: nodes 
	^nil</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForOptional__Group_________password2:">reduceActionForOptional__Group_________password2: nodes 
	^nodes at: 1</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForOptional__Group_________port1:">reduceActionForOptional__Group_________port1: nodes 
	^nil</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForOptional__Group_________port2:">reduceActionForOptional__Group_________port2: nodes 
	^nodes at: 1</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForpassword1:">reduceActionForpassword1: nodes 
	^url password: (nodes at: 1) value</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForport1:">reduceActionForport1: nodes 
	^url port: (nodes at: 1) value asNumber</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForStstURL1:">reduceActionForStstURL1: nodes 
	^url</body>

<body package="Roots-Distributed-Stst" selector="reduceActionForuser1:">reduceActionForuser1: nodes 
	^url user: (nodes at: 1) value</body>
</methods>

<methods>
<class-id>Roots.Distributed.StstURLParser</class-id> <category>generated-tables</category>

<body package="Roots-Distributed-Stst" selector="reduceTable">reduceTable
	^#(
#(10 5 #reduceActionForStstURL1:)
#(11 1 #reduceFor:)
#(12 1 #reduceActionForuser1:)
#(13 1 #reduceActionForpassword1:)
#(14 1 #reduceActionForapplication1:)
#(15 0 #reduceActionForOptional__Group_________password1:)
#(15 1 #reduceActionForOptional__Group_________password2:)
#(16 1 #reduceActionForhost1:)
#(17 1 #reduceActionForport1:)
#(18 2 #reduceFor:)
#(19 0 #reduceActionForOptional__Group_________port1:)
#(19 1 #reduceActionForOptional__Group_________port2:)
#(20 0 #reduceActionForOptional__Group_____login____1:)
#(20 1 #reduceActionForOptional__Group_____login____2:)
#(21 2 #reduceFor:)
#(22 2 #reduceFor:)
#(23 1 #reduceActionForGroup______HOST_NAME_____IP_ADDRESS_1:)
#(23 1 #reduceActionForGroup______HOST_NAME_____IP_ADDRESS_2:)
#(24 2 #reduceFor:)
#(27 2 #reduceFor:)
)</body>

<body package="Roots-Distributed-Stst" selector="transitionTable">transitionTable
	^#(
#[1 0 9 0 1 0 13 0 10]
#[1 0 54 0 7 0 17 0 8 0 54 0 9 0 21 0 12 0 25 0 20 0 29 0 22 0 33 0 24]
#[0 0 0 0 25]
#[0 0 14 0 2 0 4]
#[1 0 26 0 2 0 37 0 4 0 41 0 15 0 45 0 27]
#[1 0 49 0 7 0 53 0 9 0 57 0 16 0 61 0 21 0 65 0 23]
#[0 0 69 0 2]
#[0 0 58 0 7 0 9]
#[1 0 73 0 8 0 77 0 13]
#[0 0 66 0 2]
#[0 0 30 0 2]
#[0 0 74 0 3 0 4]
#[0 0 70 0 3 0 4]
#[1 0 46 0 3 0 81 0 4 0 85 0 18 0 89 0 19]
#[0 0 93 0 3]
#[0 0 34 0 3 0 4]
#[0 0 78 0 7 0 9]
#[0 0 18 0 2]
#[0 0 82 0 2]
#[1 0 97 0 6 0 101 0 17]
#[0 0 50 0 3]
#[0 0 62 0 3]
#[1 0 105 0 8 0 109 0 14]
#[0 0 38 0 3]
#[0 0 42 0 3]
#[0 0 22 0 25]
#[0 0 6 0 25]
)</body>
</methods>

<class>
<name>StstURLScanner</name>
<environment>Roots.Distributed</environment>
<super>Refactory.SmaCC.SmaCCScanner</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>SmaCC Generated Scanner/Parser</category>
<attributes>
<package>Roots-Distributed-Stst</package>
</attributes>
</class>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>Roots.Distributed.StstURLScanner class</class-id> <category>generated-comments</category>

<body package="Roots-Distributed-Stst" selector="scannerDefinitionComment">scannerDefinitionComment

	"&lt;whitespace&gt; : \s+ ;
&lt;LETTER&gt; : [a-zA-Z] ;
&lt;DIGIT&gt; : \d ;
&lt;NUMBER&gt; : &lt;DIGIT&gt;+ ;
&lt;IP_ADDRESS&gt; : (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) ;
&lt;IDENTIFIER&gt; : &lt;LETTER&gt; ( \- | &lt;LETTER&gt; | &lt;DIGIT&gt; )* ;
&lt;HOST_NAME&gt; : &lt;IDENTIFIER&gt; ( \. &lt;IDENTIFIER&gt; )* ;"</body>
</methods>

<!-- -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -   -->


<methods>
<class-id>Roots.Distributed.StstURLScanner</class-id> <category>generated-scanner</category>

<body package="Roots-Distributed-Stst" selector="scan1">scan1
	self step.
	(currentCharacter between: $3 and: $9) ifTrue: [^self scan14].
	(currentCharacter between: $0 and: $1) 
		ifTrue: 
			[self step.
			currentCharacter isDigit ifTrue: [^self scan14].
			currentCharacter == $. ifTrue: [^self scan3].
			^self reportLastMatch].
	currentCharacter == $2 
		ifTrue: 
			[self step.
			(currentCharacter between: $0 and: $4) ifTrue: [^self scan14].
			(currentCharacter between: $6 and: $9) ifTrue: [^self scan2].
			currentCharacter == $. ifTrue: [^self scan3].
			currentCharacter == $5 
				ifTrue: 
					[self step.
					(currentCharacter between: $0 and: $5) ifTrue: [^self scan2].
					currentCharacter == $. ifTrue: [^self scan3].
					^self reportLastMatch]].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan10">scan10
	self recordMatch: #(6).
	self step.
	currentCharacter isDigit 
		ifTrue: 
			[
			[self recordMatch: #(6).
			self step.
			currentCharacter isDigit] 
					whileTrue.
			^self reportLastMatch].
	currentCharacter == $. ifTrue: [^self scan1].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan11">scan11
	self recordMatch: #(6).
	self step.
	currentCharacter isDigit ifTrue: [^self scan10].
	currentCharacter == $. ifTrue: [^self scan1].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan12">scan12
	self recordMatch: #(7).
	self step.
	currentCharacter isDigit ifTrue: [^self recordAndReportMatch: #(7)].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan13">scan13
	self step.
	currentCharacter isDigit ifTrue: [^self scan4].
	currentCharacter == $. ifTrue: [^self scan5].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan14">scan14
	self step.
	currentCharacter isDigit ifTrue: [^self scan2].
	currentCharacter == $. ifTrue: [^self scan3].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan15">scan15
	self recordMatch: #(6).
	self step.
	(currentCharacter between: $0 and: $5) ifTrue: [^self scan10].
	(currentCharacter between: $6 and: $9) 
		ifTrue: 
			[
			[self recordMatch: #(6).
			self step.
			currentCharacter isDigit] 
					whileTrue.
			^self reportLastMatch].
	currentCharacter == $. ifTrue: [^self scan1].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan2">scan2
	self step.
	currentCharacter == $. ifTrue: [^self scan3].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan3">scan3
	self step.
	(currentCharacter between: $3 and: $9) ifTrue: [^self scan13].
	(currentCharacter between: $0 and: $1) 
		ifTrue: 
			[self step.
			currentCharacter isDigit ifTrue: [^self scan13].
			currentCharacter == $. ifTrue: [^self scan5].
			^self reportLastMatch].
	currentCharacter == $2 
		ifTrue: 
			[self step.
			(currentCharacter between: $0 and: $4) ifTrue: [^self scan13].
			(currentCharacter between: $6 and: $9) ifTrue: [^self scan4].
			currentCharacter == $. ifTrue: [^self scan5].
			currentCharacter == $5 
				ifTrue: 
					[self step.
					(currentCharacter between: $0 and: $5) ifTrue: [^self scan4].
					currentCharacter == $. ifTrue: [^self scan5].
					^self reportLastMatch]].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan4">scan4
	self step.
	currentCharacter == $. ifTrue: [^self scan5].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan5">scan5
	self step.
	(currentCharacter between: $3 and: $9) ifTrue: [^self scan12].
	(currentCharacter between: $0 and: $1) 
		ifTrue: 
			[self recordMatch: #(7).
			self step.
			currentCharacter isDigit ifTrue: [^self scan12].
			^self reportLastMatch].
	currentCharacter == $2 
		ifTrue: 
			[self recordMatch: #(7).
			self step.
			(currentCharacter between: $0 and: $4) ifTrue: [^self scan12].
			(currentCharacter between: $6 and: $9) 
				ifTrue: [^self recordAndReportMatch: #(7)].
			currentCharacter == $5 
				ifTrue: 
					[self recordMatch: #(7).
					self step.
					(currentCharacter between: $0 and: $5) 
						ifTrue: [^self recordAndReportMatch: #(7)].
					^self reportLastMatch]].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan6">scan6
	self step.
	currentCharacter isAlphabetic 
		ifTrue: 
			[
			[self recordMatch: #(9).
			self step.
			currentCharacter isAlphaNumeric or: [currentCharacter == $-]] 
					whileTrue.
			currentCharacter == $. ifTrue: [^self scan6]].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan7">scan7
	self recordMatch: #(6).
	self step.
	currentCharacter isDigit ifTrue: [^self scan11].
	currentCharacter == $. ifTrue: [^self scan1].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan8">scan8
	self recordMatch: #(6).
	self step.
	(currentCharacter between: $0 and: $4) ifTrue: [^self scan11].
	(currentCharacter between: $6 and: $9) ifTrue: [^self scan10].
	currentCharacter == $. ifTrue: [^self scan1].
	currentCharacter == $5 ifTrue: [^self scan15].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scan9">scan9
	
	[self recordMatch: #(8 9).
	self step.
	currentCharacter isAlphaNumeric or: [currentCharacter == $-]] 
			whileTrue.
	currentCharacter == $. ifTrue: [^self scan6].
	^self reportLastMatch</body>

<body package="Roots-Distributed-Stst" selector="scanForToken">scanForToken
	self step.
	((currentCharacter between: $A and: $Z) or: 
			[(currentCharacter between: $a and: $r) 
				or: [currentCharacter between: $t and: $z]]) 
		ifTrue: [^self scan9].
	(currentCharacter between: $3 and: $9) ifTrue: [^self scan11].
	((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].
	(currentCharacter between: $0 and: $1) ifTrue: [^self scan7].
	currentCharacter == $/ ifTrue: [^self recordAndReportMatch: #(3)].
	currentCharacter == $2 ifTrue: [^self scan8].
	currentCharacter == $: ifTrue: [^self recordAndReportMatch: #(4)].
	currentCharacter == $@ ifTrue: [^self recordAndReportMatch: #(2)].
	currentCharacter == $s 
		ifTrue: 
			[self recordMatch: #(8 9).
			self step.
			(currentCharacter isDigit or: 
					[currentCharacter == $- or: 
							[(currentCharacter between: $A and: $Z) or: 
									[(currentCharacter between: $a and: $s) 
										or: [currentCharacter between: $u and: $z]]]]) 
				ifTrue: [^self scan9].
			currentCharacter == $. ifTrue: [^self scan6].
			currentCharacter == $t 
				ifTrue: 
					[self recordMatch: #(8 9).
					self step.
					(currentCharacter isDigit or: 
							[currentCharacter == $- or: 
									[(currentCharacter between: $A and: $Z) or: 
											[(currentCharacter between: $a and: $r) 
												or: [currentCharacter between: $t and: $z]]]]) 
						ifTrue: [^self scan9].
					currentCharacter == $. ifTrue: [^self scan6].
					currentCharacter == $s 
						ifTrue: 
							[self recordMatch: #(8 9).
							self step.
							(currentCharacter isDigit or: 
									[currentCharacter == $- or: 
											[(currentCharacter between: $A and: $Z) or: 
													[(currentCharacter between: $a and: $s) 
														or: [currentCharacter between: $u and: $z]]]]) 
								ifTrue: [^self scan9].
							currentCharacter == $. ifTrue: [^self scan6].
							currentCharacter == $t 
								ifTrue: 
									[self recordMatch: #(8 9).
									self step.
									(currentCharacter isAlphaNumeric or: [currentCharacter == $-]) 
										ifTrue: [^self scan9].
									currentCharacter == $. ifTrue: [^self scan6].
									currentCharacter == $: 
										ifTrue: 
											[self step.
											currentCharacter == $/ 
												ifTrue: 
													[self step.
													currentCharacter == $/ ifTrue: [^self recordAndReportMatch: #(1)].
													^self reportLastMatch]].
									^self reportLastMatch]].
					^self reportLastMatch]].
	^self reportLastMatch</body>
</methods>

<methods>
<class-id>Roots.Distributed.StstURLScanner</class-id> <category>generated-tokens</category>

<body package="Roots-Distributed-Stst" selector="emptySymbolTokenId">emptySymbolTokenId
	^25</body>

<body package="Roots-Distributed-Stst" selector="errorTokenId">errorTokenId
	^26</body>
</methods>

</st-source>