SystemOrganization addCategory: #'LanguageBoxes-Core'! SystemOrganization addCategory: #'LanguageBoxes-DSL'! SystemOrganization addCategory: #'LanguageBoxes-OmniBrowser'! SystemOrganization addCategory: #'LanguageBoxes-Grammar-Smalltalk'! SystemOrganization addCategory: #'LanguageBoxes-Grammar-Java'! SystemOrganization addCategory: #'LanguageBoxes-Grammar-SQL'! SystemOrganization addCategory: #'LanguageBoxes-Tests'! SystemOrganization addCategory: #'LanguageBoxes-Tests-Smalltalk'! SystemOrganization addCategory: #'LanguageBoxes-Tests-Java'! SystemOrganization addCategory: #'LanguageBoxes-Tests-SQL'! TestResource subclass: #LBGrammarResource instanceVariableNames: 'parsers' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests'! !LBGrammarResource methodsFor: 'accessing' stamp: 'lr 5/7/2009 13:57'! parserAt: aClass ^ parsers at: aClass name ifAbsentPut: [ aClass new ]! ! !LBGrammarResource methodsFor: 'running' stamp: 'lr 3/26/2009 15:37'! setUp super setUp. parsers := Dictionary new! ! CUCompositeParser subclass: #LBJavaCommentGrammar instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Grammar-Java'! !LBJavaCommentGrammar methodsFor: 'productions' stamp: 'lr 5/5/2009 14:58'! comment '/*' , ('*/' not , #any) star , '*/'! ! !LBJavaCommentGrammar methodsFor: 'productions' stamp: 'lr 5/5/2009 14:58'! javadoc '/**' , ('*/' not , #any) star , '*/'! ! !LBJavaCommentGrammar methodsFor: 'productions' stamp: 'lr 5/5/2009 15:04'! line '//' , ((#cr / #lf) not , #any) star! ! !LBJavaCommentGrammar methodsFor: 'parsing' stamp: 'lr 5/4/2010 14:07'! parse: aStream | start element stop | start := aStream position. element := super parse: aStream. element isPetitFailure ifTrue: [ ^ element ]. stop := aStream position. ^ PPToken on: aStream collection start: start + 1 stop: stop! ! !LBJavaCommentGrammar methodsFor: 'accessing' stamp: 'lr 5/7/2009 11:05'! start ^ (whitespace plus / javadoc / comment / line) star! ! !LBJavaCommentGrammar methodsFor: 'productions' stamp: 'lr 5/7/2009 11:05'! whitespace #space! ! CUCompositeParser subclass: #LBJavaGrammar instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Grammar-Java'! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! ABSTRACT 'abstract' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:21'! AMP '&' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:21'! AMPAMP '&&' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:21'! AMPEQ '&=' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! ASSERT 'assert' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:21'! BANG '!!' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:21'! BANGEQ '!!=' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:36'! BAR '|' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:35'! BARBAR '||' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:36'! BAREQ '|=' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! BOOLEAN 'boolean' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! BREAK 'break' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! BYTE 'byte' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:21'! CARET '^' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:21'! CARETEQ '^=' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! CASE 'case' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! CATCH 'catch' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! CHAR 'char' token! ! !LBJavaGrammar methodsFor: 'token' stamp: 'lr 5/7/2009 14:20'! CHARLITERAL ($' , (EscapeSequence / (($" / $\ / '\r' / '\n') not , #any)) , $') token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! CLASS 'class' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:21'! COLON ':' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:21'! COMMA ',' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! CONST 'const' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! CONTINUE 'continue' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! DEFAULT 'default' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! DO 'do' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:22'! DOT '.' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! DOUBLE 'double' token! ! !LBJavaGrammar methodsFor: 'token' stamp: 'lr 5/7/2009 13:47'! DOUBLELITERAL (NonIntegerNumber , DoubleSuffix optional) token! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/3/2009 15:41'! DoubleSuffix $d / $D! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:22'! ELLIPSIS '...' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! ELSE 'else' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! ENUM 'enum' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:22'! EQ '=' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:22'! EQEQ '==' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! EXTENDS 'extends' token! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/5/2009 15:13'! EscapeSequence $\ , ($b / $t / $n / $f / $r / $" / $' / $\ / (($0 / $1 / $2 / $3) , ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7) , ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7)) / (($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7) , ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7)) / ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7))! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/5/2009 15:14'! Exponent ($e / $E) , ($+ / $-) optional , ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) plus! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! FALSE 'false' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! FINAL 'final' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:18'! FINALLY 'finally' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! FLOAT 'float' token! ! !LBJavaGrammar methodsFor: 'token' stamp: 'lr 5/7/2009 13:48'! FLOATLITERAL (NonIntegerNumber , FloatSuffix) token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! FOR 'for' token! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/3/2009 15:41'! FloatSuffix $f / $F! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! GOTO 'goto' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:22'! GT '>' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 12:10'! GTEQ '>=' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 12:11'! GTGT '>>' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:36'! GTGTEQ '>>=' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 12:11'! GTGTGT '>>>' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:37'! GTGTGTEQ '>>>=' token! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/5/2009 15:16'! HexDigit ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) / ($a / $b / $c / $d / $e / $f) / ($A / $B / $C / $D / $E / $F)! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/3/2009 15:36'! HexPrefix '0x' / '0X'! ! !LBJavaGrammar methodsFor: 'token' stamp: 'lr 5/7/2009 13:48'! IDENTIFIER (IdentifierStart , IdentifierPart star) token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! IF 'if' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! IMPLEMENTS 'implements' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! IMPORT 'import' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! INSTANCEOF 'instanceof' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! INT 'int' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! INTERFACE 'interface' token! ! !LBJavaGrammar methodsFor: 'token' stamp: 'lr 5/7/2009 13:48'! INTLITERAL IntegerNumber token! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/3/2009 15:59'! IdentifierPart #word "'\u0000'..'\u0008' / '\u000e'..'\u001b' / '\u0024' / '\u0030'..'\u0039' / '\u0041'..'\u005a' / '\u005f' / '\u0061'..'\u007a' / '\u007f'..'\u009f' / '\u00a2'..'\u00a5' / '\u00aa' / '\u00ad' / '\u00b5' / '\u00ba' / '\u00c0'..'\u00d6' / '\u00d8'..'\u00f6' / '\u00f8'..'\u0236' / '\u0250'..'\u02c1' / '\u02c6'..'\u02d1' / '\u02e0'..'\u02e4' / '\u02ee' / '\u0300'..'\u0357' / '\u035d'..'\u036f' / '\u037a' / '\u0386' / '\u0388'..'\u038a' / '\u038c' / '\u038e'..'\u03a1' / '\u03a3'..'\u03ce' / '\u03d0'..'\u03f5' / '\u03f7'..'\u03fb' / '\u0400'..'\u0481' / '\u0483'..'\u0486' / '\u048a'..'\u04ce' / '\u04d0'..'\u04f5' / '\u04f8'..'\u04f9' / '\u0500'..'\u050f' / '\u0531'..'\u0556' / '\u0559' / '\u0561'..'\u0587' / '\u0591'..'\u05a1' / '\u05a3'..'\u05b9' / '\u05bb'..'\u05bd' / '\u05bf' / '\u05c1'..'\u05c2' / '\u05c4' / '\u05d0'..'\u05ea' / '\u05f0'..'\u05f2' / '\u0600'..'\u0603' / '\u0610'..'\u0615' / '\u0621'..'\u063a' / '\u0640'..'\u0658' / '\u0660'..'\u0669' / '\u066e'..'\u06d3' / '\u06d5'..'\u06dd' / '\u06df'..'\u06e8' / '\u06ea'..'\u06fc' / '\u06ff' / '\u070f'..'\u074a' / '\u074d'..'\u074f' / '\u0780'..'\u07b1' / '\u0901'..'\u0939' / '\u093c'..'\u094d' / '\u0950'..'\u0954' / '\u0958'..'\u0963' / '\u0966'..'\u096f' / '\u0981'..'\u0983' / '\u0985'..'\u098c' / '\u098f'..'\u0990' / '\u0993'..'\u09a8' / '\u09aa'..'\u09b0' / '\u09b2' / '\u09b6'..'\u09b9' / '\u09bc'..'\u09c4' / '\u09c7'..'\u09c8' / '\u09cb'..'\u09cd' / '\u09d7' / '\u09dc'..'\u09dd' / '\u09df'..'\u09e3' / '\u09e6'..'\u09f3' / '\u0a01'..'\u0a03' / '\u0a05'..'\u0a0a' / '\u0a0f'..'\u0a10' / '\u0a13'..'\u0a28' / '\u0a2a'..'\u0a30' / '\u0a32'..'\u0a33' / '\u0a35'..'\u0a36' / '\u0a38'..'\u0a39' / '\u0a3c' / '\u0a3e'..'\u0a42' / '\u0a47'..'\u0a48' / '\u0a4b'..'\u0a4d' / '\u0a59'..'\u0a5c' / '\u0a5e' / '\u0a66'..'\u0a74' / '\u0a81'..'\u0a83' / '\u0a85'..'\u0a8d' / '\u0a8f'..'\u0a91' / '\u0a93'..'\u0aa8' / '\u0aaa'..'\u0ab0' / '\u0ab2'..'\u0ab3' / '\u0ab5'..'\u0ab9' / '\u0abc'..'\u0ac5' / '\u0ac7'..'\u0ac9' / '\u0acb'..'\u0acd' / '\u0ad0' / '\u0ae0'..'\u0ae3' / '\u0ae6'..'\u0aef' / '\u0af1' / '\u0b01'..'\u0b03' / '\u0b05'..'\u0b0c' / '\u0b0f'..'\u0b10' / '\u0b13'..'\u0b28' / '\u0b2a'..'\u0b30' / '\u0b32'..'\u0b33' / '\u0b35'..'\u0b39' / '\u0b3c'..'\u0b43' / '\u0b47'..'\u0b48' / '\u0b4b'..'\u0b4d' / '\u0b56'..'\u0b57' / '\u0b5c'..'\u0b5d' / '\u0b5f'..'\u0b61' / '\u0b66'..'\u0b6f' / '\u0b71' / '\u0b82'..'\u0b83' / '\u0b85'..'\u0b8a' / '\u0b8e'..'\u0b90' / '\u0b92'..'\u0b95' / '\u0b99'..'\u0b9a' / '\u0b9c' / '\u0b9e'..'\u0b9f' / '\u0ba3'..'\u0ba4' / '\u0ba8'..'\u0baa' / '\u0bae'..'\u0bb5' / '\u0bb7'..'\u0bb9' / '\u0bbe'..'\u0bc2' / '\u0bc6'..'\u0bc8' / '\u0bca'..'\u0bcd' / '\u0bd7' / '\u0be7'..'\u0bef' / '\u0bf9' / '\u0c01'..'\u0c03' / '\u0c05'..'\u0c0c' / '\u0c0e'..'\u0c10' / '\u0c12'..'\u0c28' / '\u0c2a'..'\u0c33' / '\u0c35'..'\u0c39' / '\u0c3e'..'\u0c44' / '\u0c46'..'\u0c48' / '\u0c4a'..'\u0c4d' / '\u0c55'..'\u0c56' / '\u0c60'..'\u0c61' / '\u0c66'..'\u0c6f' / '\u0c82'..'\u0c83' / '\u0c85'..'\u0c8c' / '\u0c8e'..'\u0c90' / '\u0c92'..'\u0ca8' / '\u0caa'..'\u0cb3' / '\u0cb5'..'\u0cb9' / '\u0cbc'..'\u0cc4' / '\u0cc6'..'\u0cc8' / '\u0cca'..'\u0ccd' / '\u0cd5'..'\u0cd6' / '\u0cde' / '\u0ce0'..'\u0ce1' / '\u0ce6'..'\u0cef' / '\u0d02'..'\u0d03' / '\u0d05'..'\u0d0c' / '\u0d0e'..'\u0d10' / '\u0d12'..'\u0d28' / '\u0d2a'..'\u0d39' / '\u0d3e'..'\u0d43' / '\u0d46'..'\u0d48' / '\u0d4a'..'\u0d4d' / '\u0d57' / '\u0d60'..'\u0d61' / '\u0d66'..'\u0d6f' / '\u0d82'..'\u0d83' / '\u0d85'..'\u0d96' / '\u0d9a'..'\u0db1' / '\u0db3'..'\u0dbb' / '\u0dbd' / '\u0dc0'..'\u0dc6' / '\u0dca' / '\u0dcf'..'\u0dd4' / '\u0dd6' / '\u0dd8'..'\u0ddf' / '\u0df2'..'\u0df3' / '\u0e01'..'\u0e3a' / '\u0e3f'..'\u0e4e' / '\u0e50'..'\u0e59' / '\u0e81'..'\u0e82' / '\u0e84' / '\u0e87'..'\u0e88' / '\u0e8a' / '\u0e8d' / '\u0e94'..'\u0e97' / '\u0e99'..'\u0e9f' / '\u0ea1'..'\u0ea3' / '\u0ea5' / '\u0ea7' / '\u0eaa'..'\u0eab' / '\u0ead'..'\u0eb9' / '\u0ebb'..'\u0ebd' / '\u0ec0'..'\u0ec4' / '\u0ec6' / '\u0ec8'..'\u0ecd' / '\u0ed0'..'\u0ed9' / '\u0edc'..'\u0edd' / '\u0f00' / '\u0f18'..'\u0f19' / '\u0f20'..'\u0f29' / '\u0f35' / '\u0f37' / '\u0f39' / '\u0f3e'..'\u0f47' / '\u0f49'..'\u0f6a' / '\u0f71'..'\u0f84' / '\u0f86'..'\u0f8b' / '\u0f90'..'\u0f97' / '\u0f99'..'\u0fbc' / '\u0fc6' / '\u1000'..'\u1021' / '\u1023'..'\u1027' / '\u1029'..'\u102a' / '\u102c'..'\u1032' / '\u1036'..'\u1039' / '\u1040'..'\u1049' / '\u1050'..'\u1059' / '\u10a0'..'\u10c5' / '\u10d0'..'\u10f8' / '\u1100'..'\u1159' / '\u115f'..'\u11a2' / '\u11a8'..'\u11f9' / '\u1200'..'\u1206' / '\u1208'..'\u1246' / '\u1248' / '\u124a'..'\u124d' / '\u1250'..'\u1256' / '\u1258' / '\u125a'..'\u125d' / '\u1260'..'\u1286' / '\u1288' / '\u128a'..'\u128d' / '\u1290'..'\u12ae' / '\u12b0' / '\u12b2'..'\u12b5' / '\u12b8'..'\u12be' / '\u12c0' / '\u12c2'..'\u12c5' / '\u12c8'..'\u12ce' / '\u12d0'..'\u12d6' / '\u12d8'..'\u12ee' / '\u12f0'..'\u130e' / '\u1310' / '\u1312'..'\u1315' / '\u1318'..'\u131e' / '\u1320'..'\u1346' / '\u1348'..'\u135a' / '\u1369'..'\u1371' / '\u13a0'..'\u13f4' / '\u1401'..'\u166c' / '\u166f'..'\u1676' / '\u1681'..'\u169a' / '\u16a0'..'\u16ea' / '\u16ee'..'\u16f0' / '\u1700'..'\u170c' / '\u170e'..'\u1714' / '\u1720'..'\u1734' / '\u1740'..'\u1753' / '\u1760'..'\u176c' / '\u176e'..'\u1770' / '\u1772'..'\u1773' / '\u1780'..'\u17d3' / '\u17d7' / '\u17db'..'\u17dd' / '\u17e0'..'\u17e9' / '\u180b'..'\u180d' / '\u1810'..'\u1819' / '\u1820'..'\u1877' / '\u1880'..'\u18a9' / '\u1900'..'\u191c' / '\u1920'..'\u192b' / '\u1930'..'\u193b' / '\u1946'..'\u196d' / '\u1970'..'\u1974' / '\u1d00'..'\u1d6b' / '\u1e00'..'\u1e9b' / '\u1ea0'..'\u1ef9' / '\u1f00'..'\u1f15' / '\u1f18'..'\u1f1d' / '\u1f20'..'\u1f45' / '\u1f48'..'\u1f4d' / '\u1f50'..'\u1f57' / '\u1f59' / '\u1f5b' / '\u1f5d' / '\u1f5f'..'\u1f7d' / '\u1f80'..'\u1fb4' / '\u1fb6'..'\u1fbc' / '\u1fbe' / '\u1fc2'..'\u1fc4' / '\u1fc6'..'\u1fcc' / '\u1fd0'..'\u1fd3' / '\u1fd6'..'\u1fdb' / '\u1fe0'..'\u1fec' / '\u1ff2'..'\u1ff4' / '\u1ff6'..'\u1ffc' / '\u200c'..'\u200f' / '\u202a'..'\u202e' / '\u203f'..'\u2040' / '\u2054' / '\u2060'..'\u2063' / '\u206a'..'\u206f' / '\u2071' / '\u207f' / '\u20a0'..'\u20b1' / '\u20d0'..'\u20dc' / '\u20e1' / '\u20e5'..'\u20ea' / '\u2102' / '\u2107' / '\u210a'..'\u2113' / '\u2115' / '\u2119'..'\u211d' / '\u2124' / '\u2126' / '\u2128' / '\u212a'..'\u212d' / '\u212f'..'\u2131' / '\u2133'..'\u2139' / '\u213d'..'\u213f' / '\u2145'..'\u2149' / '\u2160'..'\u2183' / '\u3005'..'\u3007' / '\u3021'..'\u302f' / '\u3031'..'\u3035' / '\u3038'..'\u303c' / '\u3041'..'\u3096' / '\u3099'..'\u309a' / '\u309d'..'\u309f' / '\u30a1'..'\u30ff' / '\u3105'..'\u312c' / '\u3131'..'\u318e' / '\u31a0'..'\u31b7' / '\u31f0'..'\u31ff' / '\u3400'..'\u4db5' / '\u4e00'..'\u9fa5' / '\ua000'..'\ua48c' / '\uac00'..'\ud7a3' / '\uf900'..'\ufa2d' / '\ufa30'..'\ufa6a' / '\ufb00'..'\ufb06' / '\ufb13'..'\ufb17' / '\ufb1d'..'\ufb28' / '\ufb2a'..'\ufb36' / '\ufb38'..'\ufb3c' / '\ufb3e' / '\ufb40'..'\ufb41' / '\ufb43'..'\ufb44' / '\ufb46'..'\ufbb1' / '\ufbd3'..'\ufd3d' / '\ufd50'..'\ufd8f' / '\ufd92'..'\ufdc7' / '\ufdf0'..'\ufdfc' / '\ufe00'..'\ufe0f' / '\ufe20'..'\ufe23' / '\ufe33'..'\ufe34' / '\ufe4d'..'\ufe4f' / '\ufe69' / '\ufe70'..'\ufe74' / '\ufe76'..'\ufefc' / '\ufeff' / '\uff04' / '\uff10'..'\uff19' / '\uff21'..'\uff3a' / '\uff3f' / '\uff41'..'\uff5a' / '\uff65'..'\uffbe' / '\uffc2'..'\uffc7' / '\uffca'..'\uffcf' / '\uffd2'..'\uffd7' / '\uffda'..'\uffdc' / '\uffe0'..'\uffe1' / '\uffe5'..'\uffe6' / '\ufff9'..'\ufffb' / ('\ud800'..'\udbff') ('\udc00'..'\udfff')"! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/3/2009 16:00'! IdentifierStart #letter "'\u0024' / '\u0041'..'\u005a' / '\u005f' / '\u0061'..'\u007a' / '\u00a2'..'\u00a5' / '\u00aa' / '\u00b5' / '\u00ba' / '\u00c0'..'\u00d6' / '\u00d8'..'\u00f6' / '\u00f8'..'\u0236' / '\u0250'..'\u02c1' / '\u02c6'..'\u02d1' / '\u02e0'..'\u02e4' / '\u02ee' / '\u037a' / '\u0386' / '\u0388'..'\u038a' / '\u038c' / '\u038e'..'\u03a1' / '\u03a3'..'\u03ce' / '\u03d0'..'\u03f5' / '\u03f7'..'\u03fb' / '\u0400'..'\u0481' / '\u048a'..'\u04ce' / '\u04d0'..'\u04f5' / '\u04f8'..'\u04f9' / '\u0500'..'\u050f' / '\u0531'..'\u0556' / '\u0559' / '\u0561'..'\u0587' / '\u05d0'..'\u05ea' / '\u05f0'..'\u05f2' / '\u0621'..'\u063a' / '\u0640'..'\u064a' / '\u066e'..'\u066f' / '\u0671'..'\u06d3' / '\u06d5' / '\u06e5'..'\u06e6' / '\u06ee'..'\u06ef' / '\u06fa'..'\u06fc' / '\u06ff' / '\u0710' / '\u0712'..'\u072f' / '\u074d'..'\u074f' / '\u0780'..'\u07a5' / '\u07b1' / '\u0904'..'\u0939' / '\u093d' / '\u0950' / '\u0958'..'\u0961' / '\u0985'..'\u098c' / '\u098f'..'\u0990' / '\u0993'..'\u09a8' / '\u09aa'..'\u09b0' / '\u09b2' / '\u09b6'..'\u09b9' / '\u09bd' / '\u09dc'..'\u09dd' / '\u09df'..'\u09e1' / '\u09f0'..'\u09f3' / '\u0a05'..'\u0a0a' / '\u0a0f'..'\u0a10' / '\u0a13'..'\u0a28' / '\u0a2a'..'\u0a30' / '\u0a32'..'\u0a33' / '\u0a35'..'\u0a36' / '\u0a38'..'\u0a39' / '\u0a59'..'\u0a5c' / '\u0a5e' / '\u0a72'..'\u0a74' / '\u0a85'..'\u0a8d' / '\u0a8f'..'\u0a91' / '\u0a93'..'\u0aa8' / '\u0aaa'..'\u0ab0' / '\u0ab2'..'\u0ab3' / '\u0ab5'..'\u0ab9' / '\u0abd' / '\u0ad0' / '\u0ae0'..'\u0ae1' / '\u0af1' / '\u0b05'..'\u0b0c' / '\u0b0f'..'\u0b10' / '\u0b13'..'\u0b28' / '\u0b2a'..'\u0b30' / '\u0b32'..'\u0b33' / '\u0b35'..'\u0b39' / '\u0b3d' / '\u0b5c'..'\u0b5d' / '\u0b5f'..'\u0b61' / '\u0b71' / '\u0b83' / '\u0b85'..'\u0b8a' / '\u0b8e'..'\u0b90' / '\u0b92'..'\u0b95' / '\u0b99'..'\u0b9a' / '\u0b9c' / '\u0b9e'..'\u0b9f' / '\u0ba3'..'\u0ba4' / '\u0ba8'..'\u0baa' / '\u0bae'..'\u0bb5' / '\u0bb7'..'\u0bb9' / '\u0bf9' / '\u0c05'..'\u0c0c' / '\u0c0e'..'\u0c10' / '\u0c12'..'\u0c28' / '\u0c2a'..'\u0c33' / '\u0c35'..'\u0c39' / '\u0c60'..'\u0c61' / '\u0c85'..'\u0c8c' / '\u0c8e'..'\u0c90' / '\u0c92'..'\u0ca8' / '\u0caa'..'\u0cb3' / '\u0cb5'..'\u0cb9' / '\u0cbd' / '\u0cde' / '\u0ce0'..'\u0ce1' / '\u0d05'..'\u0d0c' / '\u0d0e'..'\u0d10' / '\u0d12'..'\u0d28' / '\u0d2a'..'\u0d39' / '\u0d60'..'\u0d61' / '\u0d85'..'\u0d96' / '\u0d9a'..'\u0db1' / '\u0db3'..'\u0dbb' / '\u0dbd' / '\u0dc0'..'\u0dc6' / '\u0e01'..'\u0e30' / '\u0e32'..'\u0e33' / '\u0e3f'..'\u0e46' / '\u0e81'..'\u0e82' / '\u0e84' / '\u0e87'..'\u0e88' / '\u0e8a' / '\u0e8d' / '\u0e94'..'\u0e97' / '\u0e99'..'\u0e9f' / '\u0ea1'..'\u0ea3' / '\u0ea5' / '\u0ea7' / '\u0eaa'..'\u0eab' / '\u0ead'..'\u0eb0' / '\u0eb2'..'\u0eb3' / '\u0ebd' / '\u0ec0'..'\u0ec4' / '\u0ec6' / '\u0edc'..'\u0edd' / '\u0f00' / '\u0f40'..'\u0f47' / '\u0f49'..'\u0f6a' / '\u0f88'..'\u0f8b' / '\u1000'..'\u1021' / '\u1023'..'\u1027' / '\u1029'..'\u102a' / '\u1050'..'\u1055' / '\u10a0'..'\u10c5' / '\u10d0'..'\u10f8' / '\u1100'..'\u1159' / '\u115f'..'\u11a2' / '\u11a8'..'\u11f9' / '\u1200'..'\u1206' / '\u1208'..'\u1246' / '\u1248' / '\u124a'..'\u124d' / '\u1250'..'\u1256' / '\u1258' / '\u125a'..'\u125d' / '\u1260'..'\u1286' / '\u1288' / '\u128a'..'\u128d' / '\u1290'..'\u12ae' / '\u12b0' / '\u12b2'..'\u12b5' / '\u12b8'..'\u12be' / '\u12c0' / '\u12c2'..'\u12c5' / '\u12c8'..'\u12ce' / '\u12d0'..'\u12d6' / '\u12d8'..'\u12ee' / '\u12f0'..'\u130e' / '\u1310' / '\u1312'..'\u1315' / '\u1318'..'\u131e' / '\u1320'..'\u1346' / '\u1348'..'\u135a' / '\u13a0'..'\u13f4' / '\u1401'..'\u166c' / '\u166f'..'\u1676' / '\u1681'..'\u169a' / '\u16a0'..'\u16ea' / '\u16ee'..'\u16f0' / '\u1700'..'\u170c' / '\u170e'..'\u1711' / '\u1720'..'\u1731' / '\u1740'..'\u1751' / '\u1760'..'\u176c' / '\u176e'..'\u1770' / '\u1780'..'\u17b3' / '\u17d7' / '\u17db'..'\u17dc' / '\u1820'..'\u1877' / '\u1880'..'\u18a8' / '\u1900'..'\u191c' / '\u1950'..'\u196d' / '\u1970'..'\u1974' / '\u1d00'..'\u1d6b' / '\u1e00'..'\u1e9b' / '\u1ea0'..'\u1ef9' / '\u1f00'..'\u1f15' / '\u1f18'..'\u1f1d' / '\u1f20'..'\u1f45' / '\u1f48'..'\u1f4d' / '\u1f50'..'\u1f57' / '\u1f59' / '\u1f5b' / '\u1f5d' / '\u1f5f'..'\u1f7d' / '\u1f80'..'\u1fb4' / '\u1fb6'..'\u1fbc' / '\u1fbe' / '\u1fc2'..'\u1fc4' / '\u1fc6'..'\u1fcc' / '\u1fd0'..'\u1fd3' / '\u1fd6'..'\u1fdb' / '\u1fe0'..'\u1fec' / '\u1ff2'..'\u1ff4' / '\u1ff6'..'\u1ffc' / '\u203f'..'\u2040' / '\u2054' / '\u2071' / '\u207f' / '\u20a0'..'\u20b1' / '\u2102' / '\u2107' / '\u210a'..'\u2113' / '\u2115' / '\u2119'..'\u211d' / '\u2124' / '\u2126' / '\u2128' / '\u212a'..'\u212d' / '\u212f'..'\u2131' / '\u2133'..'\u2139' / '\u213d'..'\u213f' / '\u2145'..'\u2149' / '\u2160'..'\u2183' / '\u3005'..'\u3007' / '\u3021'..'\u3029' / '\u3031'..'\u3035' / '\u3038'..'\u303c' / '\u3041'..'\u3096' / '\u309d'..'\u309f' / '\u30a1'..'\u30ff' / '\u3105'..'\u312c' / '\u3131'..'\u318e' / '\u31a0'..'\u31b7' / '\u31f0'..'\u31ff' / '\u3400'..'\u4db5' / '\u4e00'..'\u9fa5' / '\ua000'..'\ua48c' / '\uac00'..'\ud7a3' / '\uf900'..'\ufa2d' / '\ufa30'..'\ufa6a' / '\ufb00'..'\ufb06' / '\ufb13'..'\ufb17' / '\ufb1d' / '\ufb1f'..'\ufb28' / '\ufb2a'..'\ufb36' / '\ufb38'..'\ufb3c' / '\ufb3e' / '\ufb40'..'\ufb41' / '\ufb43'..'\ufb44' / '\ufb46'..'\ufbb1' / '\ufbd3'..'\ufd3d' / '\ufd50'..'\ufd8f' / '\ufd92'..'\ufdc7' / '\ufdf0'..'\ufdfc' / '\ufe33'..'\ufe34' / '\ufe4d'..'\ufe4f' / '\ufe69' / '\ufe70'..'\ufe74' / '\ufe76'..'\ufefc' / '\uff04' / '\uff21'..'\uff3a' / '\uff3f' / '\uff41'..'\uff5a' / '\uff65'..'\uffbe' / '\uffc2'..'\uffc7' / '\uffca'..'\uffcf' / '\uffd2'..'\uffd7' / '\uffda'..'\uffdc' / '\uffe0'..'\uffe1' / '\uffe5'..'\uffe6' / ('\ud800'..'\udbff') ('\udc00'..'\udfff')"! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/5/2009 15:16'! IntegerNumber ($0) / (($1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) , ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) star) / ($0 , ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) plus) / (HexPrefix , HexDigit plus)! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:22'! LBRACE '{' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:22'! LBRACKET '[' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! LONG 'long' token! ! !LBJavaGrammar methodsFor: 'token' stamp: 'lr 5/7/2009 13:48'! LONGLITERAL (IntegerNumber , LongSuffix) token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:22'! LPAREN '(' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:22'! LT '<' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 12:09'! LTEQ '<=' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 12:11'! LTLT '<<' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:37'! LTLTEQ '<<=' token! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/5/2009 15:16'! LongSuffix $l / $L! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! MONKEYSAT '@' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! NATIVE 'native' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! NEW 'new' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! NULL 'null' token! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/5/2009 15:17'! NonIntegerNumber (($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) plus , $. , ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) star , Exponent optional) / ($. , ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) plus , Exponent optional) / (($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) plus , Exponent) / (($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) plus) / (HexPrefix , HexDigit star , ($. , HexDigit star) optional , ($p / $P) , ($+ / $-) optional , ($0 / $1 / $2 / $3 / $4 / $5 / $6 / $7 / $8 / $9) plus)! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! PACKAGE 'package' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! PERCENT '%' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! PERCENTEQ '%=' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! PLUS '+' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! PLUSEQ '+=' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! PLUSPLUS '++' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! PRIVATE 'private' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! PROTECTED 'protected' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! PUBLIC 'public' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! QUES '?' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! RBRACE '}' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! RBRACKET ']' token ! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! RETURN 'return' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! RPAREN ')' token ! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! SEMI ';' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! SHORT 'short' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! SLASH '/' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:23'! SLASHEQ '/=' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:24'! STAR '*' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:24'! STAREQ '*=' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! STATIC 'static' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! STRICTFP 'strictfp' token! ! !LBJavaGrammar methodsFor: 'token' stamp: 'lr 5/7/2009 14:18'! STRINGLITERAL ($" , (EscapeSequence / (($" / $\ / '\r' / '\n') not , #any)) star , $") token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:24'! SUB '-' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:24'! SUBEQ '-=' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:24'! SUBSUB '--' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! SUPER 'super' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! SWITCH 'switch' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! SYNCHRONIZED 'synchronized' token! ! !LBJavaGrammar methodsFor: 'token-private' stamp: 'lr 5/3/2009 15:58'! SurrogateIdentifer #word "('\ud800'..'\udbff') ('\udc00'..'\udfff')"! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:19'! THIS 'this' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:20'! THROW 'throw' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:20'! THROWS 'throws' token! ! !LBJavaGrammar methodsFor: 'token-chars' stamp: 'lr 5/5/2009 10:24'! TILDE '~' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:20'! TRANSIENT 'transient' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:20'! TRUE 'true' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:20'! TRY 'try' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:20'! VOID 'void' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:20'! VOLATILE 'volatile' token! ! !LBJavaGrammar methodsFor: 'token-keywords' stamp: 'lr 5/5/2009 10:20'! WHILE 'while' token! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:46'! additiveExpression multiplicativeExpression , ((PLUS / SUB) , multiplicativeExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/3/2009 16:32'! andExpression equalityExpression , (AMP , equalityExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:26'! annotation MONKEYSAT , qualifiedName , (LPAREN , (elementValuePairs / elementValue) optional , RPAREN) optional! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:05'! annotationHeader modifiers , MONKEYSAT , INTERFACE , IDENTIFIER! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:27'! annotationMethodDeclaration modifiers , type , IDENTIFIER , LPAREN , RPAREN , (DEFAULT , elementValue) optional , SEMI! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:28'! annotationTypeBody LBRACE , (annotationTypeElementDeclaration) star , RBRACE! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:28'! annotationTypeDeclaration modifiers , MONKEYSAT , INTERFACE , IDENTIFIER , annotationTypeBody! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:29'! annotationTypeElementDeclaration annotationMethodDeclaration / interfaceFieldDeclaration / normalClassDeclaration / normalInterfaceDeclaration / enumDeclaration / annotationTypeDeclaration / SEMI! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:29'! annotations annotation plus! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:30'! arguments LPAREN , expressionList optional , RPAREN! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:33'! arrayCreator (NEW , createdName , (LBRACKET , RBRACKET) plus , arrayInitializer) / (NEW , createdName , (LBRACKET , expression , RBRACKET) plus , (LBRACKET , RBRACKET) star)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:34'! arrayInitializer LBRACE , (variableInitializer , (COMMA , variableInitializer) star) optional , COMMA optional , RBRACE! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:37'! assignmentOperator EQ / PLUSEQ / SUBEQ / STAREQ / SLASHEQ / AMPEQ / BAREQ / CARETEQ / PERCENTEQ / LTLTEQ / GTGTGTEQ / GTGTEQ! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:38'! block LBRACE , blockStatement star , RBRACE! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 10:38'! blockStatement localVariableDeclarationStatement / classOrInterfaceDeclaration / statement! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:06'! castExpression (LPAREN , primitiveType , RPAREN , unaryExpression) / (LPAREN , type , RPAREN , unaryExpressionNotPlusMinus)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:06'! catchClause CATCH , LPAREN , formalParameter , RPAREN , block! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:06'! catches catchClause , catchClause star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:07'! classBody LBRACE , classBodyDeclaration star , RBRACE! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:07'! classBodyDeclaration (SEMI) / (STATIC optional , block) / (memberDecl)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:08'! classCreatorRest arguments , classBody optional! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:08'! classDeclaration normalClassDeclaration / enumDeclaration! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:08'! classHeader modifiers , CLASS , IDENTIFIER! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:08'! classOrInterfaceDeclaration classDeclaration / interfaceDeclaration! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:09'! classOrInterfaceType IDENTIFIER , typeArguments optional , (DOT , IDENTIFIER , typeArguments optional) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:09'! compilationUnit annotations optional , packageDeclaration optional , importDeclaration star , typeDeclaration star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:10'! conditionalAndExpression inclusiveOrExpression , (AMPAMP , inclusiveOrExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:10'! conditionalExpression conditionalOrExpression , (QUES , expression , COLON , conditionalExpression) optional! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:11'! conditionalOrExpression conditionalAndExpression , (BARBAR , conditionalAndExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:11'! createdName classOrInterfaceType / primitiveType! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:12'! creator (NEW , nonWildcardTypeArguments , classOrInterfaceType , classCreatorRest) / (NEW , classOrInterfaceType , classCreatorRest) / (arrayCreator)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:12'! elementValue conditionalExpression / annotation / elementValueArrayInitializer! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/7/2009 14:02'! elementValueArrayInitializer LBRACE , (elementValue delimitedBy: COMMA) star , RBRACE! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:13'! elementValuePair IDENTIFIER , EQ , elementValue! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:13'! elementValuePairs elementValuePair , (COMMA , elementValuePair) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:14'! ellipsisParameterDecl variableModifiers , type , ELLIPSIS , IDENTIFIER! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:14'! enumBody LBRACE , enumConstants optional , COMMA optional , enumBodyDeclarations optional , RBRACE! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:15'! enumBodyDeclarations SEMI , classBodyDeclaration star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:15'! enumConstant annotations optional , IDENTIFIER , arguments optional , classBody optional! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:15'! enumConstants enumConstant , (COMMA , enumConstant) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:06'! enumDeclaration modifiers , ENUM , IDENTIFIER , (IMPLEMENTS , typeList) optional , enumBody! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:16'! enumHeader modifiers , (ENUM / IDENTIFIER) , IDENTIFIER! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:17'! equalityExpression instanceOfExpression , ((EQEQ / BANGEQ) , instanceOfExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:17'! exclusiveOrExpression andExpression , (CARET , andExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:19'! explicitConstructorInvocation (nonWildcardTypeArguments optional , (THIS / SUPER) , arguments , SEMI) / (primary , DOT , nonWildcardTypeArguments optional , SUPER , arguments , SEMI)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:29'! expression conditionalExpression , (assignmentOperator , expression) optional! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:20'! expressionList expression , (COMMA , expression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:20'! fieldDeclaration modifiers , type , variableDeclarator , (COMMA , variableDeclarator) star , SEMI! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:21'! fieldHeader modifiers , type , IDENTIFIER , (LBRACKET , RBRACKET) star , (EQ / COMMA / SEMI)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:21'! forInit localVariableDeclaration / expressionList! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:07'! formalParameter variableModifiers , type , IDENTIFIER , (LBRACKET , RBRACKET) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:24'! formalParameterDecls (ellipsisParameterDecl) / (normalParameterDecl , (COMMA , normalParameterDecl) star) / ((normalParameterDecl , COMMA) plus , ellipsisParameterDecl)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:25'! formalParameters LPAREN , formalParameterDecls optional , RPAREN! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:25'! forstatement forstatementEnhanced / forstatementNormal! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:27'! forstatementEnhanced FOR , LPAREN , variableModifiers , type , IDENTIFIER , COLON , expression , RPAREN , statement! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:26'! forstatementNormal FOR , LPAREN , forInit optional , SEMI , expression optional , SEMI , expressionList optional , RPAREN , statement! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:50'! identifierSuffix ((LBRACKET , RBRACKET) plus , DOT , CLASS) / ((LBRACKET , expression , RBRACKET) plus) / (arguments) / (DOT , CLASS) / (DOT , nonWildcardTypeArguments , IDENTIFIER , arguments) / (DOT , THIS) / (DOT , SUPER , arguments) / (innerCreator)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:53'! importDeclaration (IMPORT , STATIC optional , IDENTIFIER , DOT , STAR , SEMI) / (IMPORT , STATIC optional , IDENTIFIER , (DOT , IDENTIFIER) plus , (DOT , STAR) optional , SEMI)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:53'! inclusiveOrExpression exclusiveOrExpression , (BAR , exclusiveOrExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:54'! innerCreator DOT , NEW , nonWildcardTypeArguments optional , IDENTIFIER , typeArguments optional , classCreatorRest! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:54'! instanceOfExpression relationalExpression , (INSTANCEOF , type) optional! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:55'! interfaceBody LBRACE , interfaceBodyDeclaration star , RBRACE! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:55'! interfaceBodyDeclaration interfaceFieldDeclaration / interfaceMethodDeclaration / interfaceDeclaration / classDeclaration / SEMI! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:56'! interfaceDeclaration normalInterfaceDeclaration / annotationTypeDeclaration! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:56'! interfaceFieldDeclaration modifiers , type , variableDeclarator , (COMMA , variableDeclarator) star , SEMI! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:56'! interfaceHeader modifiers , INTERFACE , IDENTIFIER! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:58'! interfaceMethodDeclaration modifiers , typeParameters optional , (type / VOID) , IDENTIFIER , formalParameters , (LBRACKET , RBRACKET) star , (THROWS , qualifiedNameList) optional , SEMI! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:58'! literal INTLITERAL / LONGLITERAL / FLOATLITERAL / DOUBLELITERAL / CHARLITERAL / STRINGLITERAL / TRUE / FALSE / NULL! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:59'! localVariableDeclaration variableModifiers , type , variableDeclarator , (COMMA , variableDeclarator) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:59'! localVariableDeclarationStatement localVariableDeclaration , SEMI! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 11:59'! localVariableHeader variableModifiers , type , IDENTIFIER , (LBRACKET , RBRACKET) star , (EQ / COMMA / SEMI)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:00'! memberDecl fieldDeclaration / methodDeclaration / classDeclaration / interfaceDeclaration! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:05'! methodDeclaration (modifiers , typeParameters optional , IDENTIFIER , formalParameters , (THROWS , qualifiedNameList) optional , LBRACE , explicitConstructorInvocation optional , blockStatement star , RBRACE) / (modifiers , typeParameters optional , (type / VOID) , IDENTIFIER , formalParameters , (LBRACKET , RBRACKET) star , (THROWS , qualifiedNameList) optional , (block / SEMI))! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:01'! methodHeader modifiers , typeParameters optional , (type / VOID) optional , IDENTIFIER , LPAREN! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:03'! modifiers (annotation / PUBLIC / PROTECTED / PRIVATE / STATIC / ABSTRACT / FINAL / NATIVE / SYNCHRONIZED / TRANSIENT / VOLATILE / STRICTFP) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 15:17'! multiplicativeExpression unaryExpression . ((STAR / SLASH / PERCENT) , unaryExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:04'! nonWildcardTypeArguments LT , typeList , GT! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:05'! normalClassDeclaration modifiers , CLASS , IDENTIFIER , typeParameters optional , (EXTENDS , type) optional , (IMPLEMENTS , typeList) optional , classBody! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:05'! normalInterfaceDeclaration modifiers , INTERFACE , IDENTIFIER , typeParameters optional , (EXTENDS , typeList) optional , interfaceBody! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:06'! normalParameterDecl variableModifiers , type , IDENTIFIER , (LBRACKET , RBRACKET) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:06'! packageDeclaration PACKAGE , qualifiedName , SEMI! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:06'! parExpression LPAREN , expression , RPAREN! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:00'! primary (parExpression) / (THIS , (DOT , IDENTIFIER) star , identifierSuffix optional) / (IDENTIFIER , (DOT , IDENTIFIER) star , identifierSuffix optional) / (SUPER , superSuffix) / (literal) / (creator) / (primitiveType , (LBRACKET , RBRACKET) star , DOT , CLASS) / (VOID , DOT , CLASS)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:06'! primitiveType BOOLEAN / CHAR / BYTE / SHORT / INT / LONG / FLOAT / DOUBLE! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/7/2009 13:53'! qualifiedImportName IDENTIFIER separatedBy: DOT! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/7/2009 13:51'! qualifiedName IDENTIFIER separatedBy: DOT! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/7/2009 13:52'! qualifiedNameList qualifiedName separatedBy: COMMA! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:09'! relationalExpression shiftExpression , (relationalOp , shiftExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:10'! relationalOp LTEQ / GTEQ / LT / GT! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:33'! selector (DOT , IDENTIFIER , arguments optional) / (DOT , THIS) / (DOT , SUPER , superSuffix) / (innerCreator) / (LBRACKET , expression , RBRACKET)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:10'! shiftExpression additiveExpression , (shiftOp , additiveExpression) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:11'! shiftOp LTLT / GTGTGT / GTGT! ! !LBJavaGrammar methodsFor: 'accessing' stamp: 'lr 5/5/2009 11:28'! start compilationUnit! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:07'! statement (block) / (ASSERT , expression , (COLON , expression) optional , SEMI) / (IF , parExpression , statement , (ELSE , statement) optional) / (forstatement) / (WHILE , parExpression , statement) / (DO , statement , WHILE , parExpression , SEMI) / (trystatement) / (SWITCH , parExpression , LBRACE , switchBlockStatementGroups , RBRACE) / (SYNCHRONIZED , parExpression , block) / (RETURN , expression optional , SEMI) / (THROW , expression , SEMI) / (BREAK , IDENTIFIER optional , SEMI) / (CONTINUE , IDENTIFIER optional , SEMI) / (expression , SEMI) / (IDENTIFIER , COLON , statement) / (SEMI)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:31'! superSuffix (arguments) / (DOT , typeArguments optional , IDENTIFIER , arguments optional)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:19'! switchBlockStatementGroup switchLabel , blockStatement star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:20'! switchBlockStatementGroups switchBlockStatementGroup star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:20'! switchLabel (CASE , expression , COLON) / (DEFAULT , COLON)! ! !LBJavaGrammar methodsFor: 'private' stamp: 'lr 6/23/2009 10:57'! tokenParser ^ LBJavaCommentGrammar! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:21'! trystatement TRY , block , ((catches , FINALLY , block) / catches / (FINALLY , block))! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:23'! type (classOrInterfaceType , (LBRACKET , RBRACKET) star) / (primitiveType , (LBRACKET , RBRACKET) star)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:24'! typeArgument type / (QUES , ((EXTENDS / SUPER) , type) optional)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:24'! typeArguments LT , typeArgument , (COMMA , typeArgument) star , GT! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:25'! typeBound type , (AMP , type) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:25'! typeDeclaration classOrInterfaceDeclaration / SEMI! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:26'! typeHeader modifiers , (CLASS / ENUM / (MONKEYSAT optional , INTERFACE)) , IDENTIFIER! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:26'! typeList type , (COMMA , type) star! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:26'! typeParameter IDENTIFIER , (EXTENDS , typeBound) optional! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:26'! typeParameters LT , typeParameter , (COMMA , typeParameter) star , GT! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 14:06'! unaryExpression (PLUS , unaryExpression) / (SUB , unaryExpression) / (PLUS , unaryExpression) / (SUBSUB , unaryExpression) / (unaryExpressionNotPlusMinus)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:29'! unaryExpressionNotPlusMinus (TILDE , unaryExpression) / (BANG , unaryExpression) / (castExpression) / (primary , selector star , (PLUSPLUS / SUBSUB) optional)! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:31'! variableDeclarator IDENTIFIER , (LBRACKET , RBRACKET) star , (EQ , variableInitializer) optional! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:30'! variableInitializer arrayInitializer / expression! ! !LBJavaGrammar methodsFor: 'parser' stamp: 'lr 5/5/2009 12:30'! variableModifiers (FINAL / annotation) star! ! CUCompositeParser subclass: #LBSmalltalkGrammar instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Grammar-Smalltalk'! LBSmalltalkGrammar subclass: #LBSmalltalkCompiler instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Grammar-Smalltalk'! !LBSmalltalkCompiler class methodsFor: 'accessing' stamp: 'lr 1/19/2009 09:30'! concern ^ #compile:! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 1/30/2009 09:58'! array super array ==> [ :nodes | RBArrayNode leftBrace: nodes first rightBrace: nodes last statements: nodes second ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:06'! arrayLiteral super arrayLiteral ==> [ :nodes | RBLiteralNode value: nodes second asArray ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 14:21'! arrayLiteralArray super arrayLiteralArray ==> [ :nodes | nodes second asArray ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 1/30/2009 09:57'! arrayLiteralByte super arrayLiteralByte ==> [ :nodes | nodes second asByteArray ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:19'! arrayLiteralChar super arrayLiteralChar ==> [ :token | token value second ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:15'! arrayLiteralFalse super arrayLiteralFalse ==> [ :token | false ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:14'! arrayLiteralNil super arrayLiteralNil ==> [ :token | nil ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:14'! arrayLiteralNumber super arrayLiteralNumber ==> [ :token | Number readFrom: token value ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/24/2008 11:50'! arrayLiteralString super arrayLiteralString ==> [ :token | self buildString: token value ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/24/2008 11:51'! arrayLiteralSymbol super arrayLiteralSymbol ==> [ :token | (self buildString: token value) asSymbol ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:15'! arrayLiteralTrue super arrayLiteralTrue ==> [ :token | true ]! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 9/26/2008 11:33'! assignment super assignment ==> #first! ! !LBSmalltalkCompiler methodsFor: 'grammar-messages' stamp: 'lr 10/24/2008 11:00'! binaryExpression super binaryExpression map: [ :receiver :messages | self build: receiver messages: messages ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:27'! block super block ==> #second! ! !LBSmalltalkCompiler methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:46'! blockArgument super blockArgument ==> #second! ! !LBSmalltalkCompiler methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:38'! blockArgumentsEmpty super blockArgumentsEmpty ==> [ :nodes | #() ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:37'! blockBody super blockBody ==> [ :nodes | RBBlockNode arguments: nodes first body: nodes last ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:38'! blockSequenceEmpty super blockSequenceEmpty ==> [ :nodes | RBSequenceNode statements: #() ]! ! !LBSmalltalkCompiler methodsFor: 'private' stamp: 'lr 10/24/2008 11:54'! build: aNode assignment: anArray ^ anArray isEmpty ifTrue: [ aNode ] ifFalse: [ anArray reverse inject: aNode into: [ :result :each | RBAssignmentNode variable: each value: result ] ]! ! !LBSmalltalkCompiler methodsFor: 'private' stamp: 'lr 4/6/2009 15:16'! build: aNode cascade: anArray | messages | ^ (anArray isNil or: [ anArray isEmpty ]) ifTrue: [ aNode ] ifFalse: [ messages := OrderedCollection new: anArray size + 1. messages addLast: aNode. anArray do: [ :each | messages addLast: (self build: aNode receiver messages: (Array with: each second)) ]. RBCascadeNode messages: messages ]! ! !LBSmalltalkCompiler methodsFor: 'private' stamp: 'lr 10/24/2008 11:28'! build: aNode messages: anArray ^ (anArray isNil or: [ anArray isEmpty ]) ifTrue: [ aNode ] ifFalse: [ anArray inject: aNode into: [ :receiver :message | message isNil ifTrue: [ receiver ] ifFalse: [ RBMessageNode receiver: receiver selectorParts: message first arguments: message second ] ] ]! ! !LBSmalltalkCompiler methodsFor: 'private' stamp: 'lr 10/24/2008 11:37'! build: aTempCollection sequence: aStatementCollection ^ (aTempCollection isEmpty ifTrue: [ RBSequenceNode new ] ifFalse: [ RBSequenceNode leftBar: aTempCollection first temporaries: aTempCollection second rightBar: aTempCollection last ]) statements: aStatementCollection; yourself ! ! !LBSmalltalkCompiler methodsFor: 'private' stamp: 'lr 10/24/2008 12:12'! buildPragma: anArray ^ Pragma keyword: (anArray first inject: String new into: [ :result :each | result , each value ]) asSymbol arguments: anArray second! ! !LBSmalltalkCompiler methodsFor: 'private' stamp: 'lr 10/24/2008 11:51'! buildString: aString (aString isEmpty not and: [ aString first = $# ]) ifTrue: [ ^ (self buildString: aString allButFirst) asSymbol ]. (aString isEmpty or: [ aString first ~= $' or: [ aString last ~= $' ] ]) ifTrue: [ ^ aString ]. ^ (aString copyFrom: 2 to: aString size - 1) copyReplaceAll: '''''' with: ''''! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 1/30/2009 09:58'! byteLiteral super byteLiteral ==> [ :nodes | RBLiteralNode value: nodes second asByteArray ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-messages' stamp: 'lr 10/24/2008 11:51'! cascadeExpression super cascadeExpression map: [ :receiver :messages | self build: receiver cascade: messages ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:16'! charLiteral super charLiteral ==> [ :token | RBLiteralNode literalToken: token value: token value second ]! ! !LBSmalltalkCompiler methodsFor: 'accessing' stamp: 'lr 3/27/2009 14:58'! doIt: aBoolean "Make sure that the all parsers read the complete input." super doIt: aBoolean. parser := parser end! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 3/27/2009 14:58'! doit super doit map: [ :body | RBDoItNode body: body ]! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 10/24/2008 11:55'! expression super expression map: [ :variables :expression | self build: expression assignment: variables ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:16'! falseLiteral super falseLiteral ==> [ :token | RBLiteralNode literalToken: token value: false ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-messages' stamp: 'lr 10/24/2008 11:23'! keywordExpression super keywordExpression map: [ :receiver :message | self build: receiver messages: (Array with: message) ]! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 5/18/2009 11:36'! method super method map: [ :declaration :body | declaration pragmas: body first. declaration body: (self build: body second sequence: body third). declaration ]! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 10/24/2008 10:50'! methodDeclaration super methodDeclaration ==> [ :nodes | RBMethodNode selectorParts: nodes first arguments: nodes second ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/13/2008 17:16'! nilLiteral super nilLiteral ==> [ :token | RBLiteralNode literalToken: token value: nil ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/13/2008 17:17'! numberLiteral super numberLiteral ==> [ :token | RBLiteralNode literalToken: token value: (Number readFrom: token value) ]! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 10/17/2008 15:40'! parens super parens ==> #second! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 10/24/2008 12:12'! pragma super pragma ==> [ :nodes | | pragma | pragma := self buildPragma: nodes second. RBPragmaNode pragma: pragma spec: pragma keyword start: nodes first start stop: nodes last stop firstToken: nodes first lastToken: nodes last ]! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 10/23/2008 17:09'! return super return map: [ :token :expression | RBReturnNode value: expression ]! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 10/24/2008 11:38'! sequence super sequence map: [ :temporaries :statements | self build: temporaries sequence: statements ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/24/2008 11:50'! stringLiteral super stringLiteral ==> [ :token | RBLiteralNode literalToken: token value: (self buildString: token value) ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/24/2008 11:50'! symbolLiteral super symbolLiteral ==> [ :node | RBLiteralNode literalToken: node value: (self buildString: node value) ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-literals' stamp: 'lr 10/13/2008 17:28'! trueLiteral super trueLiteral ==> [ :token | RBLiteralNode literalToken: token value: true ]! ! !LBSmalltalkCompiler methodsFor: 'grammar-messages' stamp: 'lr 10/24/2008 11:01'! unaryExpression super unaryExpression map: [ :receiver :messages | self build: receiver messages: messages ]! ! !LBSmalltalkCompiler methodsFor: 'grammar' stamp: 'lr 9/23/2008 20:02'! variable super variable ==> [ :token | RBVariableNode identifierToken: token ]! ! !LBSmalltalkGrammar class methodsFor: 'accessing' stamp: 'lr 6/23/2009 11:56'! compileUseLanguageBoxes ^ Preferences compileUseLanguageBoxes! ! !LBSmalltalkGrammar class methodsFor: 'accessing' stamp: 'lr 1/19/2009 09:30'! concern ^ nil! ! !LBSmalltalkGrammar class methodsFor: 'instance creation' stamp: 'lr 5/7/2009 10:38'! doIt: aBoolean ^ self new doIt: aBoolean; yourself! ! !LBSmalltalkGrammar class methodsFor: 'initialization' stamp: 'lr 6/23/2009 11:53'! initialize Preferences addPreference: #compileUseLanguageBoxes category: #compiler default: false balloonHelp: 'If true, language boxes are enabled for compiling methods. Only newly compiled methods will be affected by this preference. This requires the new compiler to be enabled.'! ! !LBSmalltalkGrammar class methodsFor: 'configuration' stamp: 'lr 6/23/2009 11:52'! languageBoxesHighlight ^ nil! ! !LBSmalltalkGrammar class methodsFor: 'configuration' stamp: 'lr 6/23/2009 11:53'! languageBoxesParser ^ nil! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 5/5/2009 14:26'! array ${ token , statements , $} token! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 5/5/2009 14:27'! arrayLiteral '#(' token , arrayLiteralElement star , $) token! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 5/5/2009 14:27'! arrayLiteralArray ($# optional , $() token , arrayLiteralElement star , $) token! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 5/5/2009 14:27'! arrayLiteralByte ($# optional , $[) token , arrayLiteralNumber star , $] token! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:11'! arrayLiteralChar charToken! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 1/30/2009 09:40'! arrayLiteralElement arrayLiteralTrue / arrayLiteralFalse / arrayLiteralNil / arrayLiteralNumber / arrayLiteralChar / arrayLiteralString / arrayLiteralSymbol / arrayLiteralArray / arrayLiteralByte! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:12'! arrayLiteralFalse falseToken! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:12'! arrayLiteralNil nilToken! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:12'! arrayLiteralNumber numberToken! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:12'! arrayLiteralString stringToken! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 5/5/2009 14:27'! arrayLiteralSymbol ($# optional , symbol) token! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/17/2008 11:11'! arrayLiteralTrue trueToken! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 9/23/2008 20:27'! assignment variable , assignmentToken! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:27'! assignmentToken (':=' / '_') token! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 10/17/2008 15:07'! binary ($~ / $- / $!! / $@ / $% / $& / $* / $+ / $= / $\ / $| / $? / $/ / $> / $< / $,) , ($~ / $!! / $@ / $% / $& / $* / $+ / $= / $\ / $| / $? / $/ / $> / $< / $,) star! ! !LBSmalltalkGrammar methodsFor: 'grammar-messages' stamp: 'lr 9/23/2008 18:43'! binaryExpression unaryExpression , binaryMessage star! ! !LBSmalltalkGrammar methodsFor: 'grammar-messages' stamp: 'lr 10/24/2008 10:54'! binaryMessage (binaryToken , unaryExpression) ==> [ :nodes | Array with: (Array with: nodes first) with: (Array with: nodes second) ]! ! !LBSmalltalkGrammar methodsFor: 'grammar-methods' stamp: 'lr 10/24/2008 10:48'! binaryMethod (binaryToken , variable) ==> [ :nodes | Array with: (Array with: nodes first) with: (Array with: nodes second) ]! ! !LBSmalltalkGrammar methodsFor: 'grammar-pragmas' stamp: 'lr 10/24/2008 11:57'! binaryPragma (binaryToken , arrayLiteralElement) ==> [ :nodes | Array with: (Array with: nodes first) with: (Array with: nodes second) ]! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:27'! binaryToken binary token! ! !LBSmalltalkGrammar methodsFor: 'grammar-blocks' stamp: 'lr 5/5/2009 14:27'! block $[ token , blockBody , $] token! ! !LBSmalltalkGrammar methodsFor: 'grammar-blocks' stamp: 'lr 5/5/2009 14:28'! blockArgument $: token , variable! ! !LBSmalltalkGrammar methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:40'! blockArguments blockArgument plus! ! !LBSmalltalkGrammar methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:34'! blockArgumentsEmpty epsilon! ! !LBSmalltalkGrammar methodsFor: 'grammar-blocks' stamp: 'lr 5/5/2009 14:28'! blockBody (blockArguments , $| token , blockSequence) / (blockArguments , epsilon , blockSequenceEmpty) / (blockArgumentsEmpty , epsilon , blockSequence)! ! !LBSmalltalkGrammar methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:36'! blockSequence sequence! ! !LBSmalltalkGrammar methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:36'! blockSequenceEmpty epsilon! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 5/5/2009 14:28'! byteLiteral '#[' token , arrayLiteralNumber star , $] token! ! !LBSmalltalkGrammar methodsFor: 'grammar-messages' stamp: 'lr 9/23/2008 19:29'! cascadeExpression keywordExpression , cascadeMessage star! ! !LBSmalltalkGrammar methodsFor: 'grammar-messages' stamp: 'lr 5/5/2009 14:28'! cascadeMessage $; token , message! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 10/17/2008 14:22'! char $$ , #any! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/13/2008 17:15'! charLiteral charToken! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:28'! charToken char token! ! !LBSmalltalkGrammar methodsFor: 'accessing' stamp: 'lr 3/27/2009 14:58'! doIt: aBoolean "Chose a different start rule depending on the type of parser required." parser := aBoolean ifTrue: [ self doit ] ifFalse: [ self method ]! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 3/27/2009 14:43'! doit sequence! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 3/26/2009 16:21'! epsilon PPEpsilonParser new! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 9/23/2008 20:27'! expression assignment star , cascadeExpression! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/13/2008 17:23'! falseLiteral falseToken! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:28'! falseToken ('false' , #word not) token! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 5/18/2009 14:49'! identifier #letter , (#word / '_') star! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:28'! identifierToken identifier token! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 10/17/2008 14:23'! keyword identifier , $:! ! !LBSmalltalkGrammar methodsFor: 'grammar-messages' stamp: 'lr 10/24/2008 11:11'! keywordExpression binaryExpression , keywordMessage optional! ! !LBSmalltalkGrammar methodsFor: 'grammar-messages' stamp: 'lr 10/24/2008 10:55'! keywordMessage (keywordToken , binaryExpression) plus ==> [ :nodes | Array with: (nodes collect: [ :each | each first ]) with: (nodes collect: [ :each | each second ]) ]! ! !LBSmalltalkGrammar methodsFor: 'grammar-methods' stamp: 'lr 10/24/2008 10:47'! keywordMethod (keywordToken , variable) plus ==> [ :nodes | Array with: (nodes collect: [ :each | each first ]) with: (nodes collect: [ :each | each second ]) ]! ! !LBSmalltalkGrammar methodsFor: 'grammar-pragmas' stamp: 'lr 10/24/2008 11:57'! keywordPragma (keywordToken , arrayLiteralElement) plus ==> [ :nodes | Array with: (nodes collect: [ :each | each first ]) with: (nodes collect: [ :each | each second ]) ]! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:29'! keywordToken keyword token! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 1/30/2009 09:58'! literal trueLiteral / falseLiteral / nilLiteral / charLiteral / numberLiteral / stringLiteral / symbolLiteral / arrayLiteral / byteLiteral! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 4/6/2009 11:05'! message keywordMessage / binaryMessage / unaryMessage! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 10/24/2008 10:40'! method methodDeclaration , methodSequence! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 10/24/2008 10:48'! methodDeclaration keywordMethod / unaryMethod / binaryMethod! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 5/5/2009 14:29'! methodSequence $. token star , pragmas , temporaries , pragmas , statements ==> [ :nodes | Array with: nodes second , nodes fourth with: nodes third with: nodes fifth ]! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 9/23/2008 21:06'! multiword keyword plus! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:29'! multiwordToken multiword token! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/13/2008 17:16'! nilLiteral nilToken! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:29'! nilToken ('nil' , #word not) token! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 1/30/2009 09:56'! number ($- optional , #digit) and , [ :stream | [ Number readFrom: stream ] on: Error do: [ :err | PPFailure reason: err messageText at: stream position ] ] asParser! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/13/2008 17:17'! numberLiteral numberToken! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:29'! numberToken number token! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 5/5/2009 14:29'! parens $( token , expression , $) token! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 5/5/2009 14:29'! pragma $< token , pragmaMessage , $> token! ! !LBSmalltalkGrammar methodsFor: 'grammar-pragmas' stamp: 'lr 4/6/2009 11:31'! pragmaMessage keywordPragma / unaryPragma / binaryPragma! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 10/20/2008 10:31'! pragmas pragma star! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 2/6/2009 11:23'! primary literal / variable / block / parens / array! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 5/5/2009 14:29'! return $^ token , expression! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 9/23/2008 20:00'! sequence temporaries , statements! ! !LBSmalltalkGrammar methodsFor: 'accessing' stamp: 'lr 5/7/2009 10:40'! start "The default start symbol is the 'method', but this method also initializes the start symbol 'doit'. The method #doIt: will initialize the parser with either of the two." (Array with: method with: doit) first! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 5/5/2009 14:30'! statements (return , $. token star ==> [ :nodes | Array with: nodes first ]) / (expression wrapped , $. token plus , statements ==> [ :nodes | nodes last copyWithFirst: nodes first ]) / (expression wrapped , $. token star ==> [ :nodes | Array with: nodes first ]) / ($. token star ==> [ :node | Array new ])! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 10/17/2008 14:23'! string $' , (($' , $') / $' negate) star , $'! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/13/2008 17:17'! stringLiteral stringToken! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:30'! stringToken string token! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 10/23/2008 13:50'! symbol unary / binary / multiword / string! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 5/5/2009 14:30'! symbolLiteral ($# , symbol) token! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:30'! symbolToken symbol token! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 5/5/2009 14:30'! temporaries ($| token , variable star , $| token) optional ==> [ :nodes | nodes isNil ifTrue: [ Array new ] ifFalse: [ nodes ] ]! ! !LBSmalltalkGrammar methodsFor: 'private' stamp: 'lr 5/4/2010 14:03'! tokenParser ^ LBSmalltalkTokenParser! ! !LBSmalltalkGrammar methodsFor: 'grammar-literals' stamp: 'lr 10/13/2008 17:18'! trueLiteral trueToken! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:30'! trueToken ('true' , #word not) token! ! !LBSmalltalkGrammar methodsFor: 'primitives' stamp: 'lr 10/17/2008 14:23'! unary identifier , $: not! ! !LBSmalltalkGrammar methodsFor: 'grammar-messages' stamp: 'lr 9/23/2008 19:07'! unaryExpression primary , unaryMessage star! ! !LBSmalltalkGrammar methodsFor: 'grammar-messages' stamp: 'lr 10/24/2008 10:55'! unaryMessage (unaryToken) ==> [ :node | Array with: (Array with: node) with: (Array new) ]! ! !LBSmalltalkGrammar methodsFor: 'grammar-methods' stamp: 'lr 10/24/2008 10:55'! unaryMethod (identifierToken) ==> [ :node | Array with: (Array with: node) with: (Array new) ]! ! !LBSmalltalkGrammar methodsFor: 'grammar-pragmas' stamp: 'lr 10/24/2008 11:56'! unaryPragma (identifierToken) ==> [ :node | Array with: (Array with: node) with: (Array new) ]! ! !LBSmalltalkGrammar methodsFor: 'token' stamp: 'lr 5/5/2009 14:30'! unaryToken unary token! ! !LBSmalltalkGrammar methodsFor: 'grammar' stamp: 'lr 9/23/2008 20:02'! variable identifierToken! ! LBSmalltalkGrammar subclass: #LBSmalltalkHighlighter instanceVariableNames: 'comments' classVariableNames: 'ArrayLiteral AssignmentToken BlockBrackets ByteLiteral CharLiteral CommentColor ExpressionBrackets FalseLiteral GlobalVariableTag MethodTag NilLiteral NumberLiteral PragmaTag ReturnTag SelfVariable StringLiteral SuperVariable SymbolLiteral TempToken ThisContextVariable TrueLiteral VariableTag' poolDictionaries: '' category: 'LanguageBoxes-Grammar-Smalltalk'! !LBSmalltalkHighlighter class methodsFor: 'accessing' stamp: 'lr 1/19/2009 09:30'! concern ^ #highlight:! ! !LBSmalltalkHighlighter class methodsFor: 'initialization' stamp: 'lr 1/30/2009 15:48'! initialize MethodTag := TextEmphasis bold. PragmaTag := Color gray muchDarker. ReturnTag := TextEmphasis bold. VariableTag := Color blue muchDarker. GlobalVariableTag := Color blue muchDarker. SelfVariable := Color cyan muchDarker. SuperVariable := Color cyan muchDarker. ThisContextVariable := Color cyan muchDarker. NilLiteral := Color cyan muchDarker. FalseLiteral := Color cyan muchDarker. TrueLiteral := Color cyan muchDarker. CharLiteral := Color magenta muchDarker. StringLiteral := Color magenta muchDarker. SymbolLiteral := Color magenta muchDarker. NumberLiteral := Color magenta muchDarker. ArrayLiteral := Color magenta muchDarker. ByteLiteral := Color magenta muchDarker. TempToken := nil. BlockBrackets := nil. AssignmentToken := nil. ExpressionBrackets := nil. CommentColor := Color green muchDarker! ! !LBSmalltalkHighlighter methodsFor: 'private' stamp: 'lr 4/6/2009 11:57'! addComment: aToken comments addLast: aToken -> CommentColor! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 1/30/2009 14:58'! arrayLiteral super arrayLiteral ==> [ :token | token at: 1 put: token first -> ArrayLiteral; at: token size put: token last -> ArrayLiteral; yourself ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 1/30/2009 09:40'! arrayLiteralArray super arrayLiteralArray ==> [ :token | token at: 1 put: token first -> ArrayLiteral; at: token size put: token last -> ArrayLiteral; yourself ].! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 1/30/2009 09:57'! arrayLiteralByte super arrayLiteralByte ==> [ :token | token at: 1 put: token first -> ByteLiteral; at: token size put: token last -> ByteLiteral; yourself ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:54'! arrayLiteralChar super arrayLiteralChar ==> [ :token | token -> CharLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:53'! arrayLiteralFalse super arrayLiteralFalse ==> [ :token | token -> FalseLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:53'! arrayLiteralNil super arrayLiteralNil ==> [ :token | token -> NilLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:54'! arrayLiteralNumber super arrayLiteralNumber ==> [ :token | token -> NumberLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:54'! arrayLiteralString super arrayLiteralString ==> [ :token | token -> StringLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:54'! arrayLiteralSymbol super arrayLiteralSymbol ==> [ :token | token -> SymbolLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:54'! arrayLiteralTrue super arrayLiteralTrue ==> [ :token | token -> TrueLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'token' stamp: 'lr 11/11/2008 16:11'! assignmentToken super assignmentToken ==> [ :token | token -> AssignmentToken ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-blocks' stamp: 'lr 1/30/2009 14:58'! block super block ==> [ :token | token at: 1 put: token first -> BlockBrackets; at: token size put: token last -> BlockBrackets; yourself ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-blocks' stamp: 'lr 3/26/2009 16:25'! blockBody super blockBody ==> [ :token | token at: 2 put: token second -> BlockBrackets; yourself ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 1/30/2009 09:58'! byteLiteral super byteLiteral ==> [ :token | token at: 1 put: token first -> ByteLiteral; at: token size put: token last -> ByteLiteral; yourself ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:55'! charLiteral super charLiteral ==> [ :token | token -> CharLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:55'! falseLiteral super falseLiteral ==> [ :token | token -> FalseLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'initialization' stamp: 'lr 1/22/2009 15:28'! initialize super initialize. comments := OrderedCollection new! ! !LBSmalltalkHighlighter methodsFor: 'private' stamp: 'lr 4/2/2009 15:32'! mark: aCollection with: anObject ^ CHHighlighter mark: aCollection with: anObject! ! !LBSmalltalkHighlighter methodsFor: 'grammar' stamp: 'lr 4/6/2009 11:57'! methodDeclaration super methodDeclaration ==> [ :nodes | self mark: nodes with: MethodTag ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:56'! nilLiteral super nilLiteral ==> [ :token | token -> NilLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:56'! numberLiteral super numberLiteral ==> [ :token | token -> NumberLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar' stamp: 'lr 1/30/2009 15:44'! parens super parens ==> [ :token | token at: 1 put: token first -> ExpressionBrackets; at: token size put: token last -> ExpressionBrackets; yourself ]! ! !LBSmalltalkHighlighter methodsFor: 'parsing' stamp: 'lr 1/22/2009 15:29'! parse: aStream comments add: (super parse: aStream). ^ comments! ! !LBSmalltalkHighlighter methodsFor: 'grammar' stamp: 'lr 4/6/2009 11:58'! pragma super pragma ==> [ :nodes | self mark: nodes with: PragmaTag ] ! ! !LBSmalltalkHighlighter methodsFor: 'grammar' stamp: 'lr 11/11/2008 16:05'! return super return ==> [ :nodes | nodes at: 1 put: nodes first -> ReturnTag; yourself ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:56'! stringLiteral super stringLiteral ==> [ :token | token -> StringLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:56'! symbolLiteral super symbolLiteral ==> [ :token | token -> SymbolLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar' stamp: 'lr 1/30/2009 15:48'! temporaries super temporaries ==> [ :nodes | nodes isEmpty ifFalse: [ nodes at: 1 put: nodes first -> TempToken; at: nodes size put: nodes last -> TempToken ]. nodes ]! ! !LBSmalltalkHighlighter methodsFor: 'private' stamp: 'lr 6/23/2009 10:57'! tokenParser ^ LBSmalltalkHightlightTokenParser! ! !LBSmalltalkHighlighter methodsFor: 'grammar-literals' stamp: 'lr 11/11/2008 15:56'! trueLiteral super trueLiteral ==> [ :token | token -> TrueLiteral ]! ! !LBSmalltalkHighlighter methodsFor: 'grammar' stamp: 'lr 11/11/2008 16:14'! variable super variable ==> [ :token | token value = 'self' ifTrue: [ token -> SelfVariable ] ifFalse: [ token value = 'super' ifTrue: [ token -> SuperVariable ] ifFalse: [ token value = 'thisContext' ifTrue: [ token -> ThisContextVariable ] ifFalse: [ (Smalltalk hasClassNamed: token value) ifTrue: [ token -> GlobalVariableTag ] ifFalse: [ token -> VariableTag ] ] ] ] ]! ! CUCompositeParser subclass: #LBSqlGrammar instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Grammar-SQL'! !LBSqlGrammar commentStamp: 'lr 6/30/2009 11:29' prior: 0! command ::= define_data | modify_data | system_command define_data ::= create_command modify_data ::= select_command | insert_command | update_command | delete_command system_command ::= | describe_command | open_command | close_command | save_command | list_command | clear_command | dump_command | help_command create_command ::= ( "CREATE" | "create" ) (character_set)+ "("((character_set)+,)+")" ("WITH"|"with") ("VALUES"|"values") "("((character_set)+,)+")" select_command ::= ("SELECT"|"select") ("*"|(character_set)+) ("FROM"|"from") (character_set)+ [("WHERE"|"where") condition] [("LIMIT"|"limit") (numeric)+] insert_command ::= ( "INSERT" | "insert" ) ("INTO"|"into") (character_set)+ "("((character_set)+,)+")" ("VALUES"|"values") "("((character_set)+,)+")" update_command ::= ("UPDATE"|update") (character_set)+ ("SET"|"set") (character_set)+ "=" (character_set)+ [("WHERE"|"where") condition] delete_command ::= ("DELETE"|"delete") ("FROM"|"from") (character_set)+ [("WHERE"|"where") condition] open_command ::= ("OPEN"|"open") (character_set)+ close_command ::= ("CLOSE"|"close") (character_set)+ save_command ::= ("SAVE"|"save") | ("SAVE"|"save") ("AS"|"as") (character_set)+ list ::= ("LS"|"ls"|"DIR"|"dir") | ("LS"|"ls"|"DIR"|"dir") (character_set)+ clear ::= ("CLEAR"|"clear"|"CLS"|"cls") dump ::= ("DUMP"|"dump") help ::= ("help"|"HELP"|"/HELP"|"/help"|"/?") condition ::= (character_set)+ (["<"|">"|"!!"]=|["<"|">"|"="]) (character_set)+ [(("AND"|"and")|("OR"|"or")) (character_set)+ (["<"|">"|"!!"]=|["<"|">"|"="]) (character_set)+] character_set ::= "a"|"b"|"c"|"d"|"e"|"f"|"g"|"h"|"i"|"j"|"k"|"l"|"m" "n"|"o"|"p"|"q"|"r"|"s"|"t"|"u"|"v"|"w"|"x"|"y"|"z" |"A"|"B"|"C"|"D"|"E"|"F"|"G"|"H"|"I"|"J"|"K"|"L"|"M" |"N"|"O"|"P"|"Q"|"R"|"S"|"T"|"U"|"V"|"W"|"X"|"Y"|"Z" |"0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9" |"-"|"_"|"("|")"|"."|","|"""|"/"|"\"|"@"|"#"|"~"|"|" |"*"|"&"|"%"|"$"|"¦Ç¬£"|"!!"|"+"|"?"|">"|"<"|"=" numeric ::= "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9" ! LBSqlGrammar subclass: #LBSqlCompiler instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Grammar-SQL'! !LBSqlCompiler class methodsFor: 'accessing' stamp: 'lr 6/30/2009 13:56'! concern ^ #compile:! ! !LBSqlGrammar methodsFor: 'commands' stamp: 'lr 6/30/2009 11:46'! command createCommand / deleteCommand / insertCommand / selectCommand / updateCommand! ! !LBSqlGrammar methodsFor: 'operators' stamp: 'lr 6/30/2009 12:20'! comparison expression , operator , expression! ! !LBSqlGrammar methodsFor: 'operators' stamp: 'lr 6/30/2009 12:20'! condition comparison separatedBy: logic! ! !LBSqlGrammar methodsFor: 'commands' stamp: 'lr 5/4/2010 14:10'! createCommand 'CREATE' token trim , expression , $( token trim , sequence , $) token trim , 'WITH' token trim , 'VALUES' token trim , $( token trim , sequence , $) token trim! ! !LBSqlGrammar methodsFor: 'commands' stamp: 'lr 5/4/2010 14:10'! deleteCommand 'DELETE' token trim , 'FROM' token trim , expression , whereClause optional! ! !LBSqlGrammar methodsFor: 'operators' stamp: 'lr 6/30/2009 12:27'! expression identifier / number / string! ! !LBSqlGrammar methodsFor: 'tokens' stamp: 'lr 5/4/2010 14:11'! identifier #letter plus token trim! ! !LBSqlGrammar methodsFor: 'commands' stamp: 'lr 5/4/2010 14:10'! insertCommand 'INSERT' token trim , 'INTO' token trim , expression , $( token trim , sequence , $) token trim , 'VALUES' token trim , $( token trim , sequence , $) token trim! ! !LBSqlGrammar methodsFor: 'clauses' stamp: 'lr 5/4/2010 14:10'! limitClause 'LIMIT' token trim , number! ! !LBSqlGrammar methodsFor: 'tokens' stamp: 'lr 5/4/2010 14:11'! logic ('AND' / 'OR') token trim! ! !LBSqlGrammar methodsFor: 'tokens' stamp: 'lr 5/4/2010 14:11'! number #digit plus token trim! ! !LBSqlGrammar methodsFor: 'tokens' stamp: 'lr 5/4/2010 14:11'! operator ('<=' / '>=' / '!!=' / '<' / '>' / '=') token trim! ! !LBSqlGrammar methodsFor: 'commands' stamp: 'lr 5/4/2010 14:10'! selectCommand 'SELECT' token trim , ($* token trim / sequence) , 'FROM' token trim , sequence , whereClause optional , limitClause optional! ! !LBSqlGrammar methodsFor: 'tokens' stamp: 'lr 5/4/2010 14:11'! sequence expression separatedBy: $, token trim! ! !LBSqlGrammar methodsFor: 'accessing' stamp: 'lr 7/1/2009 09:54'! start command! ! !LBSqlGrammar methodsFor: 'tokens' stamp: 'lr 5/4/2010 14:11'! string ($" , $" negate star , $") token trim! ! !LBSqlGrammar methodsFor: 'private' stamp: 'lr 5/4/2010 14:09'! tokenParser ^ LBSqlTokenParser! ! !LBSqlGrammar methodsFor: 'commands' stamp: 'lr 5/4/2010 14:11'! updateCommand 'UPDATE' token trim , expression , 'SET' token trim , expression , $= token trim , expression , whereClause optional! ! !LBSqlGrammar methodsFor: 'clauses' stamp: 'lr 5/4/2010 14:10'! whereClause 'WHERE' token trim , condition! ! LBSqlGrammar subclass: #LBSqlHighlighter instanceVariableNames: '' classVariableNames: 'IdentifierLiteral KeywordToken LogicToken NumberLiteral OperatorToken StringLiteral' poolDictionaries: '' category: 'LanguageBoxes-Grammar-SQL'! !LBSqlHighlighter class methodsFor: 'accessing' stamp: 'lr 6/30/2009 13:56'! concern ^ #highlight:! ! !LBSqlHighlighter class methodsFor: 'initialization' stamp: 'lr 6/30/2009 14:12'! initialize KeywordToken := Array with: TextEmphasis bold with: Color cyan muchDarker. LogicToken := KeywordToken. OperatorToken := Color black. IdentifierLiteral := Color blue muchDarker. NumberLiteral := Color magenta muchDarker. StringLiteral := Color magenta muchDarker! ! !LBSqlHighlighter methodsFor: 'commands' stamp: 'lr 6/30/2009 13:46'! command super command ==> [ :nodes | self highlightKeywords: nodes ]! ! !LBSqlHighlighter methodsFor: 'utilities' stamp: 'lr 6/30/2009 13:49'! highlightKeywords: aCollection ^ aCollection flatten collect: [ :each | (each class = PPToken and: [ each size > 1 ]) ifTrue: [ each -> KeywordToken ] ifFalse: [ each ] ]! ! !LBSqlHighlighter methodsFor: 'tokens' stamp: 'lr 6/30/2009 13:46'! identifier super identifier ==> [ :token | token -> IdentifierLiteral ]! ! !LBSqlHighlighter methodsFor: 'tokens' stamp: 'lr 6/30/2009 13:46'! logic super logic ==> [ :token | token -> LogicToken ]! ! !LBSqlHighlighter methodsFor: 'tokens' stamp: 'lr 6/30/2009 13:46'! number super number ==> [ :token | token -> NumberLiteral ]! ! !LBSqlHighlighter methodsFor: 'tokens' stamp: 'lr 6/30/2009 13:46'! operator super operator ==> [ :token | token -> OperatorToken ]! ! !LBSqlHighlighter methodsFor: 'tokens' stamp: 'lr 6/30/2009 13:46'! string super string ==> [ :token | token -> StringLiteral ]! ! OBCommand subclass: #LBCmdProvider instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-OmniBrowser'! LBCmdProvider subclass: #LBCmdActivate instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-OmniBrowser'! !LBCmdActivate methodsFor: 'execution' stamp: 'lr 6/23/2009 11:31'! execute self languageBox active: self languageBox isActive not! ! !LBCmdActivate methodsFor: 'accessing' stamp: 'lr 9/2/2010 12:08'! label ^ (ORChangesBrowser displayDiffs ifTrue: [ '' ] ifFalse: [ '']) , 'Active'! ! LBCmdProvider subclass: #LBCmdInspect instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-OmniBrowser'! !LBCmdInspect methodsFor: 'execution' stamp: 'lr 6/23/2009 11:32'! execute self languageBox explore! ! !LBCmdInspect methodsFor: 'accessing' stamp: 'lr 10/30/2008 13:36'! icon ^ #inspectItIcon! ! !LBCmdInspect methodsFor: 'accessing' stamp: 'lr 9/2/2010 12:06'! label ^ 'Inspect'! ! !LBCmdProvider methodsFor: 'accessing' stamp: 'lr 9/2/2010 12:06'! cluster ^ #'Language Boxes'! ! !LBCmdProvider methodsFor: 'accessing' stamp: 'lr 6/23/2009 11:30'! group ^ #provider! ! !LBCmdProvider methodsFor: 'testing' stamp: 'lr 6/23/2009 11:23'! isActive ^ (requestor isSelected: target) and: [ (target isKindOf: OBClassAwareNode) and: [ target theNonMetaClass includesBehavior: LBLanguageBox ] ]! ! !LBCmdProvider methodsFor: 'accessing' stamp: 'lr 6/23/2009 11:31'! languageBox ^ target theNonMetaClass default! ! LBCmdProvider subclass: #LBCmdRecompile instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-OmniBrowser'! !LBCmdRecompile methodsFor: 'execution' stamp: 'lr 6/23/2009 11:48'! execute | environemnt | environemnt := self languageBox recompile. environemnt isEmpty ifFalse: [ environemnt open ]! ! !LBCmdRecompile methodsFor: 'accessing' stamp: 'lr 9/2/2010 12:06'! label ^ 'Recompile'! ! LBCmdProvider subclass: #LBCmdScope instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-OmniBrowser'! !LBCmdScope methodsFor: 'execution' stamp: 'lr 6/23/2009 11:33'! execute self languageBox environment open! ! !LBCmdScope methodsFor: 'accessing' stamp: 'lr 9/2/2010 12:06'! label ^ 'Scope'! ! OBCommand subclass: #LBCmdUser instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-OmniBrowser'! LBCmdUser subclass: #LBCmdAdd instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-OmniBrowser'! !LBCmdAdd methodsFor: 'execution' stamp: 'lr 6/23/2009 11:38'! execute | environment box | environment := target browserEnvironment. box := self chooseLanguageBox: 'Add Language Box' select: [ :each | (each environment & environment) isEmpty ]. box isNil ifTrue: [ ^ self ]. box add: environment! ! !LBCmdAdd methodsFor: 'accessing' stamp: 'lr 10/30/2008 14:11'! group ^ #scope! ! !LBCmdAdd methodsFor: 'accessing' stamp: 'lr 9/2/2010 12:06'! label ^ 'Add...'! ! LBCmdUser subclass: #LBCmdBrowse instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-OmniBrowser'! !LBCmdBrowse methodsFor: 'accessing' stamp: 'lr 6/23/2009 11:36'! environment | environment | environment := self languageBoxes inject: ClassEnvironment new into: [ :result :box | (target withinBrowserEnvironment: box environment) ifTrue: [ result addClass: box class ]. result ]. ^ environment label: 'Language Boxes for ' , target name! ! !LBCmdBrowse methodsFor: 'execution' stamp: 'lr 6/23/2009 11:46'! execute | boxes | boxes := self languageBoxes select: [ :each | target withinBrowserEnvironment: each environment ]. boxes isEmpty ifTrue: [ ^ self ]. boxes size = 1 ifTrue: [ ^ requestor browser jumpTo: boxes anyOne class asNode ]. self environment browserInstance open! ! !LBCmdBrowse methodsFor: 'testing' stamp: 'lr 10/30/2008 13:52'! isEnabled ^ self environment isEmpty not! ! !LBCmdBrowse methodsFor: 'accessing' stamp: 'lr 9/2/2010 12:07'! label ^ 'Browse'! ! LBCmdUser subclass: #LBCmdRemove instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-OmniBrowser'! !LBCmdRemove methodsFor: 'execution' stamp: 'lr 6/23/2009 11:38'! execute | environment box | environment := target browserEnvironment. box := self chooseLanguageBox: 'Remove Language Box' select: [ :each | (each environment & environment) isEmpty not ]. box isNil ifTrue: [ ^ self ]. box environments do: [ :each | (each & environment) isEmpty ifFalse: [ box remove: each ] ]! ! !LBCmdRemove methodsFor: 'accessing' stamp: 'lr 10/30/2008 14:11'! group ^ #scope! ! !LBCmdRemove methodsFor: 'accessing' stamp: 'lr 9/2/2010 12:07'! label ^ 'Remove...'! ! !LBCmdUser methodsFor: 'utilities' stamp: 'lr 6/23/2009 11:33'! chooseLanguageBox: aString ^ self chooseLanguageBox: aString select: [ :each | true ]! ! !LBCmdUser methodsFor: 'utilities' stamp: 'lr 6/23/2009 11:38'! chooseLanguageBox: aString select: aBlock | boxes labels | boxes := self languageBoxes asArray select: aBlock. boxes isEmpty ifTrue: [ ^ nil ]. boxes sort: [ :a :b | a name < b name ]. labels := boxes collect: [ :each | each name ]. ^ OBChoiceRequest prompt: aString labels: labels values: boxes! ! !LBCmdUser methodsFor: 'accessing' stamp: 'lr 9/2/2010 12:06'! cluster ^ #'Language Boxes'! ! !LBCmdUser methodsFor: 'accessing' stamp: 'lr 6/23/2009 11:30'! group ^ #user! ! !LBCmdUser methodsFor: 'testing' stamp: 'lr 10/30/2008 13:43'! isActive ^ (requestor isSelected: target) and: [ target isKindOf: OBClassAwareNode ]! ! !LBCmdUser methodsFor: 'accessing' stamp: 'lr 6/23/2009 11:33'! languageBoxes ^ LBLanguageBox all! ! !QQQuoteNode class methodsFor: '*languageboxes' stamp: 'lr 4/6/2009 10:37'! highlight: aCollection ^ CHHighlighter mark: aCollection with: (CHHighlightAttribute new color: (Color black alpha: 0.1); outline: 2; yourself)! ! !CompiledMethod methodsFor: '*languageboxes' stamp: 'lr 10/30/2008 15:11'! isBroken ^ false! ! !QQMetaNode class methodsFor: '*languageboxes' stamp: 'lr 2/3/2009 18:49'! highlight: aCollection ^ aCollection! ! CHRule subclass: #LBHighlightAction instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-DSL'! !LBHighlightAction methodsFor: 'visiting' stamp: 'lr 6/23/2009 12:08'! acceptDsl: aVisitor | parser offset tokens | parser := self highlighterClass doIt: aVisitor isDoIt. parser withContextDo: [ LBLanguageBox activeFor: aVisitor do: [ :box | box modify: parser ] ]. aVisitor text removeAttributesFrom: aVisitor scopeStart to: aVisitor scopeStop. offset := aVisitor scopeStart - 1. tokens := parser parse: aVisitor scopedText readStream ifError: [ :err | #() ]. tokens flattenedDo: [ :each | (each isVariableBinding and: [ each key isKindOf: PPToken ]) ifTrue: [ aVisitor scopeFrom: offset + each key start to: offset + each key stop with: nil visit: each value ] ]! ! !LBHighlightAction methodsFor: 'accessing' stamp: 'lr 5/4/2010 14:05'! highlighterClass ^ PPSmalltalkHighlighter! ! CHRule subclass: #LBParseAction instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-DSL'! !LBParseAction methodsFor: 'visiting' stamp: 'lr 6/23/2009 12:08'! acceptDsl: aVisitor | parser | parser := self parserClass doIt: aVisitor isDoIt. parser withContextDo: [ LBLanguageBox activeFor: aVisitor do: [ :box | box modify: parser ] ]. ^ parser parse: aVisitor stream ifError: [ :err | CHParserError signal: err reason at: err position ]! ! !LBParseAction methodsFor: 'accessing' stamp: 'lr 5/4/2010 14:05'! parserClass ^ PPSmalltalkParser! ! !QQUnquoteNode class methodsFor: '*languageboxes' stamp: 'lr 4/6/2009 10:38'! highlight: aCollection ^ CHHighlighter mark: aCollection with: (CHHighlightAttribute new borderColor: Color darkGray; borderWidth: 1; yourself)! ! PPTokenParser subclass: #LBSmalltalkTokenParser instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Grammar-Smalltalk'! LBSmalltalkTokenParser subclass: #LBSmalltalkHightlightTokenParser instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Grammar-Smalltalk'! !LBSmalltalkHightlightTokenParser methodsFor: 'parsing' stamp: 'lr 5/4/2010 14:07'! parse: aStream | token current | token := super parse: aStream. (token isPetitFailure not and: [ token stop < aStream position ]) ifTrue: [ current := thisContext sender. [ current isNil or: [ current receiver class == PPSmalltalkHighlighter ] ] whileFalse: [ current := current sender ]. current isNil ifFalse: [ current receiver addComment: (self create: aStream collection start: token stop + 1 stop: aStream position) ] ]. ^ token! ! !LBSmalltalkTokenParser methodsFor: 'hooks' stamp: 'lr 1/30/2009 10:06'! consumeSpaces: aStream [ super consumeSpaces: aStream. aStream peek == $" ] whileTrue: [ aStream next. [ aStream atEnd not and: [ aStream next = $" ] ] whileFalse ]! ! PPTokenParser subclass: #LBSqlTokenParser instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Grammar-SQL'! !LBSqlTokenParser methodsFor: 'parsing' stamp: 'lr 5/4/2010 14:08'! parse: aStream | start element stop | self consumeSpacesBefore: aStream. start := aStream position. element := parser class = PPLiteralSequenceParser ifFalse: [ super parse: aStream ] ifTrue: [ | input | input := aStream next: parser string size. (input sameAs: parser string) ifTrue: [ input ] ifFalse: [ PPFailure reason: parser string , ' expected' at: start ] ]. element isPetitFailure ifTrue: [ ^ element ]. stop := aStream position. self consumeSpacesAfter: aStream. ^ self create: aStream collection start: start + 1 stop: stop! ! !OBCodeBrowser methodsFor: '*languageboxes' stamp: 'lr 6/23/2009 11:38'! cmdLanguageBoxProvider ^ LBCmdProvider allSubclasses! ! !OBCodeBrowser methodsFor: '*languageboxes' stamp: 'lr 6/23/2009 11:37'! cmdLanguageBoxUser ^ LBCmdUser allSubclasses! ! TestCase subclass: #LBGrammarTest instanceVariableNames: 'result' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests'! !LBGrammarTest class methodsFor: 'testing' stamp: 'lr 6/23/2009 10:57'! isAbstract ^ self name = #LBGrammarTest! ! !LBGrammarTest class methodsFor: 'accessing' stamp: 'lr 6/23/2009 10:57'! resources ^ Array with: LBGrammarResource! ! !LBGrammarTest methodsFor: 'parsing' stamp: 'lr 5/7/2009 10:15'! parse: aString self parse: aString rule: #start! ! !LBGrammarTest methodsFor: 'parsing' stamp: 'lr 5/4/2010 14:12'! parse: aString rule: aSymbol | production | production := self parser. aSymbol = #start ifFalse: [ production := production productionAt: aSymbol ]. result := production parse: aString. self deny: result isPetitFailure description: 'Unable to parse ' , aString printString! ! !LBGrammarTest methodsFor: 'accessing' stamp: 'lr 6/23/2009 10:57'! parser ^ LBGrammarResource current parserAt: self parserClass! ! !LBGrammarTest methodsFor: 'accessing' stamp: 'lr 6/30/2009 14:03'! parserClass self subclassResponsibility! ! LBGrammarTest subclass: #LBJavaCommentGrammarTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-Java'! !LBJavaCommentGrammarTests methodsFor: 'accessing' stamp: 'lr 6/23/2009 10:57'! parserClass ^ LBJavaCommentGrammar! ! !LBJavaCommentGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 11:03'! testComment self parse: '/* * This is a normal comment */'. self assert: result value = '/* * This is a normal comment */'! ! !LBJavaCommentGrammarTests methodsFor: 'testing-whitespace' stamp: 'lr 5/7/2009 11:02'! testCrLf self parse: String crlf. self assert: result value = String crlf! ! !LBJavaCommentGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 11:02'! testJavadoc self parse: '/** * This is a dummy Javadoc */'. self assert: result value = '/** * This is a dummy Javadoc */'! ! !LBJavaCommentGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 11:04'! testLine self parse: '// There are dragons'. self assert: result value = '// There are dragons'! ! !LBJavaCommentGrammarTests methodsFor: 'testing-whitespace' stamp: 'lr 5/7/2009 11:03'! testSpace self parse: ' '. self assert: result value = ' '! ! !LBJavaCommentGrammarTests methodsFor: 'testing-whitespace' stamp: 'lr 5/7/2009 11:03'! testTab self parse: ' '. self assert: result value = ' '! ! LBGrammarTest subclass: #LBJavaGrammarTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-Java'! !LBJavaGrammarTests methodsFor: 'accessing' stamp: 'lr 6/23/2009 10:57'! parserClass ^ LBJavaGrammar! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:54'! testAnnotation1 self parse: '@interface' rule: #annotation! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:59'! testAnnotation2 self parse: '@interface()' rule: #annotation! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 14:21'! testAnnotation3 self parse: '@Copyright("2002 Yoyodyne Propulsion Systems")' rule: #annotation! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:58'! testAnnotation4 self parse: '@RequestForEnhancement( id = 2868724, synopsis = "Enable time-travel", engineer = "Mr. Peabody", date = "4/1/3007" )' rule: #annotation! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:10'! testBoolLiteral1 self parse: 'true' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:10'! testBoolLiteral2 self parse: 'false' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:09'! testCharLiteral1 self parse: '''a''' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:09'! testCharLiteral2 self parse: '''3''' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:09'! testCharLiteral3 self parse: '''\n''' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:09'! testCharLiteral4 self parse: '''\t''' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:09'! testCharLiteral5 self parse: '''u0041''' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:10'! testCharLiteral6 self parse: '''\0009''' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:11'! testFloatLiteral1 self parse: '6.5E+32' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:11'! testFloatLiteral2 self parse: '7D' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:11'! testFloatLiteral3 self parse: '.01f' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:08'! testIntegerLiteral1 self parse: '123' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:08'! testIntegerLiteral2 self parse: '123' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:08'! testIntegerLiteral3 self parse: '0x4a' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:08'! testIntegerLiteral4 self parse: '057' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:12'! testNullLiteral self parse: 'null' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:54'! testQualifiedName1 self parse: 'org' rule: #qualifiedName! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:54'! testQualifiedName2 self parse: 'org.java' rule: #qualifiedName! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:55'! testQualifiedName3 self parse: 'org.java.swing' rule: #qualifiedName! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:55'! testQualifiedNameList1 self parse: 'org.java' rule: #qualifiedName! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:56'! testQualifiedNameList2 self parse: 'org.java, org.java.swing' rule: #qualifiedName! ! !LBJavaGrammarTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:56'! testQualifiedNameList3 self parse: 'org.java, org.java, com.sun' rule: #qualifiedName! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:11'! testStringLiteral1 self parse: '""' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:11'! testStringLiteral2 self parse: '"\""' rule: #literal! ! !LBJavaGrammarTests methodsFor: 'testing-literals' stamp: 'lr 5/7/2009 14:11'! testStringLiteral3 self parse: '"This is a string"' rule: #literal! ! LBGrammarTest subclass: #LBJavaPackagesTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-Java'! !LBJavaPackagesTests methodsFor: 'accessing' stamp: 'lr 6/23/2009 10:57'! parserClass ^ LBJavaGrammar! ! !LBJavaPackagesTests methodsFor: 'testing' stamp: 'lr 5/7/2009 13:40'! testHelloApple self parse: '// Hello.java import javax.swing.JApplet; import java.awt.Graphics; public class Hello extends JApplet { public void paintComponent(Graphics g) { g.drawString("Hello, world!!", 65, 95); } }'! ! !LBJavaPackagesTests methodsFor: 'testing' stamp: 'lr 5/7/2009 10:48'! testHelloServlet self parse: '// Hello.java import java.io.*; import javax.servlet.*; public class Hello extends GenericServlet { public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); final PrintWriter pw = response.getWriter(); pw.println("Hello, world!!"); pw.close(); } }'! ! !LBJavaPackagesTests methodsFor: 'testing' stamp: 'lr 5/7/2009 10:48'! testHelloSwing self parse: '// Hello.java (Java SE 5) import java.awt.BorderLayout; import javax.swing.*; public class Hello extends JFrame { public Hello() { super("hello"); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setLayout(new BorderLayout()); add(new JLabel("Hello, world!!")); pack(); } public static void main(String[] args) { new Hello().setVisible(true); } }'! ! !LBJavaPackagesTests methodsFor: 'testing' stamp: 'lr 5/7/2009 10:46'! testHelloWorld self parse: '/* * Outputs "Hello, world !!" and then exits */ public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!!"); } }'! ! !LBJavaPackagesTests methodsFor: 'testing' stamp: 'lr 5/7/2009 10:47'! testOddEven self parse: '// OddEven.java import javax.swing.JOptionPane; public class OddEven { // "input" is the number that the user gives to the computer private int input; // a whole number("int" means integer) /* * This is the constructor method. It gets called when an object of the OddEven type * is being created. */ public OddEven() { //Code not shown } // This is the main method. It gets called when this class is run through a Java interpreter. public static void main(String[] args) { /* * This line of code creates a new instance of this class called "number" (also known as an * Object) and initializes it by calling the constructor. The next line of code calls * the "showDialog()" method, which brings up a prompt to ask you for a number */ OddEven number = new OddEven(); number.showDialog(); } public void showDialog() { /* * "try" makes sure nothing goes wrong. If something does, * the interpreter skips to "catch" to see what it should do. */ try { /* * The code below brings up a JOptionPane, which is a dialog box * The String returned by the "showInputDialog()" method is converted into * an integer, making the program treat it as a number instead of a word. * After that, this method calls a second method, calculate() that will * display either "Even" or "Odd." */ input = new Integer(JOptionPane.showInputDialog("Please Enter A Number")); calculate(); } catch (NumberFormatException e) { /* * Getting in the catch block means that there was a problem with the format of * the number. Probably some letters were typed in instead of a number. */ System.err.println("ERROR: Invalid input. Please type in a numerical value."); } } /* * When this gets called, it sends a message to the interpreter. * The interpreter usually shows it on the command prompt (For Windows users) * or the terminal (For Linux users).(Assuming it''s open) */ private void calculate() { if (input % 2 == 0) { System.out.println("Even"); } else { System.out.println("Odd"); } } }'! ! !LBJavaPackagesTests methodsFor: 'testing' stamp: 'lr 5/7/2009 10:48'! testSimple self parse: '/** * A program that does useful things. */ public class Program { /** * A main method. * @param args The arguments */ public static void main(String[] args) { //do stuff } }'! ! LBGrammarTest subclass: #LBSmalltalkGrammarTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-Smalltalk'! LBSmalltalkGrammarTests subclass: #LBSmalltalkCompilerTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-Smalltalk'! !LBSmalltalkCompilerTests methodsFor: 'private' stamp: 'lr 3/26/2009 14:56'! assert: aNode format: aString aNode isCollection ifFalse: [ ^ self assert: (Array with: aNode) format: (Array with: aString) ]. self assert: aNode size = aString size. aNode with: aString do: [ :node :string | self assert: node formattedCode = string ]! ! !LBSmalltalkCompilerTests methodsFor: 'accessing' stamp: 'lr 5/4/2010 14:05'! parserClass ^ PPSmalltalkParser! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testArgumentsBlock1 super testArgumentsBlock1. self assert: result isBlock. self assert: result arguments size = 1. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testArgumentsBlock2 super testArgumentsBlock2. self assert: result isBlock. self assert: result arguments size = 2. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result arguments second isVariable. self assert: result arguments second name = 'b'. self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testArgumentsBlock3 super testArgumentsBlock3. self assert: result isBlock. self assert: result arguments size = 3. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result arguments second isVariable. self assert: result arguments second name = 'b'. self assert: result arguments third isVariable. self assert: result arguments third name = 'c'. self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral1 super testArrayLiteral1. self assert: result isLiteral. self assert: result value = #()! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral10 super testArrayLiteral10. self assert: result isLiteral. self assert: result value = #(#(1 2 ) #(1 2 3 ) )! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 10:03'! testArrayLiteral11 super testArrayLiteral11. self assert: result isLiteral. self assert: result value size = 2. self assert: (result value first isKindOf: ByteArray). self assert: result value first size = 2. self assert: (result value last isKindOf: ByteArray). self assert: result value last size = 3! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral2 super testArrayLiteral2. self assert: result isLiteral. self assert: result value = #(1 )! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral3 super testArrayLiteral3. self assert: result isLiteral. self assert: result value = #(1 2 )! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral4 super testArrayLiteral4. self assert: result isLiteral. self assert: result value = #(true false nil )! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral5 super testArrayLiteral5. self assert: result isLiteral. self assert: result value = #($a )! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral6 super testArrayLiteral6. self assert: result isLiteral. self assert: result value = #(1.2 )! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 16:03'! testArrayLiteral7 super testArrayLiteral7. self assert: result isLiteral. self assert: result value = #(size #at: at:put: #'=='). result value do: [ :each | self assert: each isSymbol ]! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 16:01'! testArrayLiteral8 super testArrayLiteral8. self assert: result isLiteral. self assert: result value = #('baz'). self assert: result value first isString. self assert: result value first isSymbol not! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 16:02'! testArrayLiteral9 super testArrayLiteral9. self assert: result isLiteral. self assert: result value = #((1) 2)! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment1 super testAssignment1. self assert: result isLiteral. self assert: result value = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment2 super testAssignment2. self assert: result isAssignment. self assert: result variable isVariable. self assert: result variable name = 'a'. self assert: result value isLiteral. self assert: result value value = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment3 super testAssignment3. self assert: result isAssignment. self assert: result variable isVariable. self assert: result variable name = 'a'. self assert: result value isAssignment. self assert: result value variable isVariable. self assert: result value variable name = 'b'. self assert: result value value isLiteral. self assert: result value value value = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment4 super testAssignment4. self assert: result isAssignment. self assert: result variable isVariable. self assert: result variable name = 'a'. self assert: result value isLiteral. self assert: result value value = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment5 super testAssignment5. self assert: result isAssignment. self assert: result variable isVariable. self assert: result variable name = 'a'. self assert: result value isAssignment. self assert: result value variable isVariable. self assert: result value variable name = 'b'. self assert: result value value isLiteral. self assert: result value value value = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryExpression1 super testBinaryExpression1. self assert: result isMessage. self assert: result receiver isLiteral. self assert: result receiver value = 1. self assert: result arguments size = 1. self assert: result arguments first isLiteral. self assert: result arguments first value = 2! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryExpression2 super testBinaryExpression2. self assert: result isMessage. self assert: result receiver isMessage. self assert: result receiver receiver isLiteral. self assert: result receiver receiver value = 1. self assert: result receiver arguments size = 1. self assert: result receiver arguments first isLiteral. self assert: result receiver arguments first value = 2. self assert: result arguments size = 1. self assert: result arguments first isLiteral. self assert: result arguments first value = 3! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryMethod1 super testBinaryMethod1. self assert: result isMethod. self assert: result selector = #+. self assert: result arguments size = 1. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryMethod2 super testBinaryMethod2. self assert: result isMethod. self assert: result selector = #+. self assert: result arguments size = 1. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result body temporaries size = 1. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryMethod3 super testBinaryMethod3. self assert: result isMethod. self assert: result selector = #+. self assert: result arguments size = 1. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result body temporaries isEmpty. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryMethod4 super testBinaryMethod4. self assert: result isMethod. self assert: result selector = #+. self assert: result arguments size = 1. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result body temporaries size = 1. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 09:59'! testByteLiteral1 super testByteLiteral1. self assert: result isLiteral. self assert: (result value isKindOf: ByteArray). self assert: result value isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 09:59'! testByteLiteral2 super testByteLiteral2. self assert: result isLiteral. self assert: (result value isKindOf: ByteArray). self assert: result value size = 1. self assert: result value first = 0! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 10:00'! testByteLiteral3 super testByteLiteral3. self assert: result isLiteral. self assert: (result value isKindOf: ByteArray). self assert: result value size = 1. self assert: result value first = 255! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 10:00'! testByteLiteral4 super testByteLiteral4. self assert: result isLiteral. self assert: (result value isKindOf: ByteArray). self assert: result value size = 2. self assert: result value first = 1. self assert: result value last = 2! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 10:02'! testByteLiteral5 super testByteLiteral5. self assert: result isLiteral. self assert: (result value isKindOf: ByteArray). self assert: result value size = 3. self assert: result value first = 10. self assert: result value second = 63. self assert: result value last = 255! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testCascadeExpression1 super testCascadeExpression1. self assert: result isCascade. self assert: result receiver isLiteral. self assert: result messages size = 2. self assert: result messages first receiver = result receiver. self assert: result messages first selector = #abs. self assert: result messages second receiver = result receiver. self assert: result messages second selector = #negated! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testCascadeExpression2 super testCascadeExpression2. self assert: result isCascade. self assert: result receiver isMessage. self assert: result receiver receiver isLiteral. self assert: result receiver receiver value = 1. self assert: result receiver selector = #abs. self assert: result messages size = 3. self assert: result messages first receiver = result receiver. self assert: result messages first selector = #negated. self assert: result messages second receiver = result receiver. self assert: result messages second selector = #raisedTo:. self assert: result messages third receiver = result receiver. self assert: result messages third selector = #negated! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testCascadeExpression3 super testCascadeExpression3. self assert: result isCascade. self assert: result receiver isLiteral. self assert: result receiver value = 1. self assert: result messages size = 2. self assert: result messages first receiver = result receiver. self assert: result messages first selector = #+. self assert: result messages first arguments size = 1. self assert: result messages second receiver = result receiver. self assert: result messages second selector = #-. self assert: result messages second arguments size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testCharLiteral1 super testCharLiteral1. self assert: result isLiteral. self assert: result value = $a! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testCharLiteral2 super testCharLiteral2. self assert: result isLiteral. self assert: result value = Character space! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testCharLiteral3 super testCharLiteral3. self assert: result isLiteral. self assert: result value = $$! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:57'! testComment1 super testComment1. self assert: result isMessage. self assert: result receiver isValue. self assert: result selector = #+. self assert: result arguments first isValue! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:57'! testComment2 super testComment2. self assert: result isMessage. self assert: result receiver isValue. self assert: result selector = #+. self assert: result arguments first isValue! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:57'! testComment3 super testComment3. self assert: result isMessage. self assert: result receiver isValue. self assert: result selector = #+. self assert: result arguments first isValue! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:57'! testComment4 super testComment4. self assert: result isMessage. self assert: result receiver isValue. self assert: result selector = #+. self assert: result arguments first isValue! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:57'! testComment5 super testComment5. self assert: result isMessage. self assert: result receiver isValue. self assert: result selector = #+. self assert: result arguments first isValue! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testComplexBlock1 super testComplexBlock1. self assert: result isBlock. self assert: result arguments size = 1. self assert: result body temporaries size = 1. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testComplexBlock2 super testComplexBlock2. self assert: result isBlock. self assert: result arguments size = 1. self assert: result body temporaries size = 1. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordExpression1 super testKeywordExpression1. self assert: result isMessage. self assert: result receiver isLiteral. self assert: result receiver value = 1. self assert: result selector = #to:. self assert: result arguments size = 1. self assert: result arguments first isLiteral. self assert: result arguments first value = 2! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordExpression2 super testKeywordExpression2. self assert: result isMessage. self assert: result receiver isLiteral. self assert: result selector = #to:by:. self assert: result arguments size = 2. self assert: result arguments first isLiteral. self assert: result arguments first value = 2. self assert: result arguments second isLiteral. self assert: result arguments second value = 3! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordExpression3 super testKeywordExpression3. self assert: result isMessage. self assert: result receiver isLiteral. self assert: result selector = #to:by:do:. self assert: result arguments size = 3. self assert: result arguments first isLiteral. self assert: result arguments first value = 2. self assert: result arguments second isLiteral. self assert: result arguments second value = 3. self assert: result arguments third isLiteral. self assert: result arguments third value = 4! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordMethod1 super testKeywordMethod1. self assert: result isMethod. self assert: result selector = #to:. self assert: result arguments size = 1. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordMethod2 super testKeywordMethod2. self assert: result isMethod. self assert: result selector = #to:do:. self assert: result arguments size = 2. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result arguments second isVariable. self assert: result arguments second name = 'b'. self assert: result body temporaries size = 1. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordMethod3 super testKeywordMethod3. self assert: result isMethod. self assert: result selector = #to:do:by:. self assert: result arguments size = 3. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result arguments second isVariable. self assert: result arguments second name = 'b'. self assert: result arguments third isVariable. self assert: result arguments third name = 'c'. self assert: result body temporaries isEmpty. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordMethod4 super testKeywordMethod4. self assert: result isMethod. self assert: result selector = #to:do:by:. self assert: result arguments size = 3. self assert: result arguments first isVariable. self assert: result arguments first name = 'a'. self assert: result arguments second isVariable. self assert: result arguments second name = 'b'. self assert: result arguments third isVariable. self assert: result arguments third name = 'c'. self assert: result body temporaries size = 1. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 5/20/2009 13:41'! testMethod1 super testMethod1. self assert: result isMethod. self assert: result arguments isEmpty. self assert: result body temporaries isEmpty. self assert: result body statements size = 1. self assert: result body statements first isReturn. self assert: result body statements first value isMessage. self assert: result body statements first value receiver isLiteral. self assert: result body statements first value selector = #-. self assert: result body statements first value arguments size = 1. self assert: result body statements first value arguments first isVariable! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 5/20/2009 13:41'! testMethod2 super testMethod2. self assert: result isMethod. self assert: result arguments isEmpty. self assert: result body temporaries isEmpty. self assert: result body statements size = 1. self assert: result body statements first isReturn. self assert: result body statements first value isMessage. self assert: result body statements first value receiver isLiteral. self assert: result body statements first value selector = #-. self assert: result body statements first value arguments size = 1. self assert: result body statements first value arguments first isVariable! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 5/20/2009 13:41'! testMethod3 super testMethod3. self assert: result isMethod. self assert: result arguments isEmpty. self assert: result body temporaries isEmpty. self assert: result body statements size = 1. self assert: result body statements first isReturn. self assert: result body statements first value isMessage. self assert: result body statements first value receiver isLiteral. self assert: result body statements first value selector = #-. self assert: result body statements first value arguments size = 1. self assert: result body statements first value arguments first isVariable! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral1 super testNumberLiteral1. self assert: result isLiteral. self assert: result value = 0! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral10 super testNumberLiteral10. self assert: result isLiteral. self assert: result value = 10! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral11 super testNumberLiteral11. self assert: result isLiteral. self assert: result value = 511! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral12 super testNumberLiteral12. self assert: result isLiteral. self assert: result value = 175! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral13 super testNumberLiteral13. self assert: result isLiteral. self assert: result value = 202.9921875! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral14 super testNumberLiteral14. self assert: result isLiteral. self assert: result value floor = -9! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral2 super testNumberLiteral2. self assert: result isLiteral. self assert: result value = 0.1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral3 super testNumberLiteral3. self assert: result isLiteral. self assert: result value = 123! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral4 super testNumberLiteral4. self assert: result isLiteral. self assert: result value = 123.456! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral5 super testNumberLiteral5. self assert: result isLiteral. self assert: result value = 0! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral6 super testNumberLiteral6. self assert: result isLiteral. self assert: result value = -0.1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral7 super testNumberLiteral7. self assert: result isLiteral. self assert: result value = -123! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral8 super testNumberLiteral8. self assert: result isLiteral. self assert: result value = -123! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral9 super testNumberLiteral9. self assert: result isLiteral. self assert: result value = -123.456! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:59'! testPragma1 super testPragma1. self assert: result pragmas format: #(''). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:51'! testPragma10 super testPragma10. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:00'! testPragma11 super testPragma11. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:00'! testPragma12 super testPragma12. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:00'! testPragma13 super testPragma13. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:51'! testPragma14 super testPragma14. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:06'! testPragma15 super testPragma15. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:56'! testPragma2 super testPragma2. self assert: result pragmas format: #( '' '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:57'! testPragma3 super testPragma3. self assert: result pragmas format: #( '' ). self assert: result body temporaries size = 1. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:57'! testPragma4 super testPragma4. self assert: result pragmas format: #( '' ). self assert: result body temporaries size = 1. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:57'! testPragma5 super testPragma5. self assert: result pragmas format: #( '' '' ). self assert: result body temporaries size = 1. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:00'! testPragma6 super testPragma6. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:00'! testPragma7 super testPragma7. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:00'! testPragma8 super testPragma8. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:51'! testPragma9 super testPragma9. self assert: result pragmas format: #( '' ). self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testSequence1 super testSequence1. self assert: result isSequence. self assert: result temporaries size = 1. self assert: result temporaries first isVariable. self assert: result temporaries first name = 'a'. self assert: result statements size = 2. self assert: result statements first isLiteral. self assert: result statements first value = 1. self assert: result statements second isLiteral. self assert: result statements second value = 2! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testSimpleBlock1 super testSimpleBlock1. self assert: result isBlock. self assert: result arguments isEmpty. self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testSimpleBlock2 super testSimpleBlock2. self assert: result isBlock. self assert: result arguments isEmpty. self assert: result body temporaries isEmpty. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 3/26/2009 17:02'! testSimpleBlock3 super testSimpleBlock3. self assert: result isBlock. self assert: result arguments size = 1. self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSpecialLiteral1 super testSpecialLiteral1. self assert: result isLiteral. self assert: result value = true! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSpecialLiteral2 super testSpecialLiteral2. self assert: result isLiteral. self assert: result value = false! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSpecialLiteral3 super testSpecialLiteral3. self assert: result isLiteral. self assert: result value = nil! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testStatementBlock1 super testStatementBlock1. self assert: result isBlock. self assert: result arguments isEmpty. self assert: result body temporaries isEmpty. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testStatementBlock2 super testStatementBlock2. self assert: result isBlock. self assert: result arguments isEmpty. self assert: result body temporaries size = 1. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testStatementBlock3 super testStatementBlock3. self assert: result isBlock. self assert: result arguments isEmpty. self assert: result body temporaries size = 2. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testStatements1 super testStatements1. self assert: result isSequence. self assert: result temporaries isEmpty. self assert: result statements size = 1. self assert: result statements first isLiteral. self assert: result statements first value = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testStatements2 super testStatements2. self assert: result isSequence. self assert: result temporaries isEmpty. self assert: result statements size = 2. self assert: result statements first isLiteral. self assert: result statements first value = 1. self assert: result statements second isLiteral. self assert: result statements second value = 2! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testStatements3 super testStatements3. self assert: result isSequence. self assert: result temporaries isEmpty. self assert: result statements size = 3. self assert: result statements first isLiteral. self assert: result statements first value = 1. self assert: result statements second isLiteral. self assert: result statements second value = 2. self assert: result statements third isLiteral. self assert: result statements third value = 3! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 3/26/2009 16:13'! testStatements4 super testStatements4. self assert: result isSequence. self assert: result temporaries isEmpty. self assert: result statements size = 3. self assert: result statements first isLiteral. self assert: result statements first value = 1. self assert: result statements second isLiteral. self assert: result statements second value = 2. self assert: result statements third isLiteral. self assert: result statements third value = 3! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 3/26/2009 16:14'! testStatements5 super testStatements5. self assert: result isSequence. self assert: result temporaries isEmpty. self assert: result statements size = 2. self assert: result statements first isLiteral. self assert: result statements first value = 1. self assert: result statements second isLiteral. self assert: result statements second value = 2! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testStringLiteral1 super testStringLiteral1. self assert: result isLiteral. self assert: result value = ''! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testStringLiteral2 super testStringLiteral2. self assert: result isLiteral. self assert: result value = 'ab'! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testStringLiteral3 super testStringLiteral3. self assert: result isLiteral. self assert: result value = 'ab''cd'! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral1 super testSymbolLiteral1. self assert: result isLiteral. self assert: result value = #foo! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral2 super testSymbolLiteral2. self assert: result isLiteral. self assert: result value = #+! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral3 super testSymbolLiteral3. self assert: result isLiteral. self assert: result value = #key:! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral4 super testSymbolLiteral4. self assert: result isLiteral. self assert: result value = #key:value:! ! !LBSmalltalkCompilerTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral5 super testSymbolLiteral5. self assert: result isLiteral. self assert: result value = #'testing-result'! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testTemporaries1 super testTemporaries1. self assert: result isSequence. self assert: result temporaries size = 1. self assert: result temporaries first isVariable. self assert: result temporaries first name = 'a'. self assert: result statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testTemporaries2 super testTemporaries2. self assert: result isSequence. self assert: result temporaries size = 2. self assert: result temporaries first isVariable. self assert: result temporaries first name = 'a'. self assert: result temporaries second isVariable. self assert: result temporaries second name = 'b'. self assert: result statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testTemporaries3 super testTemporaries3. self assert: result isSequence. self assert: result temporaries size = 3. self assert: result temporaries first isVariable. self assert: result temporaries first name = 'a'. self assert: result temporaries second isVariable. self assert: result temporaries second name = 'b'. self assert: result temporaries third isVariable. self assert: result temporaries third name = 'c'. self assert: result statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryExpression1 super testUnaryExpression1. self assert: result isMessage. self assert: result receiver isLiteral. self assert: result selector = #abs. self assert: result arguments isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryExpression2 super testUnaryExpression2. self assert: result isMessage. self assert: result receiver isMessage. self assert: result receiver receiver isLiteral. self assert: result receiver receiver value = 1. self assert: result receiver selector = #abs. self assert: result receiver arguments isEmpty. self assert: result selector = #negated. self assert: result arguments isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod1 super testUnaryMethod1. self assert: result isMethod. self assert: result selector = #abs. self assert: result arguments isEmpty. self assert: result body temporaries isEmpty. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod2 super testUnaryMethod2. self assert: result isMethod. self assert: result selector = #abs. self assert: result arguments isEmpty. self assert: result body temporaries size = 1. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod3 super testUnaryMethod3. self assert: result isMethod. self assert: result selector = #abs. self assert: result arguments isEmpty. self assert: result body temporaries isEmpty. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod4 super testUnaryMethod4. self assert: result isMethod. self assert: result selector = #abs. self assert: result arguments isEmpty. self assert: result body temporaries size = 1. self assert: result body statements size = 1! ! !LBSmalltalkCompilerTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod5 super testUnaryMethod5. self assert: result isMethod. self assert: result selector = #abs. self assert: result arguments isEmpty. self assert: result body temporaries size = 1. self assert: result body statements isEmpty! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:19'! testVariable1 super testVariable1. self assert: result isVariable. self assert: result name = 'trueBinding'! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:19'! testVariable2 super testVariable2. self assert: result isVariable. self assert: result name = 'falseBinding'! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:19'! testVariable3 super testVariable3. self assert: result isVariable. self assert: result name = 'nilly'! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:19'! testVariable4 super testVariable4. self assert: result isVariable. self assert: result name = 'selfish'! ! !LBSmalltalkCompilerTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:19'! testVariable5 super testVariable5. self assert: result isVariable. self assert: result name = 'supernanny'! ! !LBSmalltalkGrammarTests methodsFor: 'accessing' stamp: 'lr 5/4/2010 14:04'! parserClass ^ PPSmalltalkGrammar! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testArgumentsBlock1 self parse: '[ :a | ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testArgumentsBlock2 self parse: '[ :a :b | ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testArgumentsBlock3 self parse: '[ :a :b :c | ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral1 self parse: '#()' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral10 self parse: '#((1 2) #(1 2 3))' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 09:46'! testArrayLiteral11 self parse: '#([1 2] #[1 2 3])' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral2 self parse: '#(1)' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral3 self parse: '#(1 2)' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral4 self parse: '#(true false nil)' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral5 self parse: '#($a)' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral6 self parse: '#(1.2)' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 09:45'! testArrayLiteral7 self parse: '#(size #at: at:put: #''=='')' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral8 self parse: '#(''baz'')' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testArrayLiteral9 self parse: '#((1) 2))' rule: #arrayLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment1 self parse: '1' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment2 self parse: 'a := 1' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment3 self parse: 'a := b := 1' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment4 self parse: 'a _ 1' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testAssignment5 self parse: 'a _ b _ 1' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryExpression1 self parse: '1 + 2' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryExpression2 self parse: '1 + 2 + 3' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryMethod1 self parse: '+ a' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryMethod2 self parse: '+ a | b |' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryMethod3 self parse: '+ a b' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testBinaryMethod4 self parse: '+ a | b | c' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 09:44'! testByteLiteral1 self parse: '#[]' rule: #byteLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 09:50'! testByteLiteral2 self parse: '#[0]' rule: #byteLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 09:50'! testByteLiteral3 self parse: '#[255]' rule: #byteLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 09:50'! testByteLiteral4 self parse: '#[ 1 2 ]' rule: #byteLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 1/30/2009 10:02'! testByteLiteral5 self parse: '#[ 2r1010 8r77 16rFF ]' rule: #byteLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testCascadeExpression1 self parse: '1 abs; negated' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testCascadeExpression2 self parse: '1 abs negated; raisedTo: 12; negated' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testCascadeExpression3 self parse: '1 + 2; - 3' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testCharLiteral1 self parse: '$a' rule: #charLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testCharLiteral2 self parse: '$ ' rule: #charLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testCharLiteral3 self parse: '$$' rule: #charLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:55'! testComment1 self parse: '1"one"+2' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:55'! testComment2 self parse: '1 "one" +2' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:56'! testComment3 self parse: '1"one"+"two"2' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:56'! testComment4 self parse: '1"one""two"+2' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 1/22/2009 14:56'! testComment5 self parse: '1"one" "two"+2' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testComplexBlock1 self parse: '[ :a | | b | c ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testComplexBlock2 self parse: '[:a||b|c]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordExpression1 self parse: '1 to: 2' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordExpression2 self parse: '1 to: 2 by: 3' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordExpression3 self parse: '1 to: 2 by: 3 do: 4' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordMethod1 self parse: 'to: a' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordMethod2 self parse: 'to: a do: b | c |' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordMethod3 self parse: 'to: a do: b by: c d' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testKeywordMethod4 self parse: 'to: a do: b by: c | d | e' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 5/20/2009 13:38'! testMethod1 self parse: 'negated ^ 0 - self' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 5/20/2009 13:41'! testMethod2 "Spaces at the beginning of the method." self parse: ' negated ^ 0 - self' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 5/20/2009 13:42'! testMethod3 "Spaces at the end of the method." self parse: ' negated ^ 0 - self ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral1 self parse: '0' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral10 self parse: '10r10' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral11 self parse: '8r777' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral12 self parse: '16rAF' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral13 self parse: '16rCA.FE' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral14 self parse: '3r-22.2' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral2 self parse: '0.1' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral3 self parse: '123' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral4 self parse: '123.456' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral5 self parse: '-0' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral6 self parse: '-0.1' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral7 self parse: '-123' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral8 self parse: '-123' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testNumberLiteral9 self parse: '-123.456' rule: #numberLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 10/23/2008 15:53'! testPragma1 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:52'! testPragma10 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:52'! testPragma11 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:52'! testPragma12 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:52'! testPragma13 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:05'! testPragma14 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 15:05'! testPragma15 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:37'! testPragma2 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 10/23/2008 15:53'! testPragma3 self parse: 'method | a | ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 10/23/2008 15:53'! testPragma4 self parse: 'method | a |' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 10/23/2008 15:53'! testPragma5 self parse: 'method | a | ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:36'! testPragma6 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:37'! testPragma7 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:37'! testPragma8 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-pragmas' stamp: 'lr 3/26/2009 14:37'! testPragma9 self parse: 'method ' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testSequence1 self parse: '| a | 1 . 2' rule: #sequence! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testSimpleBlock1 self parse: '[ ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testSimpleBlock2 self parse: '[ nil ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 3/26/2009 16:11'! testSimpleBlock3 self parse: '[ :a ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSpecialLiteral1 self parse: 'true' rule: #trueLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSpecialLiteral2 self parse: 'false' rule: #falseLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSpecialLiteral3 self parse: 'nil' rule: #nilLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testStatementBlock1 self parse: '[ nil ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testStatementBlock2 self parse: '[ | a | nil ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing-blocks' stamp: 'lr 10/23/2008 15:53'! testStatementBlock3 self parse: '[ | a b | nil ]' rule: #block! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testStatements1 self parse: '1' rule: #sequence! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testStatements2 self parse: '1 . 2' rule: #sequence! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testStatements3 self parse: '1 . 2 . 3' rule: #sequence! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:11'! testStatements4 self parse: '1 . 2 . 3 .' rule: #sequence! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 3/26/2009 16:13'! testStatements5 self parse: '1 . . 2' rule: #sequence! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testStringLiteral1 self parse: '''''' rule: #stringLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testStringLiteral2 self parse: '''ab''' rule: #stringLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testStringLiteral3 self parse: '''ab''''cd''' rule: #stringLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral1 self parse: '#foo' rule: #symbolLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral2 self parse: '#+' rule: #symbolLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral3 self parse: '#key:' rule: #symbolLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral4 self parse: '#key:value:' rule: #symbolLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing-literals' stamp: 'lr 10/23/2008 15:53'! testSymbolLiteral5 self parse: '#''testing-result''' rule: #symbolLiteral! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testTemporaries1 self parse: '| a |' rule: #sequence! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testTemporaries2 self parse: '| a b |' rule: #sequence! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 10/23/2008 15:53'! testTemporaries3 self parse: '| a b c |' rule: #sequence! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryExpression1 self parse: '1 abs' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryExpression2 self parse: '1 abs negated' rule: #expression! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod1 self parse: 'abs' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod2 self parse: 'abs | a |' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod3 self parse: 'abs a' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod4 self parse: 'abs | a | b' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing-messages' stamp: 'lr 10/23/2008 15:53'! testUnaryMethod5 self parse: 'abs | a |' rule: #method! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:14'! testVariable1 self parse: 'trueBinding' rule: #primary! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:17'! testVariable2 self parse: 'falseBinding' rule: #primary! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:17'! testVariable3 self parse: 'nilly' rule: #primary! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:18'! testVariable4 self parse: 'selfish' rule: #primary! ! !LBSmalltalkGrammarTests methodsFor: 'testing' stamp: 'lr 3/18/2009 10:18'! testVariable5 self parse: 'supernanny' rule: #primary! ! LBSmalltalkGrammarTests subclass: #LBSmalltalkHighlighterTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-Smalltalk'! !LBSmalltalkHighlighterTests methodsFor: 'accessing' stamp: 'lr 5/4/2010 14:05'! parserClass ^ PPSmalltalkHighlighter! ! LBGrammarTest subclass: #LBSmalltalkPackagesTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-Smalltalk'! !LBSmalltalkPackagesTests commentStamp: 'lr 3/26/2009 16:09' prior: 0! Evalaute the following code to verify the complete image. PackageOrganizer default packages inject: LAPackagesTests new into: [ :test :package | [ test verifyPackage: package packageName ] on: TestResult resumableFailure do: [ :err | err resume ] ]! !LBSmalltalkPackagesTests methodsFor: 'private' stamp: 'lr 3/26/2009 14:32'! assert: aBoolean description: aString aBoolean ifFalse: [ Transcript show: aString; cr ]. self assert: aBoolean description: aString resumable: true! ! !LBSmalltalkPackagesTests methodsFor: 'accessing' stamp: 'lr 5/4/2010 14:05'! parserClass ^ PPSmalltalkParser! ! !LBSmalltalkPackagesTests methodsFor: 'testing' stamp: 'lr 3/26/2009 15:47'! testBoolean self verifyClass: Boolean. self verifyClass: True. self verifyClass: False! ! !LBSmalltalkPackagesTests methodsFor: 'testing' stamp: 'lr 3/26/2009 15:56'! testCollection self verifyClass: Collection. self verifyClass: Array. self verifyClass: Set. self verifyClass: Dictionary. self verifyClass: Bag. self verifyClass: OrderedCollection. self verifyClass: SortedCollection! ! !LBSmalltalkPackagesTests methodsFor: 'testing' stamp: 'lr 3/26/2009 15:56'! testMagnitude self verifyClass: Magnitude. self verifyClass: Point. self verifyClass: Integer. self verifyClass: SmallInteger. self verifyClass: Fraction. self verifyClass: Float! ! !LBSmalltalkPackagesTests methodsFor: 'testing' stamp: 'lr 3/26/2009 15:57'! testObject self verifyClass: Object. self verifyClass: ProtoObject! ! !LBSmalltalkPackagesTests methodsFor: 'private' stamp: 'lr 3/26/2009 14:28'! verifyClass: aClass aClass selectors do: [ :selector | self verifyClass: aClass selector: selector ] displayingProgress: aClass name! ! !LBSmalltalkPackagesTests methodsFor: 'private' stamp: 'lr 5/4/2010 14:12'! verifyClass: aClass selector: aSelector "Verifies that the method aSelector in aClass parses the same using the standard refactoring parser and the language boxes parser. Methods that contain float literals are ignored, since they do not reproduce well. Furthermore methods with pragmas are not actually compared as they might pretty print differently." | source original other | source := aClass sourceCodeAt: aSelector. source isNil ifTrue: [ ^ self ]. original := aClass parseTreeFor: aSelector. original isNil ifTrue: [ ^ self ]. original nodesDo: [ :each | each comments: nil ]. other := self parser parse: source. source := aClass name , '>>#' , source. other isPetitFailure ifTrue: [ self assert: false description: source ] ifFalse: [ (other pragmas isEmpty and: [ ((aClass compiledMethodAt: aSelector) hasLiteralSuchThat: [ :literal | literal isFloat ]) not ]) ifTrue: [ self assert: original formattedCode = other formattedCode description: source ] ]! ! !LBSmalltalkPackagesTests methodsFor: 'private' stamp: 'lr 3/26/2009 14:28'! verifyPackage: aString | package | package := PackageInfo named: aString. package classesAndMetaClasses do: [ :each | self verifyClass: each ] displayingProgress: aString! ! LBGrammarTest subclass: #LBSqlGrammarTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-SQL'! LBSqlGrammarTests subclass: #LBSqlCompilerTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-SQL'! !LBSqlCompilerTests methodsFor: 'accessing' stamp: 'lr 6/30/2009 13:48'! parserClass ^ LBSqlCompiler! ! !LBSqlGrammarTests methodsFor: 'accessing' stamp: 'lr 6/30/2009 12:00'! parserClass ^ LBSqlGrammar! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:17'! testCreate1 self parse: 'CREATE foo (a) WITH VALUES (1)'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:17'! testCreate2 self parse: 'CREATE foo (a, b) WITH VALUES (1, 2)'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:24'! testCreate3 self parse: 'CREATE foo (a, b, c) WITH VALUES (1, 2, "foo bar")'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:16'! testDelete1 self parse: 'DELETE FROM foo'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:24'! testDelete2 self parse: 'DELETE FROM "ZorkCommander" WHERE a = 43'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:24'! testInsert1 self parse: 'INSERT INTO foo (a) VALUES ("This is a longer string")'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:24'! testInsert2 self parse: 'INSERT INTO foo ("a", b) VALUES (1, "2")'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:10'! testInsert3 self parse: 'INSERT INTO foo (a, b, c) VALUES (1, 2, 3)'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:00'! testSelect1 self parse: 'SELECT * FROM foo'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:01'! testSelect2 self parse: 'SELECT a, b, c FROM foo'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:24'! testSelect3 self parse: 'SELECT * FROM foo WHERE a !!= b'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:01'! testSelect4 self parse: 'SELECT * FROM foo LIMIT 13'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:24'! testSelect5 self parse: 'SELECT * FROM foo WHERE a > 12 LIMIT 13'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:38'! testUpdate1 self parse: 'UPDATE foo SET a = 12'! ! !LBSqlGrammarTests methodsFor: 'testing' stamp: 'lr 6/30/2009 12:25'! testUpdate2 self parse: 'UPDATE foo SET a = 12 WHERE b >= 13'! ! LBSqlGrammarTests subclass: #LBSqlHighlighterTests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Tests-SQL'! !LBSqlHighlighterTests methodsFor: 'accessing' stamp: 'lr 6/30/2009 13:48'! parserClass ^ LBSqlHighlighter! ! !QQSpliceNode class methodsFor: '*languageboxes' stamp: 'lr 4/6/2009 10:21'! highlight: aCollection ^ CHHighlighter mark: aCollection with: Color darkGray! ! Object subclass: #LBBrokenMethod instanceVariableNames: 'theClass selector source' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Core'! !LBBrokenMethod class methodsFor: 'instance creation' stamp: 'lr 10/30/2008 14:42'! class: aClass selector: aSelector source: aString ^ self new initializeClass: aClass selector: aSelector source: aString! ! !LBBrokenMethod methodsFor: 'accessing' stamp: 'lr 10/30/2008 14:53'! compiledMethod ^ self! ! !LBBrokenMethod methodsFor: 'source' stamp: 'lr 10/30/2008 14:48'! flushCache! ! !LBBrokenMethod methodsFor: 'source' stamp: 'lr 10/30/2008 14:38'! getSource ^ source! ! !LBBrokenMethod methodsFor: 'source' stamp: 'lr 10/30/2008 14:49'! getSourceFor: aSelector in: aClass ^ source! ! !LBBrokenMethod methodsFor: 'source' stamp: 'lr 10/30/2008 15:07'! getSourceFromFile ^ source! ! !LBBrokenMethod methodsFor: 'literals' stamp: 'lr 10/30/2008 14:37'! hasLiteral: anObject ^ false! ! !LBBrokenMethod methodsFor: 'initialization' stamp: 'lr 10/30/2008 14:28'! initializeClass: aClass selector: aSelector source: aString theClass := aClass. selector := aSelector. source := aString! ! !LBBrokenMethod methodsFor: 'testing' stamp: 'lr 10/30/2008 15:08'! isBroken ^ true! ! !LBBrokenMethod methodsFor: 'testing' stamp: 'lr 10/30/2008 14:55'! isRequired ^ false! ! !LBBrokenMethod methodsFor: 'testing' stamp: 'lr 10/30/2008 14:53'! isSubclassResponsibility ^ false! ! !LBBrokenMethod methodsFor: 'literals' stamp: 'lr 10/30/2008 14:36'! literals ^ #()! ! !LBBrokenMethod methodsFor: 'accessing' stamp: 'lr 10/30/2008 14:38'! methodClass ^ theClass! ! !LBBrokenMethod methodsFor: 'protocol' stamp: 'lr 10/30/2008 15:13'! methodClass: aClass! ! !LBBrokenMethod methodsFor: 'accessing' stamp: 'lr 10/30/2008 14:35'! pragmas ^ #()! ! !LBBrokenMethod methodsFor: 'accessing' stamp: 'lr 9/2/2010 11:57'! properties ^ AdditionalMethodState forMethod: self selector: self selector! ! !LBBrokenMethod methodsFor: 'evaluating' stamp: 'lr 10/30/2008 14:26'! run: aSelector with: anArray in: anObject self error: 'Unable to compile ' , aSelector printString! ! !LBBrokenMethod methodsFor: 'accessing' stamp: 'lr 10/30/2008 14:38'! selector ^ selector! ! !LBBrokenMethod methodsFor: 'protocol' stamp: 'lr 10/30/2008 15:13'! selector: aSelector! ! !LBBrokenMethod methodsFor: 'accessing' stamp: 'lr 10/30/2008 14:53'! sendsToSuper ^ false! ! !LBBrokenMethod methodsFor: 'source' stamp: 'lr 10/30/2008 15:16'! sourcePointer ^ 0! ! !LBBrokenMethod methodsFor: 'accessing' stamp: 'lr 10/30/2008 14:57'! timeStamp ^ nil! ! !LBBrokenMethod methodsFor: 'accessing' stamp: 'lr 9/2/2010 11:58'! trailer ^ CompiledMethodTrailer empty! ! Object subclass: #LBChange instanceVariableNames: 'fragment production action class' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Core'! !LBChange methodsFor: 'operators' stamp: 'lr 6/23/2009 11:22'! , anAdvice ^ LBChangeSequence new , self , anAdvice! ! !LBChange methodsFor: 'accessing' stamp: 'lr 1/19/2009 09:57'! action: aSymbol "The action to apply." action := aSymbol asSymbol! ! !LBChange methodsFor: 'accessing-place' stamp: 'lr 6/23/2009 11:27'! after: aGrammar "Insert the new grammar after the rule aGrammar." self action: #after. self production: aGrammar! ! !LBChange methodsFor: 'accessing-place' stamp: 'lr 6/23/2009 11:27'! before: aGrammar "Insert the new grammar before the rule aGrammar." self action: #before. self production: aGrammar! ! !LBChange methodsFor: 'accessing-list' stamp: 'lr 10/10/2008 15:39'! choice "Use a choice to combine the two grammars." class := PPChoiceParser! ! !LBChange methodsFor: 'accessing' stamp: 'lr 6/30/2009 14:42'! fragment: aGrammar "The grammar fragment to introduce." fragment := aGrammar asParser! ! !LBChange methodsFor: 'initialization' stamp: 'lr 6/30/2009 14:43'! initialize self choice; after: PPEpsilonParser new. self fragment: (PPFailingParser message: 'Invalid Parser')! ! !LBChange methodsFor: 'public' stamp: 'lr 6/30/2009 15:29'! modify: aGrammar with: aBox | copied wrapped | copied := production copy. wrapped := aBox isNil ifTrue: [ fragment ] ifFalse: [ fragment ==> [ :nodes | aBox perform: aGrammar class concern with: (aBox transform: nodes) ] ]. production def: (action = #replace ifTrue: [ wrapped ] ifFalse: [ action = #before ifTrue: [ class with: wrapped with: copied ] ifFalse: [ action = #after ifTrue: [ class with: copied with: wrapped ] ifFalse: [ self error: 'Invalid change action.' ] ] ])! ! !LBChange methodsFor: 'accessing' stamp: 'lr 6/23/2009 11:26'! production: aGrammar "The production to change." production := aGrammar asParser! ! !LBChange methodsFor: 'accessing-place' stamp: 'lr 6/23/2009 11:27'! replace: aGrammar "Replace the aGrammar." self action: #replace. self production: aGrammar! ! !LBChange methodsFor: 'accessing-list' stamp: 'lr 1/19/2009 09:38'! sequence "Use a sequence to combine the two grammars." class := PPSequenceParser! ! Object subclass: #LBChangeSequence instanceVariableNames: 'changes' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Core'! !LBChangeSequence methodsFor: 'operators' stamp: 'lr 6/23/2009 11:20'! , aChange changes add: aChange! ! !LBChangeSequence methodsFor: 'initialization' stamp: 'lr 6/23/2009 11:20'! initialize super initialize. changes := OrderedCollection new! ! !LBChangeSequence methodsFor: 'public' stamp: 'lr 6/23/2009 11:21'! modify: aGrammar with: aBox changes do: [ :change | change modify: aGrammar with: aBox ]! ! Object subclass: #LBLanguageBox instanceVariableNames: 'active environments' classVariableNames: '' poolDictionaries: '' category: 'LanguageBoxes-Core'! LBLanguageBox class instanceVariableNames: 'default'! LBLanguageBox class instanceVariableNames: 'default'! !LBLanguageBox class methodsFor: 'querying' stamp: 'lr 6/23/2009 12:08'! activeFor: aContext do: aBlock self all do: [ :box | (box isActiveFor: aContext) ifTrue: [ aBlock value: box ] ]! ! !LBLanguageBox class methodsFor: 'accessing' stamp: 'lr 6/23/2009 11:24'! all "Answer all language boxes of the system." ^ self allSubclasses collect: [ :each | each default ]! ! !LBLanguageBox class methodsFor: 'accessing' stamp: 'lr 6/23/2009 11:24'! default "Answer the langauage box instance of the receiver." ^ default ifNil: [ default := self new ]! ! !LBLanguageBox class methodsFor: 'configuration' stamp: 'lr 6/23/2009 11:52'! languageBoxesHighlight ^ nil! ! !LBLanguageBox class methodsFor: 'configuration' stamp: 'lr 6/23/2009 11:53'! languageBoxesParser ^ nil! ! !LBLanguageBox class methodsFor: 'initialization' stamp: 'lr 10/28/2008 15:30'! recompile self all do: [ :each | each recompile ]! ! !LBLanguageBox class methodsFor: 'initialization' stamp: 'lr 10/28/2008 15:30'! unload self all do: [ :each | each disable ]! ! !LBLanguageBox methodsFor: 'private' stamp: 'lr 6/23/2009 11:24'! active: aBoolean "Enable or disable the receiving language box." active = aBoolean ifTrue: [ ^ self ]. active := aBoolean. self recompile! ! !LBLanguageBox methodsFor: 'scoping' stamp: 'lr 6/23/2009 11:24'! add: anEnvironment "Add anEnvironment to the receiving language box and incrementally update all code." environments := environments copyWith: anEnvironment. self isActive ifTrue: [ self recompile: anEnvironment ]. ^ anEnvironment! ! !LBLanguageBox methodsFor: 'scoping' stamp: 'lr 10/28/2008 15:10'! addClass: aClass ^ self add: (BrowserEnvironment new forClasses: (Array with: aClass))! ! !LBLanguageBox methodsFor: 'scoping' stamp: 'lr 10/28/2008 15:10'! addPackage: aString ^ self add: (BrowserEnvironment new forPackageNamed: aString)! ! !LBLanguageBox methodsFor: 'scoping' stamp: 'lr 10/28/2008 15:10'! addPragma: aKeyword ^ self add: (BrowserEnvironment new forPragmas: (Array with: aKeyword))! ! !LBLanguageBox methodsFor: 'hooks' stamp: 'lr 6/30/2009 14:03'! change: aGrammar "A hook method that that answers an change on how to modify the language. aGrammar is the original language model and might be used to reference existing grammar productions." self subclassResponsibility! ! !LBLanguageBox methodsFor: 'hooks' stamp: 'lr 6/30/2009 14:03'! compile: aCollection "A hook method that that transforms a collection of token to the AST." ^ aCollection lift! ! !LBLanguageBox methodsFor: 'actions' stamp: 'lr 6/23/2009 11:25'! disable "Disable the receiving langauge box." self active: false! ! !LBLanguageBox methodsFor: 'actions' stamp: 'lr 6/23/2009 11:25'! enable "Enable the receiving language box." self active: true! ! !LBLanguageBox methodsFor: 'accessing' stamp: 'lr 11/11/2008 16:10'! environment "Answer the users of environment of the receiver." | environment | environment := self environments inject: BrowserEnvironment new not into: [ :result :each | result | each ]. environment label: 'Users of ' , self name. ^ environment! ! !LBLanguageBox methodsFor: 'accessing' stamp: 'lr 10/28/2008 15:24'! environments "Answer the environments of the receiver." ^ environments! ! !LBLanguageBox methodsFor: 'hooks' stamp: 'lr 1/19/2009 09:27'! highlight: aCollection "A hook method that that highlights a collection of token to the AST, by default do not highlight anything." ^ aCollection! ! !LBLanguageBox methodsFor: 'testing' stamp: 'lr 6/23/2009 11:25'! includesSelector: aSelector in: aClass "Answer whether the receiving language box is active in the given context or not." ^ self environments anySatisfy: [ :each | each includesSelector: aSelector in: aClass ]! ! !LBLanguageBox methodsFor: 'initialization' stamp: 'lr 11/6/2008 14:09'! initialize active := true. environments := #()! ! !LBLanguageBox methodsFor: 'testing' stamp: 'lr 6/23/2009 11:25'! isActive "Answer wether the receiving language box is active or not." ^ active! ! !LBLanguageBox methodsFor: 'testing' stamp: 'lr 6/23/2009 11:25'! isActiveFor: aContext "Answer whether the receiving language box is active for the given context." ^ self isActive and: [ self includesSelector: aContext selector in: aContext theClass ]! ! !LBLanguageBox methodsFor: 'public' stamp: 'lr 6/23/2009 11:17'! modify: aGrammar "Modify a grammar by applying a change object to it." (self change: aGrammar) modify: aGrammar with: self! ! !LBLanguageBox methodsFor: 'accessing' stamp: 'lr 10/2/2009 14:48'! name "A human readable name of the language box." ^ self class name! ! !LBLanguageBox methodsFor: 'actions' stamp: 'lr 6/23/2009 12:04'! recompile "Recompile all the affected methods in the selected enviornments." | environment | environment := SelectorEnvironment new. self environments do: [ :each | (self recompile: each) classesAndSelectorsDo: [ :class :selector | environment addClass: class selector: selector ] ]. ^ environment label: 'Broken methods'! ! !LBLanguageBox methodsFor: 'actions' stamp: 'lr 6/23/2009 11:22'! recompile: anEnvironment "Recompile all the affected methods in anEnvironment." | environment | environment := SelectorEnvironment new. environment label: 'Broken methods'. anEnvironment classesAndSelectorsDo: [ :class :selector | [ self recompileClass: class selector: selector ] on: SmaCCParserError do: [ :err | class methodDictionary at: selector ifPresent: [ :method | environment addClass: class selector: selector. class methodDictAddSelectorSilently: selector withMethod: (LBBrokenMethod class: class selector: selector source: method getSource) ] ] ]. ^ environment! ! !LBLanguageBox methodsFor: 'private' stamp: 'lr 10/30/2008 15:14'! recompileClass: aClass selector: aSelector | method | method := aClass methodDictionary at: aSelector ifAbsent: [ ^ self ]. method isBroken ifTrue: [ aClass compile: method getSource ] ifFalse: [ aClass recompile: aSelector ]! ! !LBLanguageBox methodsFor: 'scoping' stamp: 'lr 10/28/2008 15:25'! remove: anEnvironment "Removes anEnvironment from the scope of the receiver and incrementally update all code." environments := environments copyWithout: anEnvironment. self isActive ifTrue: [ self recompile: anEnvironment ]. ^ anEnvironment! ! !LBLanguageBox methodsFor: 'hooks' stamp: 'lr 3/9/2009 17:41'! transform: aToken "A hook method that that is always called with the parse result of the parse tree advice." ^ aToken! ! LBSmalltalkGrammar initialize! LBSmalltalkHighlighter initialize! LBSqlHighlighter initialize!