Add more nodes (can parse stdlib)

This commit is contained in:
2022-03-20 20:41:05 +01:00
parent d5785629ea
commit b22d0d75af
7 changed files with 499 additions and 146 deletions

View File

@@ -0,0 +1,40 @@
Class {
#name : #CarpMapNode,
#superclass : #CarpExpressionNode,
#instVars : [
'pairs'
],
#category : #Carp
}
{ #category : #generated }
CarpMapNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitMap: self
]
{ #category : #generated }
CarpMapNode >> compositeNodeVariables [
^ #( #pairs )
]
{ #category : #'generated-initialize-release' }
CarpMapNode >> initialize [
super initialize.
pairs := OrderedCollection new: 2.
]
{ #category : #generated }
CarpMapNode >> pairs [
^ pairs
]
{ #category : #generated }
CarpMapNode >> pairs: anOrderedCollection [
self setParents: self pairs to: nil.
pairs := anOrderedCollection.
self setParents: self pairs to: self
]

View File

@@ -0,0 +1,49 @@
Class {
#name : #CarpPairNode,
#superclass : #CarpExpressionNode,
#instVars : [
'key',
'value'
],
#category : #Carp
}
{ #category : #generated }
CarpPairNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitPair: self
]
{ #category : #generated }
CarpPairNode >> key [
^ key
]
{ #category : #generated }
CarpPairNode >> key: aCarpExpressionNode [
self key notNil ifTrue: [ self key parent: nil ].
key := aCarpExpressionNode.
self key notNil ifTrue: [ self key parent: self ]
]
{ #category : #generated }
CarpPairNode >> nodeVariables [
^ #( #key #value )
]
{ #category : #generated }
CarpPairNode >> value [
^ value
]
{ #category : #generated }
CarpPairNode >> value: aCarpExpressionNode [
self value notNil ifTrue: [ self value parent: nil ].
value := aCarpExpressionNode.
self value notNil ifTrue: [ self value parent: self ]
]

View File

@@ -6,7 +6,7 @@ Class {
{ #category : #'generated-accessing' }
CarpParser class >> cacheId [
^'2022-03-20T19:54:13.067877+01:00'
^'2022-03-20T20:34:27.408287+01:00'
]
{ #category : #generated }
@@ -20,7 +20,7 @@ CarpParser class >> definitionComment [
: \\ (. | u[0-9A-F]{4,4} | o[0-7]{3,3} | newline | return | space | tab | space | backspace | formfeed) # other character types
;
<string_literal>
: (\"" ([^\""\\] | <escape>)* \"")
: \"" ([^\""\\] | <escape>)* \""
;
<open_paren>
: \(
@@ -61,9 +61,12 @@ default <variable>
<decimal_integer>
: [0-9]+
;
<sign>
: \-
;
<decimal>
: (<decimal_integer> \. <decimal_integer> f?)
| (<decimal_integer> (f|l|b)?)
: <sign>? (<decimal_integer> \. <decimal_integer> f?)
| <sign>? (<decimal_integer> (f|l|b)?)
;
<numeric_literal>
: <decimal> | <hex_integer> | <binary_integer>
@@ -88,8 +91,12 @@ Expression
: Literal
| Deref
| Ref
| RefCall
| Unquote
;
RefCall
: ""~"" Expression 'value' {{}}
;
Unquote
: (""%"" | ""%@"") Expression 'value' {{}}
;
@@ -100,7 +107,20 @@ Deref
: ""@"" Expression 'value' {{}}
;
Literal
: String | List | Array | Symbol | Quote | Number | Character
: String | List | Array | Symbol | Quote | Number | Character | Pattern | Map
;
Map
: ""{"" MapPairs ""}"" {{}}
;
MapPairs
:
| MapPairs MapPair 'pair'
;
MapPair
: Expression 'key' Expression 'value' {{Pair}}
;
Pattern
: ""#"" <string_literal> 'value' {{}}
;
Character
: <character> 'value' {{}}
@@ -135,35 +155,44 @@ String
{ #category : #generated }
CarpParser class >> reduceTable [
^#(
#(20 0 #reduceActionForExpressions1: 1258497 false)
#(19 1 #reduceActionForStart1: 1227777 false)
#(34 1 #reduceActionForString1: 1988609 false)
#(31 1 #reduceActionForVariable1: 1811457 false)
#(32 1 #reduceActionForModuleOrType2: 1851394 false)
#(27 1 #reduceActionForNumber1: 1620993 false)
#(26 1 #reduceActionForCharacter1: 1579009 false)
#(20 2 #reduceActionForExpressions2: 1258498 false)
#(21 1 #liftFirstValue: 1316868 false)
#(21 1 #liftFirstValue: 1316867 false)
#(21 1 #liftFirstValue: 1316866 false)
#(21 1 #liftFirstValue: 1316865 false)
#(25 1 #liftFirstValue: 1502215 false)
#(25 1 #liftFirstValue: 1502214 false)
#(25 1 #liftFirstValue: 1502211 false)
#(25 1 #liftFirstValue: 1502213 false)
#(25 1 #liftFirstValue: 1502212 false)
#(30 1 #liftFirstValue: 1773570 false)
#(30 1 #liftFirstValue: 1773569 false)
#(25 1 #liftFirstValue: 1502210 false)
#(25 1 #liftFirstValue: 1502209 false)
#(22 2 #reduceActionForUnquote1: 1370113 false)
#(22 2 #reduceActionForUnquote1: 1370114 false)
#(23 2 #reduceActionForRef1: 1422337 false)
#(24 2 #reduceActionForDeref1: 1461249 false)
#(29 2 #reduceActionForQuote1: 1728513 false)
#(33 3 #reduceActionForList1: 1932289 false)
#(32 3 #reduceActionForModuleOrType1: 1851393 false)
#(28 3 #reduceActionForArray1: 1667073 false)
#(24 0 #reduceActionForExpressions1: 1289217 false)
#(23 1 #reduceActionForStart1: 1258497 false)
#(32 0 #reduceActionForExpressions1: 1712129 false)
#(43 1 #reduceActionForString1: 2274305 false)
#(40 1 #reduceActionForVariable1: 2097153 false)
#(41 1 #reduceActionForModuleOrType2: 2137090 false)
#(36 1 #reduceActionForNumber1: 1906689 false)
#(35 1 #reduceActionForCharacter1: 1864705 false)
#(24 2 #reduceActionForExpressions2: 1289218 false)
#(25 1 #liftFirstValue: 1347588 false)
#(25 1 #liftFirstValue: 1347589 false)
#(25 1 #liftFirstValue: 1347587 false)
#(25 1 #liftFirstValue: 1347586 false)
#(25 1 #liftFirstValue: 1347585 false)
#(30 1 #liftFirstValue: 1587209 false)
#(30 1 #liftFirstValue: 1587208 false)
#(30 1 #liftFirstValue: 1587207 false)
#(30 1 #liftFirstValue: 1587206 false)
#(30 1 #liftFirstValue: 1587203 false)
#(30 1 #liftFirstValue: 1587205 false)
#(30 1 #liftFirstValue: 1587204 false)
#(39 1 #liftFirstValue: 2059266 false)
#(39 1 #liftFirstValue: 2059265 false)
#(30 1 #liftFirstValue: 1587202 false)
#(30 1 #liftFirstValue: 1587201 false)
#(34 2 #reduceActionForPattern1: 1815553 false)
#(27 2 #reduceActionForUnquote1: 1455105 false)
#(27 2 #reduceActionForUnquote1: 1455106 false)
#(28 2 #reduceActionForRef1: 1507329 false)
#(29 2 #reduceActionForDeref1: 1546241 false)
#(26 2 #reduceActionForRefCall1: 1412097 false)
#(38 2 #reduceActionForQuote1: 2014209 false)
#(31 3 #reduceActionForMap1: 1679361 false)
#(32 2 #reduceActionForExpressions2: 1712130 false)
#(42 3 #reduceActionForList1: 2217985 false)
#(41 3 #reduceActionForModuleOrType1: 2137089 false)
#(37 3 #reduceActionForArray1: 1952769 false)
#(33 2 #reduceActionForMapPair1: 1755137 false)
).
]
@@ -181,12 +210,13 @@ CarpParser class >> startingStateForStart [
{ #category : #generated }
CarpParser class >> symbolNames [
^ #( '"%"' '"%@"' '"&"' '"@"' '<string_literal>' '<open_paren>'
'<close_paren>' '<quote>' '<variable>' '<module>' '<dot>'
'<open_bracket>' '<close_bracket>' '<numeric_literal>'
'<comment>' '<whitespace>' '<character>' 'B e g i n' 'Start'
'Expressions' 'Expression' 'Unquote' 'Ref' 'Deref' 'Literal'
'Character' 'Number' 'Array' 'Quote' 'Symbol' 'Variable'
^ #( '"#"' '"%"' '"%@"' '"&"' '"@"' '"{"' '"}"' '"~"' '<string_literal>'
'<open_paren>' '<close_paren>' '<quote>' '<variable>'
'<module>' '<dot>' '<open_bracket>' '<close_bracket>'
'<numeric_literal>' '<comment>' '<whitespace>' '<character>'
'B e g i n' 'Start' 'Expressions' 'Expression' 'RefCall'
'Unquote' 'Ref' 'Deref' 'Literal' 'Map' 'MapPairs' 'MapPair'
'Pattern' 'Character' 'Number' 'Array' 'Quote' 'Symbol' 'Variable'
'ModuleOrType' 'List' 'String' 'E O F' 'error' )
]
@@ -196,9 +226,11 @@ CarpParser class >> symbolTypes [
^ #( #SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken
#SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken
#SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken
#SmaCCToken #SmaCCToken #CarpStartNode #CarpStartNode
#OrderedCollection #CarpExpressionNode #CarpUnquoteNode
#SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken
#SmaCCToken #CarpStartNode #CarpStartNode #OrderedCollection
#CarpExpressionNode #CarpRefCallNode #CarpUnquoteNode
#CarpRefNode #CarpDerefNode #CarpExpressionNode
#CarpMapNode #OrderedCollection #CarpPairNode #CarpPatternNode
#CarpCharacterNode #CarpNumberNode #CarpArrayNode #CarpQuoteNode
#CarpExpressionNode #CarpVariableNode #CarpModuleOrTypeNode
#CarpListNode #CarpStringNode #SmaCCToken #SmaCCErrorNode )
@@ -207,46 +239,59 @@ CarpParser class >> symbolTypes [
{ #category : #generated }
CarpParser class >> transitionTable [
^#(
#[1 0 6 0 1 0 6 0 2 0 6 0 3 0 6 0 4 0 6 0 5 0 6 0 6 0 6 0 8 0 6 0 9 0 6 0 10 0 6 0 12 0 6 0 14 0 6 0 17 0 9 0 19 0 13 0 20 0 6 0 35]
#[0 0 0 0 35]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 14 0 61 0 17 0 65 0 21 0 65 0 22 0 65 0 23 0 65 0 24 0 65 0 25 0 65 0 26 0 65 0 27 0 65 0 28 0 65 0 29 0 65 0 30 0 65 0 31 0 65 0 32 0 65 0 33 0 65 0 34 0 10 0 35]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 14 0 61 0 17 0 121 0 21 0 121 0 22 0 121 0 23 0 121 0 24 0 121 0 25 0 121 0 26 0 121 0 27 0 121 0 28 0 121 0 29 0 121 0 30 0 121 0 31 0 121 0 32 0 121 0 33 0 121 0 34]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 14 0 61 0 17 0 125 0 21 0 125 0 22 0 125 0 23 0 125 0 24 0 125 0 25 0 125 0 26 0 125 0 27 0 125 0 28 0 125 0 29 0 125 0 30 0 125 0 31 0 125 0 32 0 125 0 33 0 125 0 34]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 14 0 61 0 17 0 129 0 21 0 129 0 22 0 129 0 23 0 129 0 24 0 129 0 25 0 129 0 26 0 129 0 27 0 129 0 28 0 129 0 29 0 129 0 30 0 129 0 31 0 129 0 32 0 129 0 33 0 129 0 34]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 14 0 61 0 17 0 133 0 21 0 133 0 22 0 133 0 23 0 133 0 24 0 133 0 25 0 133 0 26 0 133 0 27 0 133 0 28 0 133 0 29 0 133 0 30 0 133 0 31 0 133 0 32 0 133 0 33 0 133 0 34]
#[0 0 14 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[1 0 6 0 1 0 6 0 2 0 6 0 3 0 6 0 4 0 6 0 5 0 6 0 6 0 6 0 7 0 6 0 8 0 6 0 9 0 6 0 10 0 6 0 12 0 6 0 14 0 6 0 17 0 137 0 20]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 14 0 61 0 17 0 141 0 21 0 141 0 22 0 141 0 23 0 141 0 24 0 141 0 25 0 141 0 26 0 141 0 27 0 141 0 28 0 141 0 29 0 141 0 30 0 141 0 31 0 141 0 32 0 141 0 33 0 141 0 34]
#[0 0 18 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[1 0 22 0 1 0 22 0 2 0 22 0 3 0 22 0 4 0 22 0 5 0 22 0 6 0 22 0 7 0 22 0 8 0 22 0 9 0 22 0 10 0 145 0 11 0 22 0 12 0 22 0 13 0 22 0 14 0 22 0 17 0 22 0 35]
#[1 0 6 0 1 0 6 0 2 0 6 0 3 0 6 0 4 0 6 0 5 0 6 0 6 0 6 0 8 0 6 0 9 0 6 0 10 0 6 0 12 0 6 0 13 0 6 0 14 0 6 0 17 0 149 0 20]
#[0 0 26 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 30 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 34 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 38 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 42 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 46 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 50 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 54 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 58 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 62 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 66 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 70 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 74 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 78 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 82 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 86 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 90 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 94 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 98 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 102 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 153 0 7 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 14 0 61 0 17 0 65 0 21 0 65 0 22 0 65 0 23 0 65 0 24 0 65 0 25 0 65 0 26 0 65 0 27 0 65 0 28 0 65 0 29 0 65 0 30 0 65 0 31 0 65 0 32 0 65 0 33 0 65 0 34]
#[0 0 106 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[1 0 45 0 9 0 49 0 10 0 157 0 30 0 157 0 31 0 157 0 32]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 161 0 13 0 57 0 14 0 61 0 17 0 65 0 21 0 65 0 22 0 65 0 23 0 65 0 24 0 65 0 25 0 65 0 26 0 65 0 27 0 65 0 28 0 65 0 29 0 65 0 30 0 65 0 31 0 65 0 32 0 65 0 33 0 65 0 34]
#[0 0 110 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 114 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[0 0 118 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 17 0 35]
#[1 0 6 0 1 0 6 0 2 0 6 0 3 0 6 0 4 0 6 0 5 0 6 0 6 0 6 0 8 0 6 0 9 0 6 0 10 0 6 0 12 0 6 0 13 0 6 0 14 0 6 0 16 0 6 0 18 0 6 0 21 0 9 0 23 0 13 0 24 0 6 0 44]
#[0 0 0 0 44]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 77 0 25 0 77 0 26 0 77 0 27 0 77 0 28 0 77 0 29 0 77 0 30 0 77 0 31 0 77 0 34 0 77 0 35 0 77 0 36 0 77 0 37 0 77 0 38 0 77 0 39 0 77 0 40 0 77 0 41 0 77 0 42 0 77 0 43 0 10 0 44]
#[0 0 145 0 9]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 149 0 25 0 149 0 26 0 149 0 27 0 149 0 28 0 149 0 29 0 149 0 30 0 149 0 31 0 149 0 34 0 149 0 35 0 149 0 36 0 149 0 37 0 149 0 38 0 149 0 39 0 149 0 40 0 149 0 41 0 149 0 42 0 149 0 43]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 153 0 25 0 153 0 26 0 153 0 27 0 153 0 28 0 153 0 29 0 153 0 30 0 153 0 31 0 153 0 34 0 153 0 35 0 153 0 36 0 153 0 37 0 153 0 38 0 153 0 39 0 153 0 40 0 153 0 41 0 153 0 42 0 153 0 43]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 157 0 25 0 157 0 26 0 157 0 27 0 157 0 28 0 157 0 29 0 157 0 30 0 157 0 31 0 157 0 34 0 157 0 35 0 157 0 36 0 157 0 37 0 157 0 38 0 157 0 39 0 157 0 40 0 157 0 41 0 157 0 42 0 157 0 43]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 161 0 25 0 161 0 26 0 161 0 27 0 161 0 28 0 161 0 29 0 161 0 30 0 161 0 31 0 161 0 34 0 161 0 35 0 161 0 36 0 161 0 37 0 161 0 38 0 161 0 39 0 161 0 40 0 161 0 41 0 161 0 42 0 161 0 43]
#[1 0 14 0 1 0 14 0 2 0 14 0 3 0 14 0 4 0 14 0 5 0 14 0 6 0 14 0 7 0 14 0 8 0 14 0 9 0 14 0 10 0 14 0 12 0 14 0 13 0 14 0 14 0 14 0 16 0 14 0 18 0 14 0 21 0 165 0 32]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 169 0 25 0 169 0 26 0 169 0 27 0 169 0 28 0 169 0 29 0 169 0 30 0 169 0 31 0 169 0 34 0 169 0 35 0 169 0 36 0 169 0 37 0 169 0 38 0 169 0 39 0 169 0 40 0 169 0 41 0 169 0 42 0 169 0 43]
#[0 0 18 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[1 0 6 0 1 0 6 0 2 0 6 0 3 0 6 0 4 0 6 0 5 0 6 0 6 0 6 0 8 0 6 0 9 0 6 0 10 0 6 0 11 0 6 0 12 0 6 0 13 0 6 0 14 0 6 0 16 0 6 0 18 0 6 0 21 0 173 0 24]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 177 0 25 0 177 0 26 0 177 0 27 0 177 0 28 0 177 0 29 0 177 0 30 0 177 0 31 0 177 0 34 0 177 0 35 0 177 0 36 0 177 0 37 0 177 0 38 0 177 0 39 0 177 0 40 0 177 0 41 0 177 0 42 0 177 0 43]
#[0 0 22 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[1 0 26 0 1 0 26 0 2 0 26 0 3 0 26 0 4 0 26 0 5 0 26 0 6 0 26 0 7 0 26 0 8 0 26 0 9 0 26 0 10 0 26 0 11 0 26 0 12 0 26 0 13 0 26 0 14 0 181 0 15 0 26 0 16 0 26 0 17 0 26 0 18 0 26 0 21 0 26 0 44]
#[1 0 6 0 1 0 6 0 2 0 6 0 3 0 6 0 4 0 6 0 5 0 6 0 6 0 6 0 8 0 6 0 9 0 6 0 10 0 6 0 12 0 6 0 13 0 6 0 14 0 6 0 16 0 6 0 17 0 6 0 18 0 6 0 21 0 185 0 24]
#[0 0 30 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 34 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 38 0 1 0 2 0 3 0 4 0 5 0 6 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 42 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 46 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 50 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 54 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 58 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 62 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 66 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 70 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 74 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 78 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 82 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 86 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 90 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 94 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 98 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 102 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 106 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 110 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 114 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 118 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 122 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 189 0 7 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 193 0 25 0 193 0 26 0 193 0 27 0 193 0 28 0 193 0 29 0 193 0 30 0 193 0 31 0 197 0 33 0 193 0 34 0 193 0 35 0 193 0 36 0 193 0 37 0 193 0 38 0 193 0 39 0 193 0 40 0 193 0 41 0 193 0 42 0 193 0 43]
#[0 0 126 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 201 0 11 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 77 0 25 0 77 0 26 0 77 0 27 0 77 0 28 0 77 0 29 0 77 0 30 0 77 0 31 0 77 0 34 0 77 0 35 0 77 0 36 0 77 0 37 0 77 0 38 0 77 0 39 0 77 0 40 0 77 0 41 0 77 0 42 0 77 0 43]
#[0 0 130 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[1 0 57 0 13 0 61 0 14 0 205 0 39 0 205 0 40 0 205 0 41]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 209 0 17 0 69 0 18 0 73 0 21 0 77 0 25 0 77 0 26 0 77 0 27 0 77 0 28 0 77 0 29 0 77 0 30 0 77 0 31 0 77 0 34 0 77 0 35 0 77 0 36 0 77 0 37 0 77 0 38 0 77 0 39 0 77 0 40 0 77 0 41 0 77 0 42 0 77 0 43]
#[0 0 134 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[1 0 17 0 1 0 21 0 2 0 25 0 3 0 29 0 4 0 33 0 5 0 37 0 6 0 41 0 8 0 45 0 9 0 49 0 10 0 53 0 12 0 57 0 13 0 61 0 14 0 65 0 16 0 69 0 18 0 73 0 21 0 213 0 25 0 213 0 26 0 213 0 27 0 213 0 28 0 213 0 29 0 213 0 30 0 213 0 31 0 213 0 34 0 213 0 35 0 213 0 36 0 213 0 37 0 213 0 38 0 213 0 39 0 213 0 40 0 213 0 41 0 213 0 42 0 213 0 43]
#[0 0 138 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 16 0 18 0 21]
#[0 0 142 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 146 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 150 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 18 0 21 0 44]
#[0 0 154 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 12 0 13 0 14 0 16 0 18 0 21]
).
]
@@ -303,6 +348,25 @@ CarpParser >> reduceActionForList1: nodes [
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForMap1: nodes [
| result |
result := CarpMapNode new.
result addNodes: (nodes at: 2) to: result pairs.
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForMapPair1: nodes [
| result |
result := CarpPairNode new.
result key: (nodes at: 1).
result value: (nodes at: 2).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForModuleOrType1: nodes [
@@ -330,6 +394,15 @@ CarpParser >> reduceActionForNumber1: nodes [
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForPattern1: nodes [
| result |
result := CarpPatternNode new.
result value: (nodes at: 2).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForQuote1: nodes [
@@ -348,6 +421,15 @@ CarpParser >> reduceActionForRef1: nodes [
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForRefCall1: nodes [
| result |
result := CarpRefCallNode new.
result value: (nodes at: 2).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForStart1: nodes [

View File

@@ -0,0 +1,32 @@
Class {
#name : #CarpPatternNode,
#superclass : #CarpExpressionNode,
#instVars : [
'value'
],
#category : #Carp
}
{ #category : #generated }
CarpPatternNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitPattern: self
]
{ #category : #generated }
CarpPatternNode >> tokenVariables [
^ #( #value )
]
{ #category : #generated }
CarpPatternNode >> value [
^ value
]
{ #category : #generated }
CarpPatternNode >> value: aSmaCCToken [
value := aSmaCCToken
]

View File

@@ -0,0 +1,34 @@
Class {
#name : #CarpRefCallNode,
#superclass : #CarpExpressionNode,
#instVars : [
'value'
],
#category : #Carp
}
{ #category : #generated }
CarpRefCallNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitRefCall: self
]
{ #category : #generated }
CarpRefCallNode >> nodeVariables [
^ #( #value )
]
{ #category : #generated }
CarpRefCallNode >> value [
^ value
]
{ #category : #generated }
CarpRefCallNode >> value: aCarpExpressionNode [
self value notNil ifTrue: [ self value parent: nil ].
value := aCarpExpressionNode.
self value notNil ifTrue: [ self value parent: self ]
]

View File

@@ -7,13 +7,13 @@ Class {
{ #category : #generated }
CarpScanner >> emptySymbolTokenId [
^ 35
^ 44
]
{ #category : #generated }
CarpScanner >> errorTokenId [
^ 36
^ 45
]
{ #category : #generated }
@@ -21,7 +21,7 @@ CarpScanner >> scan1 [
[
self step.
currentCharacter == $" ifTrue: [ ^ self recordAndReportMatch: #( 5 ) ].
currentCharacter == $" ifTrue: [ ^ self recordAndReportMatch: #( 9 ) ].
currentCharacter == $\ ifTrue: [
self step.
^ self scan1 ].
@@ -31,14 +31,27 @@ CarpScanner >> scan1 [
{ #category : #generated }
CarpScanner >> scan2 [
self recordMatch: #( 13 ).
self step.
currentCharacter isDigit ifTrue: [
currentCharacter isDigit ifTrue: [ ^ self scan3 ].
(currentCharacter isLowercase or: [
currentCharacter isUppercase or: [
('!$' includes: currentCharacter) or: [
(currentCharacter between: $* and: $+) or: [
('-/:' includes: currentCharacter) or: [
(currentCharacter between: $< and: $?) or: [
currentCharacter == $_ ] ] ] ] ] ]) ifTrue: [
[
self recordMatch: #( 14 ).
self recordMatch: #( 13 ).
self step.
currentCharacter == $f ifTrue: [
^ self recordAndReportMatch: #( 14 ) ].
currentCharacter isDigit ] whileTrue ].
currentCharacter isLowercase or: [
currentCharacter isUppercase or: [
currentCharacter isDigit or: [
('!$' includes: currentCharacter) or: [
(currentCharacter between: $* and: $+) or: [
('-/:' includes: currentCharacter) or: [
(currentCharacter between: $< and: $?) or: [
currentCharacter == $_ ] ] ] ] ] ] ] ] whileTrue ].
^ self reportLastMatch
]
@@ -46,28 +59,94 @@ CarpScanner >> scan2 [
CarpScanner >> scan3 [
[
self recordMatch: #( 14 ).
self recordMatch: #( 13 18 ).
self step.
currentCharacter == $. ifTrue: [ ^ self scan2 ].
currentCharacter == $. ifTrue: [ ^ self scan4 ].
currentCharacter isDigit ] whileTrue.
('bfl' includes: currentCharacter) ifTrue: [
^ self recordAndReportMatch: #( 14 ) ].
self recordMatch: #( 13 18 ).
self step.
(currentCharacter isLowercase or: [
currentCharacter isUppercase or: [
currentCharacter isDigit or: [
('!$' includes: currentCharacter) or: [
(currentCharacter between: $* and: $+) or: [
('-/:' includes: currentCharacter) or: [
(currentCharacter between: $< and: $?) or: [
currentCharacter == $_ ] ] ] ] ] ] ]) ifTrue: [
[
self recordMatch: #( 13 ).
self step.
currentCharacter isLowercase or: [
currentCharacter isUppercase or: [
currentCharacter isDigit or: [
('!$' includes: currentCharacter) or: [
(currentCharacter between: $* and: $+) or: [
('-/:' includes: currentCharacter) or: [
(currentCharacter between: $< and: $?) or: [
currentCharacter == $_ ] ] ] ] ] ] ] ] whileTrue ].
^ self reportLastMatch ].
(currentCharacter isUppercase or: [
currentCharacter isLowercase or: [
('!$' includes: currentCharacter) or: [
(currentCharacter between: $* and: $+) or: [
('-/:' includes: currentCharacter) or: [
(currentCharacter between: $< and: $?) or: [
currentCharacter == $_ ] ] ] ] ] ]) ifTrue: [
[
self recordMatch: #( 13 ).
self step.
currentCharacter isLowercase or: [
currentCharacter isUppercase or: [
currentCharacter isDigit or: [
('!$' includes: currentCharacter) or: [
(currentCharacter between: $* and: $+) or: [
('-/:' includes: currentCharacter) or: [
(currentCharacter between: $< and: $?) or: [
currentCharacter == $_ ] ] ] ] ] ] ] ] whileTrue ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scan4 [
(self scanForString: 'ac') ifTrue: [ ^ self scan5 ].
self step.
currentCharacter isDigit ifTrue: [
[
self recordMatch: #( 18 ).
self step.
currentCharacter == $f ifTrue: [
^ self recordAndReportMatch: #( 18 ) ].
currentCharacter isDigit ] whileTrue ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scan5 [
[
self recordMatch: #( 18 ).
self step.
currentCharacter == $. ifTrue: [ ^ self scan4 ].
currentCharacter isDigit ] whileTrue.
('bfl' includes: currentCharacter) ifTrue: [
^ self recordAndReportMatch: #( 18 ) ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scan6 [
(self scanForString: 'ac') ifTrue: [ ^ self scan7 ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scan7 [
self step.
currentCharacter == $e ifTrue: [
^ self recordAndReportMatch: #( 17 ) ].
^ self recordAndReportMatch: #( 21 ) ].
^ self reportLastMatch
]
@@ -76,20 +155,10 @@ CarpScanner >> scanForToken [
self step.
currentCharacter == $" ifTrue: [ ^ self scan1 ].
currentCharacter == $# ifTrue: [ ^ self recordAndReportMatch: #( 1 ) ].
currentCharacter == $% ifTrue: [ ^ self scanForTokenX7 ].
currentCharacter == $& ifTrue: [ ^ self recordAndReportMatch: #( 3 ) ].
currentCharacter == $( ifTrue: [ ^ self recordAndReportMatch: #( 6 ) ].
currentCharacter == $) ifTrue: [ ^ self recordAndReportMatch: #( 7 ) ].
currentCharacter == $, ifTrue: [
^ self recordAndReportMatch: #( 15 ) ].
currentCharacter == $. ifTrue: [
^ self recordAndReportMatch: #( 11 ) ].
currentCharacter == $0 ifTrue: [ ^ self scanForTokenX2 ].
currentCharacter == $; ifTrue: [ ^ self scanForTokenX5 ].
currentCharacter == $@ ifTrue: [ ^ self recordAndReportMatch: #( 4 ) ].
currentCharacter == $[ ifTrue: [
^ self recordAndReportMatch: #( 12 ) ].
^ self scanForTokenX8
currentCharacter == $& ifTrue: [ ^ self recordAndReportMatch: #( 4 ) ].
^ self scanForTokenX9
]
{ #category : #generated }
@@ -97,62 +166,62 @@ CarpScanner >> scanForTokenX1 [
self step.
currentCharacter == $b ifTrue: [
self recordMatch: #( 17 ).
self recordMatch: #( 21 ).
self step.
currentCharacter == $a ifTrue: [
(self scanForString: 'cksp') ifTrue: [ ^ self scan4 ] ].
(self scanForString: 'cksp') ifTrue: [ ^ self scan6 ] ].
^ self reportLastMatch ].
currentCharacter == $f ifTrue: [
self recordMatch: #( 17 ).
self recordMatch: #( 21 ).
self step.
currentCharacter == $o ifTrue: [
(self scanForString: 'rmfeed') ifTrue: [
^ self recordAndReportMatch: #( 17 ) ] ].
^ self recordAndReportMatch: #( 21 ) ] ].
^ self reportLastMatch ].
currentCharacter == $n ifTrue: [
self recordMatch: #( 17 ).
self recordMatch: #( 21 ).
self step.
currentCharacter == $e ifTrue: [
(self scanForString: 'wlin') ifTrue: [ ^ self scan5 ] ].
(self scanForString: 'wlin') ifTrue: [ ^ self scan7 ] ].
^ self reportLastMatch ].
currentCharacter == $o ifTrue: [
self recordMatch: #( 17 ).
self recordMatch: #( 21 ).
self step.
(currentCharacter between: $0 and: $7) ifTrue: [
self step.
(currentCharacter between: $0 and: $7) ifTrue: [
self step.
(currentCharacter between: $0 and: $7) ifTrue: [
^ self recordAndReportMatch: #( 17 ) ] ] ].
^ self recordAndReportMatch: #( 21 ) ] ] ].
^ self reportLastMatch ].
currentCharacter == $r ifTrue: [
self recordMatch: #( 17 ).
self recordMatch: #( 21 ).
self step.
currentCharacter == $e ifTrue: [
(self scanForString: 'turn') ifTrue: [
^ self recordAndReportMatch: #( 17 ) ] ].
^ self recordAndReportMatch: #( 21 ) ] ].
^ self reportLastMatch ].
currentCharacter == $s ifTrue: [
self recordMatch: #( 17 ).
self recordMatch: #( 21 ).
self step.
currentCharacter == $p ifTrue: [ ^ self scan4 ].
currentCharacter == $p ifTrue: [ ^ self scan6 ].
^ self reportLastMatch ].
currentCharacter == $t ifTrue: [
self recordMatch: #( 17 ).
self recordMatch: #( 21 ).
self step.
currentCharacter == $a ifTrue: [
self step.
currentCharacter == $b ifTrue: [
^ self recordAndReportMatch: #( 17 ) ] ].
^ self recordAndReportMatch: #( 21 ) ] ].
^ self reportLastMatch ].
currentCharacter == $u ifTrue: [ ^ self scanForTokenX1X1 ].
^ self recordAndReportMatch: #( 17 )
^ self recordAndReportMatch: #( 21 )
]
{ #category : #generated }
CarpScanner >> scanForTokenX1X1 [
self recordMatch: #( 17 ).
self recordMatch: #( 21 ).
self step.
(currentCharacter isDigit or: [ currentCharacter between: $A and: $F ])
ifTrue: [
@@ -165,32 +234,32 @@ CarpScanner >> scanForTokenX1X1 [
self step.
(currentCharacter isDigit or: [
currentCharacter between: $A and: $F ]) ifTrue: [
^ self recordAndReportMatch: #( 17 ) ] ] ] ].
^ self recordAndReportMatch: #( 21 ) ] ] ] ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scanForTokenX2 [
self recordMatch: #( 14 ).
self recordMatch: #( 18 ).
self step.
currentCharacter == $. ifTrue: [ ^ self scan2 ].
currentCharacter == $. ifTrue: [ ^ self scan4 ].
currentCharacter == $b ifTrue: [
self recordMatch: #( 14 ).
self recordMatch: #( 18 ).
self step.
(currentCharacter between: $0 and: $1) ifTrue: [
^ self recordAndReportMatch: #( 14 ) ].
^ self recordAndReportMatch: #( 18 ) ].
^ self reportLastMatch ].
currentCharacter == $x ifTrue: [
self step.
(currentCharacter isDigit or: [
(currentCharacter between: $A and: $F) or: [
currentCharacter between: $a and: $f ] ]) ifTrue: [
^ self recordAndReportMatch: #( 14 ) ].
^ self recordAndReportMatch: #( 18 ) ].
^ self reportLastMatch ].
currentCharacter isDigit ifTrue: [ ^ self scan3 ].
currentCharacter isDigit ifTrue: [ ^ self scan5 ].
('fl' includes: currentCharacter) ifTrue: [
^ self recordAndReportMatch: #( 14 ) ].
^ self recordAndReportMatch: #( 18 ) ].
^ self reportLastMatch
]
@@ -198,7 +267,7 @@ CarpScanner >> scanForTokenX2 [
CarpScanner >> scanForTokenX3 [
[
self recordMatch: #( 10 ).
self recordMatch: #( 14 ).
self step.
currentCharacter isLowercase or: [
currentCharacter isUppercase or: [
@@ -215,7 +284,7 @@ CarpScanner >> scanForTokenX3 [
CarpScanner >> scanForTokenX4 [
[
self recordMatch: #( 9 ).
self recordMatch: #( 13 ).
self step.
currentCharacter isLowercase or: [
currentCharacter isUppercase or: [
@@ -231,7 +300,7 @@ CarpScanner >> scanForTokenX4 [
CarpScanner >> scanForTokenX5 [
[
self recordMatch: #( 15 ).
self recordMatch: #( 19 ).
self step.
currentCharacter <= Character tab or: [
(currentCharacter between: Character pageUp and: Character newPage)
@@ -243,7 +312,7 @@ CarpScanner >> scanForTokenX5 [
CarpScanner >> scanForTokenX6 [
[
self recordMatch: #( 16 ).
self recordMatch: #( 20 ).
self step.
currentCharacter isSeparator or: [
currentCharacter == Character pageUp ] ] whileTrue.
@@ -253,21 +322,20 @@ CarpScanner >> scanForTokenX6 [
{ #category : #generated }
CarpScanner >> scanForTokenX7 [
self recordMatch: #( 1 ).
self recordMatch: #( 2 ).
self step.
currentCharacter == $@ ifTrue: [ ^ self recordAndReportMatch: #( 2 ) ].
currentCharacter == $@ ifTrue: [ ^ self recordAndReportMatch: #( 3 ) ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scanForTokenX8 [
currentCharacter == $\ ifTrue: [ ^ self scanForTokenX1 ].
currentCharacter == $] ifTrue: [
^ self recordAndReportMatch: #( 13 ) ].
currentCharacter isDigit ifTrue: [ ^ self scan3 ].
currentCharacter == $} ifTrue: [ ^ self recordAndReportMatch: #( 7 ) ].
currentCharacter == $~ ifTrue: [ ^ self recordAndReportMatch: #( 8 ) ].
currentCharacter isDigit ifTrue: [ ^ self scan5 ].
('''`' includes: currentCharacter) ifTrue: [
^ self recordAndReportMatch: #( 8 ) ].
^ self recordAndReportMatch: #( 12 ) ].
(currentCharacter isSeparator or: [
currentCharacter == Character pageUp ]) ifTrue: [
^ self scanForTokenX6 ].
@@ -275,16 +343,40 @@ CarpScanner >> scanForTokenX8 [
(currentCharacter isLowercase or: [
('!$' includes: currentCharacter) or: [
(currentCharacter between: $* and: $+) or: [
('-/:' includes: currentCharacter) or: [
('/:' includes: currentCharacter) or: [
(currentCharacter between: $< and: $?) or: [
currentCharacter == $_ ] ] ] ] ]) ifTrue: [
self scanForTokenX4 ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scanForTokenX9 [
currentCharacter == $( ifTrue: [
^ self recordAndReportMatch: #( 10 ) ].
currentCharacter == $) ifTrue: [
^ self recordAndReportMatch: #( 11 ) ].
currentCharacter == $, ifTrue: [
^ self recordAndReportMatch: #( 19 ) ].
currentCharacter == $- ifTrue: [ ^ self scan2 ].
currentCharacter == $. ifTrue: [
^ self recordAndReportMatch: #( 15 ) ].
currentCharacter == $0 ifTrue: [ ^ self scanForTokenX2 ].
currentCharacter == $; ifTrue: [ ^ self scanForTokenX5 ].
currentCharacter == $@ ifTrue: [ ^ self recordAndReportMatch: #( 5 ) ].
currentCharacter == $[ ifTrue: [
^ self recordAndReportMatch: #( 16 ) ].
currentCharacter == $\ ifTrue: [ ^ self scanForTokenX1 ].
currentCharacter == $] ifTrue: [
^ self recordAndReportMatch: #( 17 ) ].
currentCharacter == ${ ifTrue: [ ^ self recordAndReportMatch: #( 6 ) ].
^ self scanForTokenX8
]
{ #category : #generated }
CarpScanner >> tokenActions [
^ #( nil nil nil nil nil nil nil nil nil nil nil nil nil nil #comment
#whitespace )
^ #( nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
nil nil #comment #whitespace )
]

View File

@@ -35,6 +35,12 @@ TCarpExpressionNodeVisitor >> visitList: aList [
^ self visitExpression: aList
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitMap: aMap [
^ self visitExpression: aMap
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitModuleOrType: aModuleOrType [
@@ -47,6 +53,18 @@ TCarpExpressionNodeVisitor >> visitNumber: aNumber [
^ self visitExpression: aNumber
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitPair: aPair [
^ self visitExpression: aPair
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitPattern: aPattern [
^ self visitExpression: aPattern
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitQuote: aQuote [
@@ -59,6 +77,12 @@ TCarpExpressionNodeVisitor >> visitRef: aRef [
^ self visitExpression: aRef
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitRefCall: aRefCall [
^ self visitExpression: aRefCall
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitStart: aStart [