Add Lepiter snippets for Carp

This commit is contained in:
2022-04-16 18:32:16 +02:00
parent 60321973fb
commit f1cac9749e
34 changed files with 597 additions and 61 deletions
+72
View File
@@ -0,0 +1,72 @@
Class {
#name : #CarpArrayNode,
#superclass : #CarpExpressionNode,
#instVars : [
'leftBracket',
'expressions',
'rightBracket'
],
#category : #'Carp-Parser'
}
{ #category : #generated }
CarpArrayNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitArray: self
]
{ #category : #generated }
CarpArrayNode >> compositeNodeVariables [
^ #( #expressions )
]
{ #category : #generated }
CarpArrayNode >> expressions [
^ expressions
]
{ #category : #generated }
CarpArrayNode >> expressions: anOrderedCollection [
self setParents: self expressions to: nil.
expressions := anOrderedCollection.
self setParents: self expressions to: self
]
{ #category : #'generated-initialize-release' }
CarpArrayNode >> initialize [
super initialize.
expressions := OrderedCollection new: 2.
]
{ #category : #generated }
CarpArrayNode >> leftBracket [
^ leftBracket
]
{ #category : #generated }
CarpArrayNode >> leftBracket: aSmaCCToken [
leftBracket := aSmaCCToken
]
{ #category : #generated }
CarpArrayNode >> rightBracket [
^ rightBracket
]
{ #category : #generated }
CarpArrayNode >> rightBracket: aSmaCCToken [
rightBracket := aSmaCCToken
]
{ #category : #generated }
CarpArrayNode >> tokenVariables [
^ #( #leftBracket #rightBracket )
]
+53
View File
@@ -0,0 +1,53 @@
Class {
#name : #CarpDerefNode,
#superclass : #CarpExpressionNode,
#instVars : [
'derefGlyph',
'value'
],
#category : #'Carp-Parser'
}
{ #category : #generated }
CarpDerefNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitDeref: self
]
{ #category : #generated }
CarpDerefNode >> derefGlyph [
^ derefGlyph
]
{ #category : #generated }
CarpDerefNode >> derefGlyph: aSmaCCToken [
derefGlyph := aSmaCCToken
]
{ #category : #generated }
CarpDerefNode >> nodeVariables [
^ #( #value )
]
{ #category : #generated }
CarpDerefNode >> tokenVariables [
^ #( #derefGlyph )
]
{ #category : #generated }
CarpDerefNode >> value [
^ value
]
{ #category : #generated }
CarpDerefNode >> value: aCarpExpressionNode [
self value notNil ifTrue: [ self value parent: nil ].
value := aCarpExpressionNode.
self value notNil ifTrue: [ self value parent: self ]
]
@@ -0,0 +1,7 @@
Class {
#name : #CarpExpressionNodeVisitor,
#superclass : #Object,
#traits : 'TCarpExpressionNodeVisitor',
#classTraits : 'TCarpExpressionNodeVisitor classTrait',
#category : #'Carp-Parser'
}
+36
View File
@@ -0,0 +1,36 @@
Class {
#name : #CarpFile,
#superclass : #Object,
#instVars : [
'fileName',
'contents'
],
#category : #'Carp-Parser'
}
{ #category : #'instance creation' }
CarpFile class >> for: aFileName [
^ self new for: aFileName
]
{ #category : #accessing }
CarpFile >> contents [
^ contents
]
{ #category : #accessing }
CarpFile >> contents: aString [
contents := aString
]
{ #category : #accessing }
CarpFile >> fileName: aFileName [
fileName := aFileName
]
{ #category : #accessing }
CarpFile >> for: aFileName [
self fileName: aFileName.
self contents: (CarpParser parse: aFileName asFileReference contents).
]
+72
View File
@@ -0,0 +1,72 @@
Class {
#name : #CarpListNode,
#superclass : #CarpExpressionNode,
#instVars : [
'leftParen',
'expressions',
'rightParen'
],
#category : #'Carp-Parser'
}
{ #category : #generated }
CarpListNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitList: self
]
{ #category : #generated }
CarpListNode >> compositeNodeVariables [
^ #( #expressions )
]
{ #category : #generated }
CarpListNode >> expressions [
^ expressions
]
{ #category : #generated }
CarpListNode >> expressions: anOrderedCollection [
self setParents: self expressions to: nil.
expressions := anOrderedCollection.
self setParents: self expressions to: self
]
{ #category : #'generated-initialize-release' }
CarpListNode >> initialize [
super initialize.
expressions := OrderedCollection new: 2.
]
{ #category : #generated }
CarpListNode >> leftParen [
^ leftParen
]
{ #category : #generated }
CarpListNode >> leftParen: aSmaCCToken [
leftParen := aSmaCCToken
]
{ #category : #generated }
CarpListNode >> rightParen [
^ rightParen
]
{ #category : #generated }
CarpListNode >> rightParen: aSmaCCToken [
rightParen := aSmaCCToken
]
{ #category : #generated }
CarpListNode >> tokenVariables [
^ #( #leftParen #rightParen )
]
+72
View File
@@ -0,0 +1,72 @@
Class {
#name : #CarpMapNode,
#superclass : #CarpExpressionNode,
#instVars : [
'leftBrace',
'pairs',
'rightBrace'
],
#category : #'Carp-Parser'
}
{ #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 >> leftBrace [
^ leftBrace
]
{ #category : #generated }
CarpMapNode >> leftBrace: aSmaCCToken [
leftBrace := aSmaCCToken
]
{ #category : #generated }
CarpMapNode >> pairs [
^ pairs
]
{ #category : #generated }
CarpMapNode >> pairs: anOrderedCollection [
self setParents: self pairs to: nil.
pairs := anOrderedCollection.
self setParents: self pairs to: self
]
{ #category : #generated }
CarpMapNode >> rightBrace [
^ rightBrace
]
{ #category : #generated }
CarpMapNode >> rightBrace: aSmaCCToken [
rightBrace := aSmaCCToken
]
{ #category : #generated }
CarpMapNode >> tokenVariables [
^ #( #leftBrace #rightBrace )
]
+478
View File
@@ -0,0 +1,478 @@
Class {
#name : #CarpParser,
#superclass : #SmaCCGLRParser,
#category : #'Carp-Parser'
}
{ #category : #'generated-accessing' }
CarpParser class >> cacheId [
^'2022-04-16T18:21:43.028213+02:00'
]
{ #category : #generated }
CarpParser class >> definitionComment [
"%glr;
%root Expression;
%prefix Carp;
%suffix Node;
<escape>
: \\ (. | u[0-9A-F]{4,4} | o[0-7]{3,3} | newline | return | space | tab | space | backspace | formfeed) # other character types
;
<string_literal>
: \"" ([^\""\\] | <escape>)* \""
;
<open_paren>
: \(
;
<close_paren>
: \)
;
<quote>
: \' | \`
;
<variable_start>
: <isLowercase> | _ | \$ | \+ | \* | \/ | \? | ! | > | < | = | : | -
;
default <variable>
: <variable_start> <variable_part>*
;
<variable_part>
: <variable_start> | <isDigit> | <isUppercase>
;
<module>
: <isUppercase> <variable_part>*
;
<dot>
: \.
;
<open_bracket>
: \[
;
<close_bracket>
: \]
;
<binary_integer>
: 0 b [0-1]
;
<hex_integer>
: 0 x [0-9a-fA-F]
;
<decimal_integer>
: [0-9]+
;
<sign>
: \-
;
<decimal>
: <sign>? (<decimal_integer> \. <decimal_integer> f?)
| <sign>? (<decimal_integer> (f|l|b)?)
;
<numeric_literal>
: <decimal> | <hex_integer> | <binary_integer>
;
<comment>
: \; [^\r\n]*
| \, # commas are treated as whitespace, but whitespace is not saved, so I made them comments instead
;
<whitespace>
: \s+
;
<character>
: \\ (. | u[0-9A-F]{4,4} | o[0-7]{3,3} | newline | return | space | tab | space | backspace | formfeed) # other character types
;Start
: Expressions {{}}
;
Expressions
:
| Expressions Expression 'expression'
;
Expression
: Literal
| Deref
| Ref
| RefCall
| Unquote
;
RefCall
: ""~"" 'refGlyph' Expression 'value' {{}}
;
Unquote
: (""%"" 'unquoteGlyph' | ""%@""'unquoteGlyph') Expression 'value' {{}}
;
Ref
: ""&"" 'refGlyph' Expression 'value' {{}}
;
Deref
: ""@"" 'derefGlyph' Expression 'value' {{}}
;
Literal
: String | List | Array | Symbol | Quote | Number | Character | Pattern | Map
;
Map
: ""{"" 'leftBrace' MapPairs ""}"" 'rightBrace' {{}}
;
MapPairs
:
| MapPairs MapPair 'pair'
;
MapPair
: Expression 'key' Expression 'value' {{Pair}}
;
Pattern
: ""#"" 'patternGlyph' <string_literal> 'value' {{}}
;
Character
: <character> 'value' {{}}
;
Number
: <numeric_literal> 'value' {{}}
;
Array
: <open_bracket> 'leftBracket' Expressions <close_bracket> 'rightBracket' {{}}
;
Quote
: <quote> Expression 'value' {{}}
;
Symbol
: ModuleOrType | Variable
;
Variable
: <variable> 'value' {{}}
;
ModuleOrType
: <module> <dot> Symbol 'value' {{}}
| <module> 'value' {{}}
;
List
: <open_paren> 'leftParen' Expressions <close_paren> 'rightParen' {{}}
;
String
: <string_literal> 'value' {{}}
;"
]
{ #category : #generated }
CarpParser class >> reduceTable [
^#(
#(24 0 #reduceActionForExpressions1: 1289217 false)
#(23 1 #reduceActionForStart1: 1258497 false)
#(32 0 #reduceActionForExpressions1: 1803265 false)
#(43 1 #reduceActionForString1: 2436097 false)
#(40 1 #reduceActionForVariable1: 2233345 false)
#(41 1 #reduceActionForModuleOrType2: 2273282 false)
#(36 1 #reduceActionForNumber1: 2013185 false)
#(35 1 #reduceActionForCharacter1: 1971201 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: 1652745 false)
#(30 1 #liftFirstValue: 1652744 false)
#(30 1 #liftFirstValue: 1652743 false)
#(30 1 #liftFirstValue: 1652742 false)
#(30 1 #liftFirstValue: 1652739 false)
#(30 1 #liftFirstValue: 1652741 false)
#(30 1 #liftFirstValue: 1652740 false)
#(39 1 #liftFirstValue: 2195458 false)
#(39 1 #liftFirstValue: 2195457 false)
#(30 1 #liftFirstValue: 1652738 false)
#(30 1 #liftFirstValue: 1652737 false)
#(34 2 #reduceActionForPattern1: 1906689 false)
#(27 2 #reduceActionForUnquote1: 1466369 false)
#(27 2 #reduceActionForUnquote1: 1466370 false)
#(28 2 #reduceActionForRef1: 1548289 false)
#(29 2 #reduceActionForDeref1: 1598465 false)
#(26 2 #reduceActionForRefCall1: 1412097 false)
#(38 2 #reduceActionForQuote1: 2150401 false)
#(31 3 #reduceActionForMap1: 1744897 false)
#(32 2 #reduceActionForExpressions2: 1803266 false)
#(42 3 #reduceActionForList1: 2354177 false)
#(41 3 #reduceActionForModuleOrType1: 2273281 false)
#(37 3 #reduceActionForArray1: 2059265 false)
#(33 2 #reduceActionForMapPair1: 1846273 false)
).
]
{ #category : #generated }
CarpParser class >> scannerClass [
^CarpScanner
]
{ #category : #generated }
CarpParser class >> startingStateForStart [
^ 1
]
{ #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' 'RefCall'
'Unquote' 'Ref' 'Deref' 'Literal' 'Map' 'MapPairs' 'MapPair'
'Pattern' 'Character' 'Number' 'Array' 'Quote' 'Symbol' 'Variable'
'ModuleOrType' 'List' 'String' 'E O F' 'error' )
]
{ #category : #generated }
CarpParser class >> symbolTypes [
^ #( #SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken
#SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken
#SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken #SmaCCToken
#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 )
]
{ #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 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]
).
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForArray1: nodes [
| result |
result := CarpArrayNode new.
result leftBracket: (nodes at: 1).
result addNodes: (nodes at: 2) to: result expressions.
result rightBracket: (nodes at: 3).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForCharacter1: nodes [
| result |
result := CarpCharacterNode new.
result value: (nodes at: 1).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForDeref1: nodes [
| result |
result := CarpDerefNode new.
result derefGlyph: (nodes at: 1).
result value: (nodes at: 2).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForExpressions1: nodes [
| result |
result := OrderedCollection new: 2.
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForExpressions2: nodes [
| result |
result := nodes at: 1.
self add: (nodes at: 2) to: result.
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForList1: nodes [
| result |
result := CarpListNode new.
result leftParen: (nodes at: 1).
result addNodes: (nodes at: 2) to: result expressions.
result rightParen: (nodes at: 3).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForMap1: nodes [
| result |
result := CarpMapNode new.
result leftBrace: (nodes at: 1).
result addNodes: (nodes at: 2) to: result pairs.
result rightBrace: (nodes at: 3).
^ 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 [
| result |
result := CarpModuleOrTypeNode new.
result value: (nodes at: 3).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForModuleOrType2: nodes [
| result |
result := CarpModuleOrTypeNode new.
result value: (nodes at: 1).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForNumber1: nodes [
| result |
result := CarpNumberNode new.
result value: (nodes at: 1).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForPattern1: nodes [
| result |
result := CarpPatternNode new.
result patternGlyph: (nodes at: 1).
result value: (nodes at: 2).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForQuote1: nodes [
| result |
result := CarpQuoteNode new.
result value: (nodes at: 2).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForRef1: nodes [
| result |
result := CarpRefNode new.
result refGlyph: (nodes at: 1).
result value: (nodes at: 2).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForRefCall1: nodes [
| result |
result := CarpRefCallNode new.
result refGlyph: (nodes at: 1).
result value: (nodes at: 2).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForStart1: nodes [
| result |
result := CarpStartNode new.
result addNodes: (nodes at: 1) to: result expressions.
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForString1: nodes [
| result |
result := CarpStringNode new.
result value: (nodes at: 1).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForUnquote1: nodes [
| result |
result := CarpUnquoteNode new.
result unquoteGlyph: (nodes at: 1).
result value: (nodes at: 2).
^ result
]
{ #category : #'generated-reduction actions' }
CarpParser >> reduceActionForVariable1: nodes [
| result |
result := CarpVariableNode new.
result value: (nodes at: 1).
^ result
]
+45
View File
@@ -0,0 +1,45 @@
Class {
#name : #CarpPatternNode,
#superclass : #CarpExpressionNode,
#instVars : [
'patternGlyph',
'value'
],
#category : #'Carp-Parser'
}
{ #category : #generated }
CarpPatternNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitPattern: self
]
{ #category : #generated }
CarpPatternNode >> patternGlyph [
^ patternGlyph
]
{ #category : #generated }
CarpPatternNode >> patternGlyph: aSmaCCToken [
patternGlyph := aSmaCCToken
]
{ #category : #generated }
CarpPatternNode >> tokenVariables [
^ #( #patternGlyph #value )
]
{ #category : #generated }
CarpPatternNode >> value [
^ value
]
{ #category : #generated }
CarpPatternNode >> value: aSmaCCToken [
value := aSmaCCToken
]
+53
View File
@@ -0,0 +1,53 @@
Class {
#name : #CarpRefCallNode,
#superclass : #CarpExpressionNode,
#instVars : [
'refGlyph',
'value'
],
#category : #'Carp-Parser'
}
{ #category : #generated }
CarpRefCallNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitRefCall: self
]
{ #category : #generated }
CarpRefCallNode >> nodeVariables [
^ #( #value )
]
{ #category : #generated }
CarpRefCallNode >> refGlyph [
^ refGlyph
]
{ #category : #generated }
CarpRefCallNode >> refGlyph: aSmaCCToken [
refGlyph := aSmaCCToken
]
{ #category : #generated }
CarpRefCallNode >> tokenVariables [
^ #( #refGlyph )
]
{ #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 ]
]
+53
View File
@@ -0,0 +1,53 @@
Class {
#name : #CarpRefNode,
#superclass : #CarpExpressionNode,
#instVars : [
'refGlyph',
'value'
],
#category : #'Carp-Parser'
}
{ #category : #generated }
CarpRefNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitRef: self
]
{ #category : #generated }
CarpRefNode >> nodeVariables [
^ #( #value )
]
{ #category : #generated }
CarpRefNode >> refGlyph [
^ refGlyph
]
{ #category : #generated }
CarpRefNode >> refGlyph: aSmaCCToken [
refGlyph := aSmaCCToken
]
{ #category : #generated }
CarpRefNode >> tokenVariables [
^ #( #refGlyph )
]
{ #category : #generated }
CarpRefNode >> value [
^ value
]
{ #category : #generated }
CarpRefNode >> value: aCarpExpressionNode [
self value notNil ifTrue: [ self value parent: nil ].
value := aCarpExpressionNode.
self value notNil ifTrue: [ self value parent: self ]
]
+382
View File
@@ -0,0 +1,382 @@
Class {
#name : #CarpScanner,
#superclass : #SmaCCScanner,
#category : #'Carp-Parser'
}
{ #category : #generated }
CarpScanner >> emptySymbolTokenId [
^ 44
]
{ #category : #generated }
CarpScanner >> errorTokenId [
^ 45
]
{ #category : #generated }
CarpScanner >> scan1 [
[
self step.
currentCharacter == $" ifTrue: [ ^ self recordAndReportMatch: #( 9 ) ].
currentCharacter == $\ ifTrue: [
self step.
^ self scan1 ].
true ] whileTrue
]
{ #category : #generated }
CarpScanner >> scan2 [
self recordMatch: #( 13 ).
self step.
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: #( 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 >> scan3 [
[
self recordMatch: #( 13 18 ).
self step.
currentCharacter == $. ifTrue: [ ^ self scan4 ].
currentCharacter isDigit ] whileTrue.
('bfl' includes: currentCharacter) ifTrue: [
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 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: #( 21 ) ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scanForToken [
self step.
currentCharacter == $" ifTrue: [ ^ self scan1 ].
currentCharacter == $# ifTrue: [ ^ self recordAndReportMatch: #( 1 ) ].
currentCharacter == $% ifTrue: [ ^ self scanForTokenX7 ].
currentCharacter == $& ifTrue: [ ^ self recordAndReportMatch: #( 4 ) ].
^ self scanForTokenX9
]
{ #category : #generated }
CarpScanner >> scanForTokenX1 [
self step.
currentCharacter == $b ifTrue: [
self recordMatch: #( 21 ).
self step.
currentCharacter == $a ifTrue: [
(self scanForString: 'cksp') ifTrue: [ ^ self scan6 ] ].
^ self reportLastMatch ].
currentCharacter == $f ifTrue: [
self recordMatch: #( 21 ).
self step.
currentCharacter == $o ifTrue: [
(self scanForString: 'rmfeed') ifTrue: [
^ self recordAndReportMatch: #( 21 ) ] ].
^ self reportLastMatch ].
currentCharacter == $n ifTrue: [
self recordMatch: #( 21 ).
self step.
currentCharacter == $e ifTrue: [
(self scanForString: 'wlin') ifTrue: [ ^ self scan7 ] ].
^ self reportLastMatch ].
currentCharacter == $o ifTrue: [
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: #( 21 ) ] ] ].
^ self reportLastMatch ].
currentCharacter == $r ifTrue: [
self recordMatch: #( 21 ).
self step.
currentCharacter == $e ifTrue: [
(self scanForString: 'turn') ifTrue: [
^ self recordAndReportMatch: #( 21 ) ] ].
^ self reportLastMatch ].
currentCharacter == $s ifTrue: [
self recordMatch: #( 21 ).
self step.
currentCharacter == $p ifTrue: [ ^ self scan6 ].
^ self reportLastMatch ].
currentCharacter == $t ifTrue: [
self recordMatch: #( 21 ).
self step.
currentCharacter == $a ifTrue: [
self step.
currentCharacter == $b ifTrue: [
^ self recordAndReportMatch: #( 21 ) ] ].
^ self reportLastMatch ].
currentCharacter == $u ifTrue: [ ^ self scanForTokenX1X1 ].
^ self recordAndReportMatch: #( 21 )
]
{ #category : #generated }
CarpScanner >> scanForTokenX1X1 [
self recordMatch: #( 21 ).
self step.
(currentCharacter isDigit or: [ currentCharacter between: $A and: $F ])
ifTrue: [
self step.
(currentCharacter isDigit or: [
currentCharacter between: $A and: $F ]) ifTrue: [
self step.
(currentCharacter isDigit or: [
currentCharacter between: $A and: $F ]) ifTrue: [
self step.
(currentCharacter isDigit or: [
currentCharacter between: $A and: $F ]) ifTrue: [
^ self recordAndReportMatch: #( 21 ) ] ] ] ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scanForTokenX2 [
self recordMatch: #( 18 ).
self step.
currentCharacter == $. ifTrue: [ ^ self scan4 ].
currentCharacter == $b ifTrue: [
self recordMatch: #( 18 ).
self step.
(currentCharacter between: $0 and: $1) ifTrue: [
^ 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: #( 18 ) ].
^ self reportLastMatch ].
currentCharacter isDigit ifTrue: [ ^ self scan5 ].
('fl' includes: currentCharacter) ifTrue: [
^ self recordAndReportMatch: #( 18 ) ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scanForTokenX3 [
[
self recordMatch: #( 14 ).
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 >> scanForTokenX4 [
[
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
]
{ #category : #generated }
CarpScanner >> scanForTokenX5 [
[
self recordMatch: #( 19 ).
self step.
currentCharacter <= Character tab or: [
(currentCharacter between: Character pageUp and: Character newPage)
or: [ currentCharacter >= (Character value: 14) ] ] ] whileTrue.
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scanForTokenX6 [
[
self recordMatch: #( 20 ).
self step.
currentCharacter isSeparator or: [
currentCharacter == Character pageUp ] ] whileTrue.
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scanForTokenX7 [
self recordMatch: #( 2 ).
self step.
currentCharacter == $@ ifTrue: [ ^ self recordAndReportMatch: #( 3 ) ].
^ self reportLastMatch
]
{ #category : #generated }
CarpScanner >> scanForTokenX8 [
currentCharacter == $} ifTrue: [ ^ self recordAndReportMatch: #( 7 ) ].
currentCharacter == $~ ifTrue: [ ^ self recordAndReportMatch: #( 8 ) ].
currentCharacter isDigit ifTrue: [ ^ self scan5 ].
('''`' includes: currentCharacter) ifTrue: [
^ self recordAndReportMatch: #( 12 ) ].
(currentCharacter isSeparator or: [
currentCharacter == Character pageUp ]) ifTrue: [
^ self scanForTokenX6 ].
currentCharacter isUppercase ifTrue: [ ^ self scanForTokenX3 ].
(currentCharacter isLowercase or: [
('!$' includes: currentCharacter) or: [
(currentCharacter between: $* and: $+) 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 nil nil
nil nil #comment #whitespace )
]
+58
View File
@@ -0,0 +1,58 @@
Class {
#name : #CarpUnquoteNode,
#superclass : #CarpExpressionNode,
#instVars : [
'unquoteGlyph',
'value'
],
#category : #'Carp-Parser'
}
{ #category : #generated }
CarpUnquoteNode >> acceptVisitor: anExpressionVisitor [
^ anExpressionVisitor visitUnquote: self
]
{ #category : #accessing }
CarpUnquoteNode >> isQuoted [
^ false
]
{ #category : #generated }
CarpUnquoteNode >> nodeVariables [
^ #( #value )
]
{ #category : #generated }
CarpUnquoteNode >> tokenVariables [
^ #( #unquoteGlyph )
]
{ #category : #generated }
CarpUnquoteNode >> unquoteGlyph [
^ unquoteGlyph
]
{ #category : #generated }
CarpUnquoteNode >> unquoteGlyph: aSmaCCToken [
unquoteGlyph := aSmaCCToken
]
{ #category : #generated }
CarpUnquoteNode >> value [
^ value
]
{ #category : #generated }
CarpUnquoteNode >> value: aCarpExpressionNode [
self value notNil ifTrue: [ self value parent: nil ].
value := aCarpExpressionNode.
self value notNil ifTrue: [ self value parent: self ]
]
@@ -0,0 +1,108 @@
Trait {
#name : #TCarpExpressionNodeVisitor,
#traits : 'TSmaCCParseNodeVisitor',
#classTraits : 'TSmaCCParseNodeVisitor classTrait',
#category : #'Carp-Parser'
}
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitArray: anArray [
^ self visitExpression: anArray
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitCharacter: aCharacter [
^ self visitExpression: aCharacter
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitDeref: aDeref [
^ self visitExpression: aDeref
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitExpression: anExpression [
^ self visitSmaCCParseNode: anExpression
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitList: aList [
^ self visitExpression: aList
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitMap: aMap [
^ self visitExpression: aMap
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitModuleOrType: aModuleOrType [
^ self visitExpression: aModuleOrType
]
{ #category : #generated }
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 [
^ self visitExpression: aQuote
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitRef: aRef [
^ self visitExpression: aRef
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitRefCall: aRefCall [
^ self visitExpression: aRefCall
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitStart: aStart [
^ self visitExpression: aStart
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitString: aString [
^ self visitExpression: aString
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitUnquote: anUnquote [
^ self visitExpression: anUnquote
]
{ #category : #generated }
TCarpExpressionNodeVisitor >> visitVariable: aVariable [
^ self visitExpression: aVariable
]
+1
View File
@@ -0,0 +1 @@
Package { #name : #'Carp-Parser' }