# HG changeset patch # User Jan Vrany # Date 1438241857 -3600 # Node ID 869853decf31826c68cd56ea3bf312ed75360e69 # Parent fd22630c7e628b8199f0d84ab30b31176416b643 Tests refactoring - use generated test cases to make sure all posibilities are tested. Do not generate resource for all combinations, use PPCSetUpBeforeTearDownAfterResource instead that delegates parser compilation to the testcase itself (it calls it's #setUpBefore method). diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/Make.proto --- a/compiler/tests/extras/Make.proto Fri Jul 31 08:22:18 2015 +0100 +++ b/compiler/tests/extras/Make.proto Thu Jul 30 08:37:37 2015 +0100 @@ -34,7 +34,7 @@ # add the path(es) here:, # ********** OPTIONAL: MODIFY the next lines *** # LOCALINCLUDES=-Ifoo -Ibar -LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/petitparser -I$(INCLUDE_TOP)/stx/goodies/petitparser/compiler -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/java -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk -I$(INCLUDE_TOP)/stx/goodies/petitparser/tests -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2 +LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/petitparser -I$(INCLUDE_TOP)/stx/goodies/petitparser/compiler -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/java -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk -I$(INCLUDE_TOP)/stx/goodies/petitparser/parsers/smalltalk/tests -I$(INCLUDE_TOP)/stx/goodies/petitparser/tests -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2 # if you need any additional defines for embedded C code, @@ -109,6 +109,7 @@ cd ../../../../sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)" cd ../../../tests && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)" cd ../../../parsers/java && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)" + cd ../../../parsers/smalltalk/tests && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)" @@ -128,31 +129,7 @@ # BEGINMAKEDEPEND --- do not remove this line; make depend needs it -$(OUTDIR)PPCCompiledJavaVerificationTest.$(O) PPCCompiledJavaVerificationTest.$(H): PPCCompiledJavaVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCExpressionsVerificationTest.$(O) PPCExpressionsVerificationTest.$(H): PPCExpressionsVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCResources.$(O) PPCResources.$(H): PPCResources.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCSmalltalkTests.$(O) PPCSmalltalkTests.$(H): PPCSmalltalkTests.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCSmalltalkVerificationTest.$(O) PPCSmalltalkVerificationTest.$(H): PPCSmalltalkVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledExpressionGrammarResource.$(O) PPCompiledExpressionGrammarResource.$(H): PPCompiledExpressionGrammarResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledExpressionGrammarTest.$(O) PPCompiledExpressionGrammarTest.$(H): PPCompiledExpressionGrammarTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPCompositeParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledJavaResource.$(O) PPCompiledJavaResource.$(H): PPCompiledJavaResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledSmalltalkGrammarResource.$(O) PPCompiledSmalltalkGrammarResource.$(H): PPCompiledSmalltalkGrammarResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledSmalltalkGrammarTests.$(O) PPCompiledSmalltalkGrammarTests.$(H): PPCompiledSmalltalkGrammarTests.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPCompositeParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPExpressionGrammar.$(O) PPExpressionGrammar.$(H): PPExpressionGrammar.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPCompositeParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPExpressionGrammarTest.$(O) PPExpressionGrammarTest.$(H): PPExpressionGrammarTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPCompositeParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPLL1ExpressionGrammar.$(O) PPLL1ExpressionGrammar.$(H): PPLL1ExpressionGrammar.st $(INCLUDE_TOP)/stx/goodies/petitparser/PPCompositeParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPDelegateParser.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/PPParser.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPLL1ExpressionGrammarTest.$(O) PPLL1ExpressionGrammarTest.$(H): PPLL1ExpressionGrammarTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPCompositeParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedExpressionGrammarResource.$(O) PPTokenizedExpressionGrammarResource.$(H): PPTokenizedExpressionGrammarResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedExpressionGrammarTest.$(O) PPTokenizedExpressionGrammarTest.$(H): PPTokenizedExpressionGrammarTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPCompositeParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedLL1ExpressionGrammarResource.$(O) PPTokenizedLL1ExpressionGrammarResource.$(H): PPTokenizedLL1ExpressionGrammarResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedLL1ExpressionGrammarTest.$(O) PPTokenizedLL1ExpressionGrammarTest.$(H): PPTokenizedLL1ExpressionGrammarTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPCompositeParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedSmalltalkGrammarResource.$(O) PPTokenizedSmalltalkGrammarResource.$(H): PPTokenizedSmalltalkGrammarResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedSmalltalkGrammarTests.$(O) PPTokenizedSmalltalkGrammarTests.$(H): PPTokenizedSmalltalkGrammarTests.st $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPCompositeParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)stx_goodies_petitparser_compiler_tests_extras.$(O) stx_goodies_petitparser_compiler_tests_extras.$(H): stx_goodies_petitparser_compiler_tests_extras.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR) -$(OUTDIR)PPCompiledExpressionsVerificationTest.$(O) PPCompiledExpressionsVerificationTest.$(H): PPCompiledExpressionsVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/compiler/tests/extras/PPCExpressionsVerificationTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledSmalltalkVerificationTest.$(O) PPCompiledSmalltalkVerificationTest.$(H): PPCompiledSmalltalkVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/compiler/tests/extras/PPCSmalltalkVerificationTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedExpressionsVerificationTest.$(O) PPTokenizedExpressionsVerificationTest.$(H): PPTokenizedExpressionsVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/compiler/tests/extras/PPCExpressionsVerificationTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedSmalltalkVerificationTest.$(O) PPTokenizedSmalltalkVerificationTest.$(H): PPTokenizedSmalltalkVerificationTest.st $(INCLUDE_TOP)/stx/goodies/petitparser/compiler/tests/extras/PPCSmalltalkVerificationTest.$(H) $(INCLUDE_TOP)/stx/goodies/petitparser/tests/PPAbstractParserTest.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) +$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR) # ENDMAKEDEPEND --- do not remove this line diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/Make.spec --- a/compiler/tests/extras/Make.spec Fri Jul 31 08:22:18 2015 +0100 +++ b/compiler/tests/extras/Make.spec Thu Jul 30 08:37:37 2015 +0100 @@ -51,61 +51,12 @@ STCWARNINGS=-warnNonStandard COMMON_CLASSES= \ - PPCCompiledJavaVerificationTest \ - PPCExpressionsVerificationTest \ - PPCResources \ - PPCSmalltalkTests \ - PPCSmalltalkVerificationTest \ - PPCompiledExpressionGrammarResource \ - PPCompiledExpressionGrammarTest \ - PPCompiledJavaResource \ - PPCompiledSmalltalkGrammarResource \ - PPCompiledSmalltalkGrammarTests \ - PPExpressionGrammar \ - PPExpressionGrammarTest \ - PPLL1ExpressionGrammar \ - PPLL1ExpressionGrammarTest \ - PPTokenizedExpressionGrammarResource \ - PPTokenizedExpressionGrammarTest \ - PPTokenizedLL1ExpressionGrammarResource \ - PPTokenizedLL1ExpressionGrammarTest \ - PPTokenizedSmalltalkGrammarResource \ - PPTokenizedSmalltalkGrammarTests \ - stx_goodies_petitparser_compiler_tests_extras \ - PPCompiledExpressionsVerificationTest \ - PPCompiledSmalltalkVerificationTest \ - PPTokenizedExpressionsVerificationTest \ - PPTokenizedSmalltalkVerificationTest \ COMMON_OBJS= \ - $(OUTDIR_SLASH)PPCCompiledJavaVerificationTest.$(O) \ - $(OUTDIR_SLASH)PPCExpressionsVerificationTest.$(O) \ - $(OUTDIR_SLASH)PPCResources.$(O) \ - $(OUTDIR_SLASH)PPCSmalltalkTests.$(O) \ - $(OUTDIR_SLASH)PPCSmalltalkVerificationTest.$(O) \ - $(OUTDIR_SLASH)PPCompiledExpressionGrammarResource.$(O) \ - $(OUTDIR_SLASH)PPCompiledExpressionGrammarTest.$(O) \ - $(OUTDIR_SLASH)PPCompiledJavaResource.$(O) \ - $(OUTDIR_SLASH)PPCompiledSmalltalkGrammarResource.$(O) \ - $(OUTDIR_SLASH)PPCompiledSmalltalkGrammarTests.$(O) \ - $(OUTDIR_SLASH)PPExpressionGrammar.$(O) \ - $(OUTDIR_SLASH)PPExpressionGrammarTest.$(O) \ - $(OUTDIR_SLASH)PPLL1ExpressionGrammar.$(O) \ - $(OUTDIR_SLASH)PPLL1ExpressionGrammarTest.$(O) \ - $(OUTDIR_SLASH)PPTokenizedExpressionGrammarResource.$(O) \ - $(OUTDIR_SLASH)PPTokenizedExpressionGrammarTest.$(O) \ - $(OUTDIR_SLASH)PPTokenizedLL1ExpressionGrammarResource.$(O) \ - $(OUTDIR_SLASH)PPTokenizedLL1ExpressionGrammarTest.$(O) \ - $(OUTDIR_SLASH)PPTokenizedSmalltalkGrammarResource.$(O) \ - $(OUTDIR_SLASH)PPTokenizedSmalltalkGrammarTests.$(O) \ - $(OUTDIR_SLASH)stx_goodies_petitparser_compiler_tests_extras.$(O) \ - $(OUTDIR_SLASH)PPCompiledExpressionsVerificationTest.$(O) \ - $(OUTDIR_SLASH)PPCompiledSmalltalkVerificationTest.$(O) \ - $(OUTDIR_SLASH)PPTokenizedExpressionsVerificationTest.$(O) \ - $(OUTDIR_SLASH)PPTokenizedSmalltalkVerificationTest.$(O) \ + $(OUTDIR_SLASH)extensions.$(O) \ diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCAbstractParserTest.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCAbstractParserTest.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,113 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPAbstractParserTest subclass:#PPCAbstractParserTest + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Support' +! + +!PPCAbstractParserTest class methodsFor:'resources'! + +resources + ^ Array with: (PPCSetUpBeforeTearDownAfterResource for: self) +! ! + +!PPCAbstractParserTest class methodsFor:'testing'! + +isAbstract + ^ self == PPCAbstractParserTest + + "Modified: / 30-07-2015 / 07:28:13 / Jan Vrany " +! ! + +!PPCAbstractParserTest methodsFor:'accessing'! + +compiledParser + ^ self compiledParserClass new + + "Created: / 29-07-2015 / 17:00:04 / Jan Vrany " +! + +compiledParserClass + ^ Smalltalk at: self compiledParserClassName + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compiledParserClassName + "Return the name of the compiled parser" + + ^ (self petitParserClass name , 'C_' , + "This is bit hacky!!" + ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ self subclassResponsibility + + "Created: / 29-07-2015 / 16:53:22 / Jan Vrany " +! + +parserClass + ^ self compiledParserClass + + "Modified: / 29-07-2015 / 18:43:08 / Jan Vrany " +! + +parserInstanceFor: aSymbol + ^ self parserClass new startSymbol: aSymbol + + "Modified: / 29-07-2015 / 18:43:43 / Jan Vrany " +! + +petitParser + ^ self petitParserClass new + + "Created: / 29-07-2015 / 17:01:41 / Jan Vrany " +! + +petitParserClass + "Return the name of the petit parser to compile" + + ^ self subclassResponsibility + + "Created: / 29-07-2015 / 17:01:17 / Jan Vrany " +! ! + +!PPCAbstractParserTest methodsFor:'context'! + +context + + ^ PPCContext new +! ! + +!PPCAbstractParserTest methodsFor:'setup & teardown'! + +setUpBefore + "Called before any of my tests is run (when resources are set up)" + | time configuration | + + configuration := self compilerConfiguration. + configuration arguments parserName: self compiledParserClassName. + time := Time millisecondsToRun: [ + self petitParser compileWithConfiguration: configuration. + ]. + Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr. + + "Created: / 29-07-2015 / 16:29:38 / Jan Vrany " + "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany " +! + +tearDownAfter + "Called after all my tests are ryn(when resources are torn down)" + + "Created: / 29-07-2015 / 16:33:46 / Jan Vrany " +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCCompositeParserTest.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCCompositeParserTest.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,178 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCompositeParserTest subclass:#PPCCompositeParserTest + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Support' +! + +!PPCCompositeParserTest class methodsFor:'accessing'! + +resources + ^ Array with: (PPCSetUpBeforeTearDownAfterResource for: self) + + "Created: / 29-07-2015 / 16:28:36 / Jan Vrany " +! ! + +!PPCCompositeParserTest class methodsFor:'queries'! + +isAbstract + "Return if this class is an abstract class. + True is returned here for myself only; false for subclasses. + Abstract subclasses must redefine again." + + ^ self == PPCCompositeParserTest. +! ! + +!PPCCompositeParserTest class methodsFor:'utilities'! + +generateTestsFor: baseTestClass + | compiledBaseTestClassName compiledBaseTestClass compiledUniversalTestClass compiledTokenizedTestClass | + + compiledBaseTestClassName := (baseTestClass name startsWith: 'PP') + ifTrue:[ 'PPC' , (baseTestClass name copyFrom: 3 to: baseTestClass name size) ] + ifFalse:[ 'PPC' , baseTestClass name ]. + compiledBaseTestClassName := compiledBaseTestClassName asSymbol. + + compiledBaseTestClass := baseTestClass subclass:compiledBaseTestClassName + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category: 'PetitCompiler-Extras-Tests-Misc'. + + compiledBaseTestClass class compile: +'isAbstract + ^ self == ', compiledBaseTestClassName + classified: 'testing'. + + compiledBaseTestClass class compile: +'resources + ^ Array with: (PPCSetUpBeforeTearDownAfterResource for: self)' + classified: 'resources'. + + self methodDictionary do:[:method | + compiledBaseTestClass compile: method source classified: method category + ]. + + compiledBaseTestClass compile: +'petitParserClass + ^ ' , baseTestClass new parserClass name + classified: 'accessing'. + + compiledUniversalTestClass := compiledBaseTestClass subclass: (compiledBaseTestClassName , '_Universal') asSymbol + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category: 'PetitCompiler-Extras-Tests-Misc'. + + compiledUniversalTestClass compile: +'compilerConfiguration + ^ PPCConfiguration universal' + classified: 'accessing'. + + + compiledTokenizedTestClass := compiledBaseTestClass subclass: (compiledBaseTestClassName , '_Tokenized') asSymbol + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category: 'PetitCompiler-Extras-Tests-Misc'. + + compiledTokenizedTestClass compile: +'compilerConfiguration + ^ PPCConfiguration tokenizing' + classified: 'accessing'. + + "Created: / 30-07-2015 / 07:10:19 / Jan Vrany " +! ! + +!PPCCompositeParserTest methodsFor:'accessing'! + +compiledParser + ^ self compiledParserClass new + + "Created: / 29-07-2015 / 17:00:04 / Jan Vrany " +! + +compiledParserClass + ^ Smalltalk at: self compiledParserClassName + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compiledParserClassName + "Return the name of the compiled parser" + + ^ (self petitParserClass name , 'C_' , + "This is bit hacky!!" + ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ self subclassResponsibility + + "Created: / 29-07-2015 / 16:53:22 / Jan Vrany " +! + +parserClass + ^ self compiledParserClass + + "Modified: / 29-07-2015 / 18:43:08 / Jan Vrany " +! + +parserInstanceFor: aSymbol + ^ self parserClass new startSymbol: aSymbol + + "Modified: / 29-07-2015 / 18:43:43 / Jan Vrany " +! + +petitParser + ^ self petitParserClass new + + "Created: / 29-07-2015 / 17:01:41 / Jan Vrany " +! + +petitParserClass + "Return the name of the petit parser to compile" + + ^ self subclassResponsibility + + "Created: / 29-07-2015 / 17:01:17 / Jan Vrany " +! ! + +!PPCCompositeParserTest methodsFor:'context'! + +context + + ^ PPCContext new +! ! + +!PPCCompositeParserTest methodsFor:'setup & teardown'! + +setUpBefore + "Called before any of my tests is run (when resources are set up)" + | time configuration | + + configuration := self compilerConfiguration. + configuration arguments parserName: self compiledParserClassName. + time := Time millisecondsToRun: [ + self petitParser compileWithConfiguration: configuration. + ]. + Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr. + + "Created: / 29-07-2015 / 16:29:38 / Jan Vrany " + "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany " +! + +tearDownAfter + "Called after all my tests are ryn(when resources are torn down)" + + "Created: / 29-07-2015 / 16:33:46 / Jan Vrany " +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCExpressionGrammarTest.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCExpressionGrammarTest.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,107 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPExpressionGrammarTest subclass:#PPCExpressionGrammarTest + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Expressions' +! + +!PPCExpressionGrammarTest class methodsFor:'resources'! + +resources + ^ Array with: (PPCSetUpBeforeTearDownAfterResource for: self) +! ! + +!PPCExpressionGrammarTest class methodsFor:'testing'! + +isAbstract + ^ self == PPCExpressionGrammarTest +! ! + +!PPCExpressionGrammarTest methodsFor:'accessing'! + +compiledParser + ^ self compiledParserClass new + + "Created: / 29-07-2015 / 17:00:04 / Jan Vrany " +! + +compiledParserClass + ^ Smalltalk at: self compiledParserClassName + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compiledParserClassName + "Return the name of the compiled parser" + + ^ (self petitParserClass name , 'C_' , + "This is bit hacky!!" + ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ self subclassResponsibility + + "Created: / 29-07-2015 / 16:53:22 / Jan Vrany " +! + +parserClass + ^ self compiledParserClass + + "Modified: / 29-07-2015 / 18:43:08 / Jan Vrany " +! + +parserInstanceFor: aSymbol + ^ self parserClass new startSymbol: aSymbol + + "Modified: / 29-07-2015 / 18:43:43 / Jan Vrany " +! + +petitParser + ^ self petitParserClass new + + "Created: / 29-07-2015 / 17:01:41 / Jan Vrany " +! + +petitParserClass + ^ PPExpressionGrammar +! ! + +!PPCExpressionGrammarTest methodsFor:'context'! + +context + + ^ PPCContext new +! ! + +!PPCExpressionGrammarTest methodsFor:'setup & teardown'! + +setUpBefore + "Called before any of my tests is run (when resources are set up)" + | time configuration | + + configuration := self compilerConfiguration. + configuration arguments parserName: self compiledParserClassName. + time := Time millisecondsToRun: [ + self petitParser compileWithConfiguration: configuration. + ]. + Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr. + + "Created: / 29-07-2015 / 16:29:38 / Jan Vrany " + "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany " +! + +tearDownAfter + "Called after all my tests are ryn(when resources are torn down)" + + "Created: / 29-07-2015 / 16:33:46 / Jan Vrany " +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCExpressionGrammarTest_Tokenized.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCExpressionGrammarTest_Tokenized.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,17 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCExpressionGrammarTest subclass:#PPCExpressionGrammarTest_Tokenized + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Expressions' +! + +!PPCExpressionGrammarTest_Tokenized methodsFor:'accessing'! + +compilerConfiguration + ^ PPCConfiguration tokenizing +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCExpressionGrammarTest_Universal.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCExpressionGrammarTest_Universal.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,17 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCExpressionGrammarTest subclass:#PPCExpressionGrammarTest_Universal + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Expressions' +! + +!PPCExpressionGrammarTest_Universal methodsFor:'accessing'! + +compilerConfiguration + ^ PPCConfiguration universal +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCExpressionGrammarVerificationTest.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCExpressionGrammarVerificationTest.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,111 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCAbstractParserTest subclass:#PPCExpressionGrammarVerificationTest + instanceVariableNames:'parser result context resource fileResources' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Expressions' +! + + +!PPCExpressionGrammarVerificationTest class methodsFor:'accessing'! + +resources + ^ (OrderedCollection with: PPCResources) + addAll: super resources; + yourself +! ! + +!PPCExpressionGrammarVerificationTest class methodsFor:'testing'! + +isAbstract + ^ self == PPCExpressionGrammarVerificationTest + + "Modified: / 29-07-2015 / 18:50:30 / Jan Vrany " +! ! + +!PPCExpressionGrammarVerificationTest methodsFor:'accessing'! + +petitParserClass + "Return the name of the petit parser to compile" + + ^ PPExpressionGrammar + + "Modified: / 29-07-2015 / 17:08:08 / Jan Vrany " +! ! + +!PPCExpressionGrammarVerificationTest methodsFor:'setup'! + +setUp + super setUp. + fileResources := (self resources detect: [:e | e = PPCResources ]) current. +! + +tearDown + super tearDown. + " + self compiledSmalltalkGrammarClass isNil ifFalse:[ + self compiledSmalltalkGrammarClass removeFromSystem + ]. + " +! ! + +!PPCExpressionGrammarVerificationTest methodsFor:'tests'! + +testExpressions + | compiledParser petitParser expected actual | + petitParser := self petitParser. + compiledParser := self compiledParser. + + fileResources expressionSourcesMedium do: [ :source | + expected := petitParser parse: source. + expected isPetitFailure ifFalse: [ + actual := (compiledParser parse: source withContext: self context). + self assert: expected equals: actual. + ] + ]. + + "Modified: / 29-07-2015 / 17:03:07 / Jan Vrany " +! + +testSanity + | compiledParser petitParser source | + petitParser := self petitParser. + compiledParser := self compiledParser. + + source := fileResources expressionOfSize: 100. + result := petitParser parse: source. + + self assert: (((self deepFlattened: result) select: [ :e | e isNumber ]) size) = 100. + self assert: (((self deepFlattened: result)select: [ :e | e isNumber ]) size) = 100. + + "Modified: / 29-07-2015 / 17:03:17 / Jan Vrany " +! ! + +!PPCExpressionGrammarVerificationTest methodsFor:'utilities'! + +deepFlatten: anObject into: aCollection + (anObject isCollection and:[anObject isString not]) ifTrue:[ + anObject do:[:each|self deepFlatten: each into: aCollection] + ] ifFalse:[ + aCollection add: anObject + ]. + ^aCollection +! + +deepFlattened: aCollection + ^self deepFlatten: aCollection into: OrderedCollection new. +! ! + +!PPCExpressionGrammarVerificationTest class methodsFor:'documentation'! + +version + ^ 'Path: stx/goodies/petitparser/compiler/tests/extras/PPCExpressionsVerificationTest.st, Version: 1.0, User: jv, Time: 2015-07-29T18:56:55.770+01' +! + +version_HG + ^ 'Path: stx/goodies/petitparser/compiler/tests/extras/PPCExpressionsVerificationTest.st, Version: 1.0, User: jv, Time: 2015-07-29T18:56:55.770+01' +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCExpressionsVerificationTest.st --- a/compiler/tests/extras/PPCExpressionsVerificationTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPAbstractParserTest subclass:#PPCExpressionsVerificationTest - instanceVariableNames:'parser result context resource fileResources' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Expressions' -! - -!PPCExpressionsVerificationTest class methodsFor:'as yet unclassified'! - -isAbstract - ^ self name = #PPCExpressionsVerificationTest -! - -resources - ^ (OrderedCollection with: PPCResources) - addAll: super resources; - yourself -! ! - -!PPCExpressionsVerificationTest methodsFor:'accessing'! - -compiledGrammar - ^ self compiledGrammarClass new -! - -compiledGrammarClass - self subclassResponsibility -! - -grammar - ^ PPExpressionGrammar new -! ! - -!PPCExpressionsVerificationTest methodsFor:'setup'! - -setUp - super setUp. - fileResources := (self resources detect: [:e | e = PPCResources ]) current. -! - -tearDown - super tearDown. - " - self compiledSmalltalkGrammarClass isNil ifFalse:[ - self compiledSmalltalkGrammarClass removeFromSystem - ]. - " -! ! - -!PPCExpressionsVerificationTest methodsFor:'tests'! - -testExpressions - | compiledParser normalParser expected actual | - normalParser := self grammar. - compiledParser := self compiledGrammar. - - fileResources expressionSourcesMedium do: [ :source | - expected := normalParser parse: source. - expected isPetitFailure ifFalse: [ - actual := (compiledParser parse: source withContext: self context). - self assert: expected equals: actual. - ] - ]. -! - -testSanity - | compiledParser normalParser source | - normalParser := self grammar. - compiledParser := self compiledGrammar. - - source := fileResources expressionOfSize: 100. - result := normalParser parse: source. - - self assert: (((self deepFlattened: result) select: [ :e | e isNumber ]) size) = 100. - self assert: (((self deepFlattened: result)select: [ :e | e isNumber ]) size) = 100. -! ! - -!PPCExpressionsVerificationTest methodsFor:'utilities'! - -deepFlatten: anObject into: aCollection - (anObject isCollection and:[anObject isString not]) ifTrue:[ - anObject do:[:each|self deepFlatten: each into: aCollection] - ] ifFalse:[ - aCollection add: anObject - ]. - ^aCollection -! - -deepFlattened: aCollection - ^self deepFlatten: aCollection into: OrderedCollection new. -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCLL1ExpressionGrammarTest.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCLL1ExpressionGrammarTest.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,107 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPLL1ExpressionGrammarTest subclass:#PPCLL1ExpressionGrammarTest + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Expressions' +! + +!PPCLL1ExpressionGrammarTest class methodsFor:'resources'! + +resources + ^ Array with: (PPCSetUpBeforeTearDownAfterResource for: self) +! ! + +!PPCLL1ExpressionGrammarTest class methodsFor:'testing'! + +isAbstract + ^ self == PPCLL1ExpressionGrammarTest +! ! + +!PPCLL1ExpressionGrammarTest methodsFor:'accessing'! + +compiledParser + ^ self compiledParserClass new + + "Created: / 29-07-2015 / 17:00:04 / Jan Vrany " +! + +compiledParserClass + ^ Smalltalk at: self compiledParserClassName + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compiledParserClassName + "Return the name of the compiled parser" + + ^ (self petitParserClass name , 'C_' , + "This is bit hacky!!" + ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ self subclassResponsibility + + "Created: / 29-07-2015 / 16:53:22 / Jan Vrany " +! + +parserClass + ^ self compiledParserClass + + "Modified: / 29-07-2015 / 18:43:08 / Jan Vrany " +! + +parserInstanceFor: aSymbol + ^ self parserClass new startSymbol: aSymbol + + "Modified: / 29-07-2015 / 18:43:43 / Jan Vrany " +! + +petitParser + ^ self petitParserClass new + + "Created: / 29-07-2015 / 17:01:41 / Jan Vrany " +! + +petitParserClass + ^ PPLL1ExpressionGrammar +! ! + +!PPCLL1ExpressionGrammarTest methodsFor:'context'! + +context + + ^ PPCContext new +! ! + +!PPCLL1ExpressionGrammarTest methodsFor:'setup & teardown'! + +setUpBefore + "Called before any of my tests is run (when resources are set up)" + | time configuration | + + configuration := self compilerConfiguration. + configuration arguments parserName: self compiledParserClassName. + time := Time millisecondsToRun: [ + self petitParser compileWithConfiguration: configuration. + ]. + Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr. + + "Created: / 29-07-2015 / 16:29:38 / Jan Vrany " + "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany " +! + +tearDownAfter + "Called after all my tests are ryn(when resources are torn down)" + + "Created: / 29-07-2015 / 16:33:46 / Jan Vrany " +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCLL1ExpressionGrammarTest_Tokenized.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCLL1ExpressionGrammarTest_Tokenized.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,17 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCLL1ExpressionGrammarTest subclass:#PPCLL1ExpressionGrammarTest_Tokenized + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Expressions' +! + +!PPCLL1ExpressionGrammarTest_Tokenized methodsFor:'accessing'! + +compilerConfiguration + ^ PPCConfiguration tokenizing +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCLL1ExpressionGrammarTest_Universal.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCLL1ExpressionGrammarTest_Universal.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,17 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCLL1ExpressionGrammarTest subclass:#PPCLL1ExpressionGrammarTest_Universal + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Expressions' +! + +!PPCLL1ExpressionGrammarTest_Universal methodsFor:'accessing'! + +compilerConfiguration + ^ PPCConfiguration universal +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSetUpBeforeTearDownAfterResource.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSetUpBeforeTearDownAfterResource.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,115 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +TestResource subclass:#PPCSetUpBeforeTearDownAfterResource + instanceVariableNames:'' + classVariableNames:'CachedResources' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Support' +! + +PPCSetUpBeforeTearDownAfterResource class instanceVariableNames:'testCaseClass' + +" + The following class instance variables are inherited by this class: + + TestResource - current + TestAsserter - + Object - +" +! + +!PPCSetUpBeforeTearDownAfterResource class methodsFor:'initialization'! + +initialize + "Invoked at system start or when the class is dynamically loaded." + + "/ please change as required (and remove this comment) + "/ testCaseClass := nil. + + CachedResources := Dictionary new + + "Modified: / 30-07-2015 / 07:47:41 / Jan Vrany " +! ! + +!PPCSetUpBeforeTearDownAfterResource class methodsFor:'accessing'! + +testCaseClass + ^ testCaseClass + + "Created: / 29-07-2015 / 16:19:23 / Jan Vrany " +! + +testCaseClass: aClass + testCaseClass := aClass + + "Created: / 29-07-2015 / 16:19:36 / Jan Vrany " +! ! + +!PPCSetUpBeforeTearDownAfterResource class methodsFor:'queries'! + +isAbstract + "Return if this class is an abstract class. + True is returned here for myself only; false for subclasses. + Abstract subclasses must redefine again." + + ^ self == PPCSetUpBeforeTearDownAfterResource. +! ! + +!PPCSetUpBeforeTearDownAfterResource class methodsFor:'running'! + +availableFor: aTestAsserter + aTestAsserter + assert: self isAvailable + description: 'Unavailable resource ', PPCSetUpBeforeTearDownAfterResource name ,' for: ', testCaseClass name , ' requested by ', aTestAsserter printString. + + "Created: / 29-07-2015 / 16:42:37 / Jan Vrany " +! ! + +!PPCSetUpBeforeTearDownAfterResource class methodsFor:'subclass creation'! + +for: aClass + ^ CachedResources at: aClass ifAbsentPut:[ + | resourceMeta resourceClass | + + resourceMeta := Metaclass new. + resourceMeta setSuperclass: self class. + resourceMeta instSize: self class instSize. + resourceClass := resourceMeta new. + resourceClass setSuperclass: self. + resourceClass instSize: self instSize. + resourceClass testCaseClass: aClass. + resourceClass + ] + + "Created: / 29-07-2015 / 16:17:34 / Jan Vrany " + "Modified (format): / 30-07-2015 / 07:48:30 / Jan Vrany " +! ! + +!PPCSetUpBeforeTearDownAfterResource methodsFor:'setup & teardown'! + +setUp + | testCaseClass | + + testCaseClass := self class testCaseClass. + (testCaseClass lookupSelector: #setUpBefore) notNil ifTrue:[ + testCaseClass new setUpBefore. + ]. + + "Created: / 29-07-2015 / 16:33:19 / Jan Vrany " +! + +tearDown + | testCaseClass | + + testCaseClass := self class testCaseClass. + (testCaseClass lookupSelector: #tearDownAfter) notNil ifTrue:[ + testCaseClass new tearDownAfter + ]. + + "Created: / 29-07-2015 / 16:33:34 / Jan Vrany " +! ! + + +PPCSetUpBeforeTearDownAfterResource initialize! diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkGrammarTests.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkGrammarTests.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,118 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPSmalltalkGrammarTests subclass:#PPCSmalltalkGrammarTests + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + + +!PPCSmalltalkGrammarTests class methodsFor:'resources'! + +resources + ^ Array with: (PPCSetUpBeforeTearDownAfterResource for: self) +! ! + +!PPCSmalltalkGrammarTests class methodsFor:'testing'! + +isAbstract + ^ self == PPCSmalltalkGrammarTests +! ! + +!PPCSmalltalkGrammarTests methodsFor:'accessing'! + +compiledParser + ^ self compiledParserClass new + + "Created: / 29-07-2015 / 17:00:04 / Jan Vrany " +! + +compiledParserClass + ^ Smalltalk at: self compiledParserClassName + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compiledParserClassName + "Return the name of the compiled parser" + + ^ (self petitParserClass name , 'C_' , + "This is bit hacky!!" + ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ self subclassResponsibility + + "Created: / 29-07-2015 / 16:53:22 / Jan Vrany " +! + +parserClass + ^ self compiledParserClass + + "Modified: / 29-07-2015 / 18:43:08 / Jan Vrany " +! + +parserInstanceFor: aSymbol + ^ self parserClass new startSymbol: aSymbol + + "Modified: / 29-07-2015 / 18:43:43 / Jan Vrany " +! + +petitParser + ^ self petitParserClass new + + "Created: / 29-07-2015 / 17:01:41 / Jan Vrany " +! + +petitParserClass + ^ PPSmalltalkGrammar +! ! + +!PPCSmalltalkGrammarTests methodsFor:'context'! + +context + + ^ PPCContext new +! ! + +!PPCSmalltalkGrammarTests methodsFor:'setup & teardown'! + +setUpBefore + "Called before any of my tests is run (when resources are set up)" + | time configuration | + + configuration := self compilerConfiguration. + configuration arguments parserName: self compiledParserClassName. + time := Time millisecondsToRun: [ + self petitParser compileWithConfiguration: configuration. + ]. + Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr. + + "Created: / 29-07-2015 / 16:29:38 / Jan Vrany " + "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany " +! + +tearDownAfter + "Called after all my tests are ryn(when resources are torn down)" + + "Created: / 29-07-2015 / 16:33:46 / Jan Vrany " +! ! + +!PPCSmalltalkGrammarTests class methodsFor:'documentation'! + +version + ^ 'Path: stx/goodies/petitparser/compiler/tests/extras/PPCSmalltalkGrammarTests.st, Version: 1.0, User: jv, Time: 2015-07-30T07:31:30.012+01' +! + +version_HG + ^ 'Path: stx/goodies/petitparser/compiler/tests/extras/PPCSmalltalkGrammarTests.st, Version: 1.0, User: jv, Time: 2015-07-30T07:31:30.012+01' +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkGrammarTests_Tokenized.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkGrammarTests_Tokenized.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,17 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCSmalltalkGrammarTests subclass:#PPCSmalltalkGrammarTests_Tokenized + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + +!PPCSmalltalkGrammarTests_Tokenized methodsFor:'accessing'! + +compilerConfiguration + ^ PPCConfiguration tokenizing +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkGrammarTests_Universal.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkGrammarTests_Universal.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,17 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCSmalltalkGrammarTests subclass:#PPCSmalltalkGrammarTests_Universal + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + +!PPCSmalltalkGrammarTests_Universal methodsFor:'accessing'! + +compilerConfiguration + ^ PPCConfiguration universal +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkGrammarVerificationTest.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkGrammarVerificationTest.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,104 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCAbstractParserTest subclass:#PPCSmalltalkGrammarVerificationTest + instanceVariableNames:'parser result context resource fileResources' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + + +!PPCSmalltalkGrammarVerificationTest class methodsFor:'as yet unclassified'! + +resources + ^ (OrderedCollection with: PPCResources) + addAll: super resources; + yourself +! ! + +!PPCSmalltalkGrammarVerificationTest class methodsFor:'queries'! + +isAbstract + "Return if this class is an abstract class. + True is returned here for myself only; false for subclasses. + Abstract subclasses must redefine again." + + ^ self == PPCSmalltalkGrammarVerificationTest. +! ! + +!PPCSmalltalkGrammarVerificationTest methodsFor:'accessing'! + +petitParserClass + "Return the name of the petit parser to compile" + + ^ PPSmalltalkGrammar + + "Created: / 29-07-2015 / 19:52:19 / Jan Vrany " +! ! + +!PPCSmalltalkGrammarVerificationTest methodsFor:'setup'! + +setUp + super setUp. + fileResources := (self resources detect: [:e | e = PPCResources ]) current. +! + +tearDown + super tearDown. + " + self compiledSmalltalkGrammarClass isNil ifFalse:[ + self compiledSmalltalkGrammarClass removeFromSystem + ]. + " +! ! + +!PPCSmalltalkGrammarVerificationTest methodsFor:'tests'! + +testSmalltalk + | compiledParser normalParser expected actual | + normalParser := self petitParser. + compiledParser := self compiledParser. + + fileResources smalltalkSourcesBig do: [ :source | + expected := normalParser parse: source. + expected isPetitFailure ifFalse: [ + actual := (compiledParser parse: source withContext: self context). + self assert: expected equals: actual. + ] + ]. +! + +testSmalltalkClass + | compiledParser normalParser | + normalParser := self petitParser. + compiledParser := self compiledParser. + + fileResources smalltalkClassMethods do: [ :source | + self assert: (normalParser parse: source) + equals: (compiledParser parse: source withContext: self context). + ]. +! + +testSmalltalkObject + | compiledParser normalParser | + normalParser := self petitParser. + compiledParser := self compiledParser. + + fileResources smalltalkObjectMethods do: [ :source | + self assert: (normalParser parse: source) + equals: (compiledParser parse: source withContext: self context). + ]. +! ! + +!PPCSmalltalkGrammarVerificationTest class methodsFor:'documentation'! + +version + ^ 'Path: stx/goodies/petitparser/compiler/tests/extras/PPCSmalltalkVerificationTest.st, Version: 1.0, User: jv, Time: 2015-07-30T08:07:11.283+01' +! + +version_HG + ^ 'Path: stx/goodies/petitparser/compiler/tests/extras/PPCSmalltalkVerificationTest.st, Version: 1.0, User: jv, Time: 2015-07-30T08:07:11.283+01' +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkGrammarVerificationTest_Tokenized.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkGrammarVerificationTest_Tokenized.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,29 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCSmalltalkGrammarVerificationTest subclass:#PPCSmalltalkGrammarVerificationTest_Tokenized + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + + +!PPCSmalltalkGrammarVerificationTest_Tokenized methodsFor:'accessing'! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ PPCConfiguration tokenizing + + "Created: / 29-07-2015 / 19:54:16 / Jan Vrany " +! ! + +!PPCSmalltalkGrammarVerificationTest_Tokenized class methodsFor:'documentation'! + +version_HG + + ^ '$Changeset: $' +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkGrammarVerificationTest_Universal.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkGrammarVerificationTest_Universal.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,21 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCSmalltalkGrammarVerificationTest subclass:#PPCSmalltalkGrammarVerificationTest_Universal + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + +!PPCSmalltalkGrammarVerificationTest_Universal methodsFor:'accessing'! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ PPCConfiguration universal + + "Created: / 29-07-2015 / 19:54:27 / Jan Vrany " +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkParserTests.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkParserTests.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,107 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPSmalltalkParserTests subclass:#PPCSmalltalkParserTests + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + +!PPCSmalltalkParserTests class methodsFor:'resources'! + +resources + ^ Array with: (PPCSetUpBeforeTearDownAfterResource for: self) +! ! + +!PPCSmalltalkParserTests class methodsFor:'testing'! + +isAbstract + ^ self == PPCSmalltalkParserTests +! ! + +!PPCSmalltalkParserTests methodsFor:'accessing'! + +compiledParser + ^ self compiledParserClass new + + "Created: / 29-07-2015 / 17:00:04 / Jan Vrany " +! + +compiledParserClass + ^ Smalltalk at: self compiledParserClassName + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compiledParserClassName + "Return the name of the compiled parser" + + ^ (self petitParserClass name , 'C_' , + "This is bit hacky!!" + ((self compilerConfiguration isKindOf: PPCTokenizingConfiguration) ifTrue:[ 'Tokenizing' ] ifFalse:[ 'Universal' ])) asSymbol + + "Created: / 29-07-2015 / 16:54:01 / Jan Vrany " +! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ self subclassResponsibility + + "Created: / 29-07-2015 / 16:53:22 / Jan Vrany " +! + +parserClass + ^ self compiledParserClass + + "Modified: / 29-07-2015 / 18:43:08 / Jan Vrany " +! + +parserInstanceFor: aSymbol + ^ self parserClass new startSymbol: aSymbol + + "Modified: / 29-07-2015 / 18:43:43 / Jan Vrany " +! + +petitParser + ^ self petitParserClass new + + "Created: / 29-07-2015 / 17:01:41 / Jan Vrany " +! + +petitParserClass + ^ PPSmalltalkParser +! ! + +!PPCSmalltalkParserTests methodsFor:'context'! + +context + + ^ PPCContext new +! ! + +!PPCSmalltalkParserTests methodsFor:'setup & teardown'! + +setUpBefore + "Called before any of my tests is run (when resources are set up)" + | time configuration | + + configuration := self compilerConfiguration. + configuration arguments parserName: self compiledParserClassName. + time := Time millisecondsToRun: [ + self petitParser compileWithConfiguration: configuration. + ]. + Transcript show: self petitParserClass name ; show:' compiled in: '; show: time asString; show: 'ms'; cr. + + "Created: / 29-07-2015 / 16:29:38 / Jan Vrany " + "Modified: / 29-07-2015 / 18:40:47 / Jan Vrany " +! + +tearDownAfter + "Called after all my tests are ryn(when resources are torn down)" + + "Created: / 29-07-2015 / 16:33:46 / Jan Vrany " +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkParserTests_Tokenized.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkParserTests_Tokenized.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,17 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCSmalltalkParserTests subclass:#PPCSmalltalkParserTests_Tokenized + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + +!PPCSmalltalkParserTests_Tokenized methodsFor:'accessing'! + +compilerConfiguration + ^ PPCConfiguration tokenizing +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkParserTests_Universal.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkParserTests_Universal.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,17 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCSmalltalkParserTests subclass:#PPCSmalltalkParserTests_Universal + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + +!PPCSmalltalkParserTests_Universal methodsFor:'accessing'! + +compilerConfiguration + ^ PPCConfiguration universal +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkParserVerificationTest.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkParserVerificationTest.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,93 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCAbstractParserTest subclass:#PPCSmalltalkParserVerificationTest + instanceVariableNames:'parser result context resource fileResources' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + +!PPCSmalltalkParserVerificationTest class methodsFor:'as yet unclassified'! + +resources + ^ (OrderedCollection with: PPCResources) + addAll: super resources; + yourself +! ! + +!PPCSmalltalkParserVerificationTest class methodsFor:'queries'! + +isAbstract + "Return if this class is an abstract class. + True is returned here for myself only; false for subclasses. + Abstract subclasses must redefine again." + + ^ self == PPCSmalltalkParserVerificationTest. +! ! + +!PPCSmalltalkParserVerificationTest methodsFor:'accessing'! + +petitParserClass + "Return the name of the petit parser to compile" + + ^ PPSmalltalkGrammar + + "Created: / 29-07-2015 / 19:52:19 / Jan Vrany " +! ! + +!PPCSmalltalkParserVerificationTest methodsFor:'setup'! + +setUp + super setUp. + fileResources := (self resources detect: [:e | e = PPCResources ]) current. +! + +tearDown + super tearDown. + " + self compiledSmalltalkGrammarClass isNil ifFalse:[ + self compiledSmalltalkGrammarClass removeFromSystem + ]. + " +! ! + +!PPCSmalltalkParserVerificationTest methodsFor:'tests'! + +testSmalltalk + | compiledParser normalParser expected actual | + normalParser := self petitParser. + compiledParser := self compiledParser. + + fileResources smalltalkSourcesBig do: [ :source | + expected := normalParser parse: source. + expected isPetitFailure ifFalse: [ + actual := (compiledParser parse: source withContext: self context). + self assert: expected equals: actual. + ] + ]. +! + +testSmalltalkClass + | compiledParser normalParser | + normalParser := self petitParser. + compiledParser := self compiledParser. + + fileResources smalltalkClassMethods do: [ :source | + self assert: (normalParser parse: source) + equals: (compiledParser parse: source withContext: self context). + ]. +! + +testSmalltalkObject + | compiledParser normalParser | + normalParser := self petitParser. + compiledParser := self compiledParser. + + fileResources smalltalkObjectMethods do: [ :source | + self assert: (normalParser parse: source) + equals: (compiledParser parse: source withContext: self context). + ]. +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkParserVerificationTest_Tokenized.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkParserVerificationTest_Tokenized.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,21 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCSmalltalkParserVerificationTest subclass:#PPCSmalltalkParserVerificationTest_Tokenized + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + +!PPCSmalltalkParserVerificationTest_Tokenized methodsFor:'accessing'! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ PPCConfiguration tokenizing + + "Created: / 29-07-2015 / 19:54:16 / Jan Vrany " +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkParserVerificationTest_Universal.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPCSmalltalkParserVerificationTest_Universal.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,21 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCSmalltalkParserVerificationTest subclass:#PPCSmalltalkParserVerificationTest_Universal + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Smalltalk' +! + +!PPCSmalltalkParserVerificationTest_Universal methodsFor:'accessing'! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ PPCConfiguration universal + + "Created: / 29-07-2015 / 19:54:27 / Jan Vrany " +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkTests.st --- a/compiler/tests/extras/PPCSmalltalkTests.st Fri Jul 31 08:22:18 2015 +0100 +++ b/compiler/tests/extras/PPCSmalltalkTests.st Thu Jul 30 08:37:37 2015 +0100 @@ -37,8 +37,10 @@ ws2 := PPSmalltalkWhitespaceParser new. self assert: ws1 = ws2. - self assert: (ws1 == ws2) not. + self assert: ws1 ~~ ws2. self assert: ws1 hash = ws2 hash. + + "Modified: / 30-07-2015 / 06:56:53 / Jan Vrany " ! ! diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCSmalltalkVerificationTest.st --- a/compiler/tests/extras/PPCSmalltalkVerificationTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPAbstractParserTest subclass:#PPCSmalltalkVerificationTest - instanceVariableNames:'parser result context resource fileResources' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - -!PPCSmalltalkVerificationTest class methodsFor:'as yet unclassified'! - -isAbstract - ^ self name = #PPCSmalltalkVerificationTest -! - -resources - ^ (OrderedCollection with: PPCResources) - addAll: super resources; - yourself -! ! - -!PPCSmalltalkVerificationTest methodsFor:'accessing'! - -compiledSmalltalkGrammar - ^ self compiledSmalltalkGrammarClass new -! - -compiledSmalltalkGrammarClass - self subclassResponsibility -! - -smalltalkGrammar - ^ PPSmalltalkGrammar new -! ! - -!PPCSmalltalkVerificationTest methodsFor:'setup'! - -setUp - super setUp. - fileResources := (self resources detect: [:e | e = PPCResources ]) current. -! - -tearDown - super tearDown. - " - self compiledSmalltalkGrammarClass isNil ifFalse:[ - self compiledSmalltalkGrammarClass removeFromSystem - ]. - " -! ! - -!PPCSmalltalkVerificationTest methodsFor:'tests'! - -testSmalltalk - | compiledParser normalParser expected actual | - normalParser := self smalltalkGrammar. - compiledParser := self compiledSmalltalkGrammar. - - fileResources smalltalkSourcesBig do: [ :source | - expected := normalParser parse: source. - expected isPetitFailure ifFalse: [ - actual := (compiledParser parse: source withContext: self context). - self assert: expected equals: actual. - ] - ]. -! - -testSmalltalkClass - | compiledParser normalParser | - normalParser := self smalltalkGrammar. - compiledParser := self compiledSmalltalkGrammar. - - fileResources smalltalkClassMethods do: [ :source | - self assert: (normalParser parse: source) - equals: (compiledParser parse: source withContext: self context). - ]. -! - -testSmalltalkObject - | compiledParser normalParser | - normalParser := self smalltalkGrammar. - compiledParser := self compiledSmalltalkGrammar. - - fileResources smalltalkObjectMethods do: [ :source | - self assert: (normalParser parse: source) - equals: (compiledParser parse: source withContext: self context). - ]. -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCompiledExpressionGrammarResource.st --- a/compiler/tests/extras/PPCompiledExpressionGrammarResource.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -TestResource subclass:#PPCompiledExpressionGrammarResource - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Expressions' -! - - -!PPCompiledExpressionGrammarResource methodsFor:'as yet unclassified'! - -setUp - | time configuration | - configuration := PPCConfiguration universal. - configuration arguments parserName: #PPCompiledExpressionGrammar. - - - time := Time millisecondsToRun: [ - PPExpressionGrammar new compileWithConfiguration: configuration. - ]. - Transcript show: 'Expression grammar compiled in: ', time asString, 'ms'; cr. - -! ! - -!PPCompiledExpressionGrammarResource class methodsFor:'documentation'! - -version_HG - - ^ '$Changeset: $' -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCompiledExpressionGrammarTest.st --- a/compiler/tests/extras/PPCompiledExpressionGrammarTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCompositeParserTest subclass:#PPCompiledExpressionGrammarTest - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Expressions' -! - -!PPCompiledExpressionGrammarTest class methodsFor:'as yet unclassified'! - -resources - ^ (OrderedCollection with: PPCompiledExpressionGrammarResource) - addAll: super resources; - yourself -! ! - -!PPCompiledExpressionGrammarTest methodsFor:'as yet unclassified'! - -compilerArguments - ^ PPCArguments default - profile: true; - ll: true; - yourself -! - -context - - ^ PPCContext new -! - -parserClass - ^ Smalltalk at: #PPCompiledExpressionGrammar -! - -parserInstanceFor: aSymbol - ^ (Smalltalk at: #PPCompiledExpressionGrammar) new startSymbol: aSymbol -! - -testAdd - result := self parse: '1+2' rule: #add. - self assert: result isArray. - self assert: result first = 1. - self assert: result second inputValue = '+'. - self assert: result third = 2. -! - -testMul - result := self parse: '1 * 2' rule: #mul. - self assert: result isArray. - self assert: result first = 1. - self assert: result second inputValue = '*'. - self assert: result third = 2. -! - -testNumber - result := self parse: '1' rule: #number. - self assert: result = 1. -! - -testParens - result := self parse: '(1)' rule: #parens. - self assert: result size = 3. - self assert: result first inputValue = '('. - self assert: result second = 1. - self assert: result third inputValue = ')'. - -! - -testPrim - result := self parse: '1' rule: #prim. - self assert: result = 1. -! - -testPrim2 - result := self parse: '(1)' rule: #prim. - self assert: result size = 3. - self assert: result second = 1. -! - -testProd - result := self parse: '1' rule: #prod. - self assert: result = 1. -! - -testTerm - result := self parse: '1' rule: #term. - self assert: result = 1. - -! - -testTerm11 - result := self parse: '1 + 2' rule: #term. - self assert: result size = 3. - self assert: result first = 1. - self assert: result second inputValue = '+'. - self assert: result third = 2. - -! - -testTerm12 - result := self parse: '1 + 2 * 3' rule: #term. - self assert: result size = 3. - self assert: result second inputValue = '+'. - self assert: result first = 1. - self assert: result third isArray. - self assert: result third first = 2. - self assert: result third second inputValue = '*'. - self assert: result third third = 3. -! - -testTerm13 - result := self parse: '1 * 2 + 3' rule: #term. - self assert: result size = 3. - self assert: result first isArray. - self assert: result first first = 1. - self assert: result first second inputValue = '*'. - self assert: result first third = 2. - self assert: result second inputValue = '+'. - self assert: result third = 3. -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCompiledExpressionsVerificationTest.st --- a/compiler/tests/extras/PPCompiledExpressionsVerificationTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCExpressionsVerificationTest subclass:#PPCompiledExpressionsVerificationTest - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Expressions' -! - - -!PPCompiledExpressionsVerificationTest class methodsFor:'as yet unclassified'! - -resources - ^ (OrderedCollection with: PPCompiledExpressionGrammarResource) - addAll: super resources; - yourself -! ! - -!PPCompiledExpressionsVerificationTest methodsFor:'as yet unclassified'! - -compiledGrammarClass - ^ (Smalltalk at: #PPCompiledExpressionGrammar) -! ! - -!PPCompiledExpressionsVerificationTest methodsFor:'testing'! - -testExpressions - ^ super testExpressions -! - -testSanity - ^ super testSanity -! ! - -!PPCompiledExpressionsVerificationTest class methodsFor:'documentation'! - -version_HG - - ^ '$Changeset: $' -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCompiledSmalltalkGrammarResource.st --- a/compiler/tests/extras/PPCompiledSmalltalkGrammarResource.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -TestResource subclass:#PPCompiledSmalltalkGrammarResource - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - -!PPCompiledSmalltalkGrammarResource methodsFor:'as yet unclassified'! - -setUp - | time configuration | - configuration := PPCConfiguration universal. - configuration arguments parserName:#PPCompiledSmalltalkGrammar. - - time := Time millisecondsToRun: [ - PPSmalltalkGrammar new compileWithConfiguration: configuration. - ]. - Transcript show: 'Smalltalk Grammar compiled in: '; show: time asString; show: 'ms'; cr. - - "Modified: / 10-05-2015 / 07:57:43 / Jan Vrany " -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCompiledSmalltalkGrammarTests.st --- a/compiler/tests/extras/PPCompiledSmalltalkGrammarTests.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,930 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCompositeParserTest subclass:#PPCompiledSmalltalkGrammarTests - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - - -!PPCompiledSmalltalkGrammarTests class methodsFor:'accessing'! - -resources - ^ (OrderedCollection with: PPCompiledSmalltalkGrammarResource) - addAll: super resources; - yourself -! ! - -!PPCompiledSmalltalkGrammarTests methodsFor:'accessing'! - -context - ^ PPCContext new -! - -parserClass - ^ Smalltalk at: #PPCompiledSmalltalkGrammar -! - -parserInstanceFor: aSymbol - ^ (Smalltalk at: #PPCompiledSmalltalkGrammar) new startSymbol: aSymbol -! ! - -!PPCompiledSmalltalkGrammarTests methodsFor:'testing'! - -testArray1 - self - parse: '{}' - rule: #array -! - -testArray2 - self - parse: '{self foo}' - rule: #array -! - -testArray3 - self - parse: '{self foo. self bar}' - rule: #array -! - -testArray4 - self - parse: '{self foo. self bar.}' - rule: #array -! - -testAssignment1 - self - parse: '1' - rule: #expression -! - -testAssignment2 - self - parse: 'a := 1' - rule: #expression -! - -testAssignment3 - self - parse: 'a := b := 1' - rule: #expression -! - -testAssignment4 - PPSmalltalkGrammar allowUnderscoreAssignment - ifTrue: [ self parse: 'a _ 1' rule: #expression ] - ifFalse: [ self fail: 'a _ 1' rule: #expression ] -! - -testAssignment5 - PPSmalltalkGrammar allowUnderscoreAssignment - ifTrue: [ self parse: 'a _ b _ 1' rule: #expression ] - ifFalse: [ self fail: 'a _ b _ 1' rule: #expression ] -! - -testAssignment6 - self - parse: 'a := (b := c)' - rule: #expression -! - -testComment1 - self - parse: '1"one"+2' - rule: #expression -! - -testComment2 - self - parse: '1 "one" +2' - rule: #expression -! - -testComment3 - self - parse: '1"one"+"two"2' - rule: #expression -! - -testComment4 - self - parse: '1"one""two"+2' - rule: #expression -! - -testComment5 - self - parse: '1"one" "two"+2' - rule: #expression -! - -testCompleteness - "This test asserts that all subclasses override all test methods." - - self class allSubclasses do: [ :subclass | - self class testSelectors do: [ :selector | - self - assert: (selector = #testCompleteness or: [ subclass selectors includes: selector ]) - description: subclass printString , ' does not test ' , selector printString ] ] -! - -testMethod1 - self - parse: 'negated ^ 0 - self' - rule: #method -! - -testMethod2 - "Spaces at the beginning of the method." - self - parse: ' negated ^ 0 - self' - rule: #method -! - -testMethod3 - "Spaces at the end of the method." - self - parse: ' negated ^ 0 - self ' - rule: #method -! - -testSequence1 - self - parse: '| a | 1 . 2' - rule: #sequence -! - -testStatements1 - self - parse: '1' - rule: #sequence -! - -testStatements2 - self - parse: '1 . 2' - rule: #sequence -! - -testStatements3 - self - parse: '1 . 2 . 3' - rule: #sequence -! - -testStatements4 - self - parse: '1 . 2 . 3 .' - rule: #sequence -! - -testStatements5 - self - parse: '1 . . 2' - rule: #sequence -! - -testStatements6 - self - parse: '1. 2' - rule: #sequence -! - -testStatements7 - self - parse: '. 1' - rule: #sequence -! - -testStatements8 - self - parse: '.1' - rule: #sequence -! - -testStatements9 - self - parse: '' - rule: #statements -! - -testTemporaries1 - self - parse: '| a |' - rule: #sequence -! - -testTemporaries2 - self - parse: '| a b |' - rule: #sequence -! - -testTemporaries3 - self - parse: '| a b c |' - rule: #sequence -! - -testVariable1 - self - parse: 'trueBinding' - rule: #primary -! - -testVariable2 - self - parse: 'falseBinding' - rule: #primary -! - -testVariable3 - self - parse: 'nilly' - rule: #primary -! - -testVariable4 - self - parse: 'selfish' - rule: #primary -! - -testVariable5 - self - parse: 'supernanny' - rule: #primary -! - -testVariable6 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: 'super_nanny' - rule: #primary ] -! - -testVariable7 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: '__gen_var_123__' - rule: #primary ] -! ! - -!PPCompiledSmalltalkGrammarTests methodsFor:'testing-blocks'! - -testArgumentsBlock1 - self - parse: '[ :a | ]' - rule: #block -! - -testArgumentsBlock2 - self - parse: '[ :a :b | ]' - rule: #block -! - -testArgumentsBlock3 - self - parse: '[ :a :b :c | ]' - rule: #block -! - -testBlock1 - self - parse: '[]' - rule: #block -! - -testComplexBlock1 - self - parse: '[ :a | | b | c ]' - rule: #block -! - -testComplexBlock2 - self - parse: '[:a||b|c]' - rule: #block -! - -testSimpleBlock1 - self - parse: '[ ]' - rule: #block -! - -testSimpleBlock2 - self - parse: '[ nil ]' - rule: #block -! - -testSimpleBlock3 - self - parse: '[ :a ]' - rule: #block -! - -testStatementBlock1 - self - parse: '[ nil ]' - rule: #block -! - -testStatementBlock2 - self - parse: '[ | a | nil ]' - rule: #block -! - -testStatementBlock3 - self - parse: '[ | a b | nil ]' - rule: #block -! ! - -!PPCompiledSmalltalkGrammarTests methodsFor:'testing-literals'! - -testArrayLiteral1 - self - parse: '#()' - rule: #arrayLiteral -! - -testArrayLiteral10 - self - parse: '#((1 2) #(1 2 3))' - rule: #arrayLiteral -! - -testArrayLiteral11 - self - parse: '#([1 2] #[1 2 3])' - rule: #arrayLiteral -! - -testArrayLiteral2 - self - parse: '#(1)' - rule: #arrayLiteral -! - -testArrayLiteral3 - self - parse: '#(1 2)' - rule: #arrayLiteral -! - -testArrayLiteral4 - self - parse: '#(true false nil)' - rule: #arrayLiteral -! - -testArrayLiteral5 - self - parse: '#($a)' - rule: #arrayLiteral -! - -testArrayLiteral6 - self - parse: '#(1.2)' - rule: #arrayLiteral -! - -testArrayLiteral7 - self - parse: '#(size #at: at:put: #''=='')' - rule: #arrayLiteral -! - -testArrayLiteral8 - self - parse: '#(''baz'')' - rule: #arrayLiteral -! - -testArrayLiteral9 - self - parse: '#((1) 2)' - rule: #arrayLiteral -! - -testByteLiteral1 - self - parse: '#[]' - rule: #byteLiteral -! - -testByteLiteral2 - self - parse: '#[0]' - rule: #byteLiteral -! - -testByteLiteral3 - self - parse: '#[255]' - rule: #byteLiteral -! - -testByteLiteral4 - self - parse: '#[ 1 2 ]' - rule: #byteLiteral -! - -testByteLiteral5 - self - parse: '#[ 2r1010 8r77 16rFF ]' - rule: #byteLiteral -! - -testCharLiteral1 - self - parse: '$a' - rule: #charLiteral -! - -testCharLiteral2 - self - parse: '$ ' - rule: #charLiteral -! - -testCharLiteral3 - self - parse: '$$' - rule: #charLiteral -! - -testNumberLiteral1 - self - parse: '0' - rule: #numberLiteral -! - -testNumberLiteral10 - self - parse: '10r10' - rule: #numberLiteral -! - -testNumberLiteral11 - self - parse: '8r777' - rule: #numberLiteral -! - -testNumberLiteral12 - self - parse: '16rAF' - rule: #numberLiteral -! - -testNumberLiteral13 - self - parse: '16rCA.FE' - rule: #numberLiteral -! - -testNumberLiteral14 - self - parse: '3r-22.2' - rule: #numberLiteral -! - -testNumberLiteral15 - self - parse: '0.50s2' - rule: #numberLiteral -! - -testNumberLiteral2 - self - parse: '0.1' - rule: #numberLiteral -! - -testNumberLiteral3 - self - parse: '123' - rule: #numberLiteral -! - -testNumberLiteral4 - self - parse: '123.456' - rule: #numberLiteral -! - -testNumberLiteral5 - self - parse: '-0' - rule: #numberLiteral -! - -testNumberLiteral6 - self - parse: '-0.1' - rule: #numberLiteral -! - -testNumberLiteral7 - self - parse: '-123' - rule: #numberLiteral -! - -testNumberLiteral8 - self - parse: '-125' - rule: #numberLiteral -! - -testNumberLiteral9 - self - parse: '-123.456' - rule: #numberLiteral -! - -testSpecialLiteral1 - self - parse: 'true' - rule: #trueLiteral -! - -testSpecialLiteral2 - self - parse: 'false' - rule: #falseLiteral -! - -testSpecialLiteral3 - self - parse: 'nil' - rule: #nilLiteral -! - -testStringLiteral1 - self - parse: '''''' - rule: #stringLiteral -! - -testStringLiteral2 - self - parse: '''ab''' - rule: #stringLiteral -! - -testStringLiteral3 - self - parse: '''ab''''cd''' - rule: #stringLiteral -! - -testSymbolLiteral1 - self - parse: '#foo' - rule: #symbolLiteral -! - -testSymbolLiteral2 - self - parse: '#+' - rule: #symbolLiteral -! - -testSymbolLiteral3 - self - parse: '#key:' - rule: #symbolLiteral -! - -testSymbolLiteral4 - self - parse: '#key:value:' - rule: #symbolLiteral -! - -testSymbolLiteral5 - self - parse: '#''testing-result''' - rule: #symbolLiteral -! - -testSymbolLiteral6 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: '#__gen__binding' - rule: #symbolLiteral ] -! - -testSymbolLiteral7 - self - parse: '# fucker' - rule: #symbolLiteral -! - -testSymbolLiteral8 - self - parse: '##fucker' - rule: #symbolLiteral -! - -testSymbolLiteral9 - self - parse: '## fucker' - rule: #symbolLiteral -! ! - -!PPCompiledSmalltalkGrammarTests methodsFor:'testing-messages'! - -testBinaryExpression1 - self - parse: '1 + 2' - rule: #expression -! - -testBinaryExpression2 - self - parse: '1 + 2 + 3' - rule: #expression -! - -testBinaryExpression3 - self - parse: '1 // 2' - rule: #expression -! - -testBinaryExpression4 - self - parse: '1 -- 2' - rule: #expression -! - -testBinaryExpression5 - self - parse: '1 ==> 2' - rule: #expression. -! - -testBinaryMethod1 - self - parse: '+ a' - rule: #method -! - -testBinaryMethod2 - self - parse: '+ a | b |' - rule: #method -! - -testBinaryMethod3 - self - parse: '+ a b' - rule: #method -! - -testBinaryMethod4 - self - parse: '+ a | b | c' - rule: #method -! - -testBinaryMethod5 - self - parse: '-- a' - rule: #method -! - -testCascadeExpression1 - self - parse: '1 abs; negated' - rule: #expression -! - -testCascadeExpression2 - self - parse: '1 abs negated; raisedTo: 12; negated' - rule: #expression -! - -testCascadeExpression3 - self - parse: '1 + 2; - 3' - rule: #expression -! - -testIdentifierToken - self - parse: 'foo' - rule: #identifierToken -! - -testIdentifierToken2 - self - parse: ' foo' - rule: #identifierToken -! - -testKeywordExpression1 - self - parse: '1 to: 2' - rule: #expression -! - -testKeywordExpression2 - self - parse: '1 to: 2 by: 3' - rule: #expression -! - -testKeywordExpression3 - self - parse: '1 to: 2 by: 3 do: 4' - rule: #expression -! - -testKeywordMethod1 - self - parse: 'to: a' - rule: #method -! - -testKeywordMethod2 - self - parse: 'to: a do: b | c |' - rule: #method -! - -testKeywordMethod3 - self - parse: 'to: a do: b by: c d' - rule: #method -! - -testKeywordMethod4 - self - parse: 'to: a do: b by: c | d | e' - rule: #method -! - -testUnaryExpression1 - self - parse: '1 abs' - rule: #expression -! - -testUnaryExpression2 - self - parse: '1 abs negated' - rule: #expression -! - -testUnaryMethod1 - self - parse: 'abs' - rule: #method -! - -testUnaryMethod2 - self - parse: 'abs | a |' - rule: #method -! - -testUnaryMethod3 - self - parse: 'abs a' - rule: #method -! - -testUnaryMethod4 - self - parse: 'abs | a | b' - rule: #method -! - -testUnaryMethod5 - self - parse: 'abs | a |' - rule: #method -! ! - -!PPCompiledSmalltalkGrammarTests methodsFor:'testing-pragmas'! - -testPragma1 - self - parse: 'method ' - rule: #method -! - -testPragma10 - self - parse: 'method ' - rule: #method -! - -testPragma11 - self - parse: 'method ' - rule: #method -! - -testPragma12 - self - parse: 'method ' - rule: #method -! - -testPragma13 - self - parse: 'method ' - rule: #method -! - -testPragma14 - self - parse: 'method ' - rule: #method -! - -testPragma15 - self - parse: 'method ' - rule: #method -! - -testPragma16 - self - parse: 'method < + 1 >' - rule: #method -! - -testPragma2 - self - parse: 'method ' - rule: #method -! - -testPragma3 - self - parse: 'method | a | ' - rule: #method -! - -testPragma4 - self - parse: 'method | a |' - rule: #method -! - -testPragma5 - self - parse: 'method | a | ' - rule: #method -! - -testPragma6 - self - parse: 'method ' - rule: #method -! - -testPragma7 - self - parse: 'method ' - rule: #method -! - -testPragma8 - self - parse: 'method ' - rule: #method -! - -testPragma9 - self - parse: 'method ' - rule: #method -! ! - -!PPCompiledSmalltalkGrammarTests class methodsFor:'documentation'! - -version_HG - - ^ '$Changeset: $' -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCompiledSmalltalkParserResource.st --- a/compiler/tests/extras/PPCompiledSmalltalkParserResource.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -TestResource subclass:#PPCompiledSmalltalkParserResource - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - -!PPCompiledSmalltalkParserResource methodsFor:'as yet unclassified'! - -setUp - | time configuration | - configuration := PPCConfiguration universal. - configuration arguments parserName:#PPCompiledSmalltalkParser. - - time := Time millisecondsToRun: [ - PPSmalltalkParser new compileWithConfiguration: configuration. - ]. - Transcript show: 'Smalltalk Parser compiled in: '; show: time asString; show: 'ms'; cr. - - "Modified: / 10-05-2015 / 07:57:43 / Jan Vrany " -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCompiledSmalltalkParserTests.st --- a/compiler/tests/extras/PPCompiledSmalltalkParserTests.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,929 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCompositeParserTest subclass:#PPCompiledSmalltalkParserTests - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - -!PPCompiledSmalltalkParserTests class methodsFor:'as yet unclassified'! - -resources - ^ Array with: PPCompiledSmalltalkParserResource - - "Modified: / 27-07-2015 / 15:58:24 / Jan Vrany " -! ! - -!PPCompiledSmalltalkParserTests methodsFor:'as yet unclassified'! - -context - ^ PPCContext new -! - -parserClass - ^ Smalltalk at: #PPCompiledSmalltalkParser -! - -parserInstanceFor: aSymbol - ^ (Smalltalk at: #PPCompiledSmalltalkParser) new startSymbol: aSymbol -! ! - -!PPCompiledSmalltalkParserTests methodsFor:'testing'! - -testArray1 - self - parse: '{}' - rule: #array -! - -testArray2 - self - parse: '{self foo}' - rule: #array -! - -testArray3 - self - parse: '{self foo. self bar}' - rule: #array -! - -testArray4 - self - parse: '{self foo. self bar.}' - rule: #array -! - -testAssignment1 - self - parse: '1' - rule: #expression -! - -testAssignment2 - self - parse: 'a := 1' - rule: #expression -! - -testAssignment3 - self - parse: 'a := b := 1' - rule: #expression -! - -testAssignment4 - PPSmalltalkGrammar allowUnderscoreAssignment - ifTrue: [ self parse: 'a _ 1' rule: #expression ] - ifFalse: [ self fail: 'a _ 1' rule: #expression ] -! - -testAssignment5 - PPSmalltalkGrammar allowUnderscoreAssignment - ifTrue: [ self parse: 'a _ b _ 1' rule: #expression ] - ifFalse: [ self fail: 'a _ b _ 1' rule: #expression ] -! - -testAssignment6 - self - parse: 'a := (b := c)' - rule: #expression -! - -testComment1 - self - parse: '1"one"+2' - rule: #expression -! - -testComment2 - self - parse: '1 "one" +2' - rule: #expression -! - -testComment3 - self - parse: '1"one"+"two"2' - rule: #expression -! - -testComment4 - self - parse: '1"one""two"+2' - rule: #expression -! - -testComment5 - self - parse: '1"one" "two"+2' - rule: #expression -! - -testCompleteness - "This test asserts that all subclasses override all test methods." - - self class allSubclasses do: [ :subclass | - self class testSelectors do: [ :selector | - self - assert: (selector = #testCompleteness or: [ subclass selectors includes: selector ]) - description: subclass printString , ' does not test ' , selector printString ] ] -! - -testMethod1 - self - parse: 'negated ^ 0 - self' - rule: #method -! - -testMethod2 - "Spaces at the beginning of the method." - self - parse: ' negated ^ 0 - self' - rule: #method -! - -testMethod3 - "Spaces at the end of the method." - self - parse: ' negated ^ 0 - self ' - rule: #method -! - -testMethod4 - self - parse: 'foo: bar - foo:= bar' - rule: #method -! - -testSequence1 - self - parse: '| a | 1 . 2' - rule: #sequence -! - -testStatements1 - self - parse: '1' - rule: #sequence -! - -testStatements2 - self - parse: '1 . 2' - rule: #sequence -! - -testStatements3 - self - parse: '1 . 2 . 3' - rule: #sequence -! - -testStatements4 - self - parse: '1 . 2 . 3 .' - rule: #sequence -! - -testStatements5 - self - parse: '1 . . 2' - rule: #sequence -! - -testStatements6 - self - parse: '1. 2' - rule: #sequence -! - -testStatements7 - self - parse: '. 1' - rule: #sequence -! - -testStatements8 - self - parse: '.1' - rule: #sequence -! - -testStatements9 - self - parse: '' - rule: #statements -! - -testTemporaries1 - self - parse: '| a |' - rule: #sequence -! - -testTemporaries2 - self - parse: '| a b |' - rule: #sequence -! - -testTemporaries3 - self - parse: '| a b c |' - rule: #sequence -! - -testVariable1 - self - parse: 'trueBinding' - rule: #primary -! - -testVariable2 - self - parse: 'falseBinding' - rule: #primary -! - -testVariable3 - self - parse: 'nilly' - rule: #primary -! - -testVariable4 - self - parse: 'selfish' - rule: #primary -! - -testVariable5 - self - parse: 'supernanny' - rule: #primary -! - -testVariable6 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: 'super_nanny' - rule: #primary ] -! - -testVariable7 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: '__gen_var_123__' - rule: #primary ] -! ! - -!PPCompiledSmalltalkParserTests methodsFor:'testing-blocks'! - -testArgumentsBlock1 - self - parse: '[ :a | ]' - rule: #block -! - -testArgumentsBlock2 - self - parse: '[ :a :b | ]' - rule: #block -! - -testArgumentsBlock3 - self - parse: '[ :a :b :c | ]' - rule: #block -! - -testBlock1 - self - parse: '[]' - rule: #block -! - -testComplexBlock1 - self - parse: '[ :a | | b | c ]' - rule: #block -! - -testComplexBlock2 - self - parse: '[:a||b|c]' - rule: #block -! - -testSimpleBlock1 - self - parse: '[ ]' - rule: #block -! - -testSimpleBlock2 - self - parse: '[ nil ]' - rule: #block -! - -testSimpleBlock3 - self - parse: '[ :a ]' - rule: #block -! - -testStatementBlock1 - self - parse: '[ nil ]' - rule: #block -! - -testStatementBlock2 - self - parse: '[ | a | nil ]' - rule: #block -! - -testStatementBlock3 - self - parse: '[ | a b | nil ]' - rule: #block -! ! - -!PPCompiledSmalltalkParserTests methodsFor:'testing-literals'! - -testArrayLiteral1 - self - parse: '#()' - rule: #arrayLiteral -! - -testArrayLiteral10 - self - parse: '#((1 2) #(1 2 3))' - rule: #arrayLiteral -! - -testArrayLiteral11 - self - parse: '#([1 2] #[1 2 3])' - rule: #arrayLiteral -! - -testArrayLiteral2 - self - parse: '#(1)' - rule: #arrayLiteral -! - -testArrayLiteral3 - self - parse: '#(1 2)' - rule: #arrayLiteral -! - -testArrayLiteral4 - self - parse: '#(true false nil)' - rule: #arrayLiteral -! - -testArrayLiteral5 - self - parse: '#($a)' - rule: #arrayLiteral -! - -testArrayLiteral6 - self - parse: '#(1.2)' - rule: #arrayLiteral -! - -testArrayLiteral7 - self - parse: '#(size #at: at:put: #''=='')' - rule: #arrayLiteral -! - -testArrayLiteral8 - self - parse: '#(''baz'')' - rule: #arrayLiteral -! - -testArrayLiteral9 - self - parse: '#((1) 2)' - rule: #arrayLiteral -! - -testByteLiteral1 - self - parse: '#[]' - rule: #byteLiteral -! - -testByteLiteral2 - self - parse: '#[0]' - rule: #byteLiteral -! - -testByteLiteral3 - self - parse: '#[255]' - rule: #byteLiteral -! - -testByteLiteral4 - self - parse: '#[ 1 2 ]' - rule: #byteLiteral -! - -testByteLiteral5 - self - parse: '#[ 2r1010 8r77 16rFF ]' - rule: #byteLiteral -! - -testCharLiteral1 - self - parse: '$a' - rule: #charLiteral -! - -testCharLiteral2 - self - parse: '$ ' - rule: #charLiteral -! - -testCharLiteral3 - self - parse: '$$' - rule: #charLiteral -! - -testNumberLiteral1 - self - parse: '0' - rule: #numberLiteral -! - -testNumberLiteral10 - self - parse: '10r10' - rule: #numberLiteral -! - -testNumberLiteral11 - self - parse: '8r777' - rule: #numberLiteral -! - -testNumberLiteral12 - self - parse: '16rAF' - rule: #numberLiteral -! - -testNumberLiteral13 - self - parse: '16rCA.FE' - rule: #numberLiteral -! - -testNumberLiteral14 - self - parse: '3r-22.2' - rule: #numberLiteral -! - -testNumberLiteral15 - self - parse: '0.50s2' - rule: #numberLiteral -! - -testNumberLiteral2 - self - parse: '0.1' - rule: #numberLiteral -! - -testNumberLiteral3 - self - parse: '123' - rule: #numberLiteral -! - -testNumberLiteral4 - self - parse: '123.456' - rule: #numberLiteral -! - -testNumberLiteral5 - self - parse: '-0' - rule: #numberLiteral -! - -testNumberLiteral6 - self - parse: '-0.1' - rule: #numberLiteral -! - -testNumberLiteral7 - self - parse: '-123' - rule: #numberLiteral -! - -testNumberLiteral8 - self - parse: '-125' - rule: #numberLiteral -! - -testNumberLiteral9 - self - parse: '-123.456' - rule: #numberLiteral -! - -testSpecialLiteral1 - self - parse: 'true' - rule: #trueLiteral -! - -testSpecialLiteral2 - self - parse: 'false' - rule: #falseLiteral -! - -testSpecialLiteral3 - self - parse: 'nil' - rule: #nilLiteral -! - -testStringLiteral1 - self - parse: '''''' - rule: #stringLiteral -! - -testStringLiteral2 - self - parse: '''ab''' - rule: #stringLiteral -! - -testStringLiteral3 - self - parse: '''ab''''cd''' - rule: #stringLiteral -! - -testSymbolLiteral1 - self - parse: '#foo' - rule: #symbolLiteral -! - -testSymbolLiteral2 - self - parse: '#+' - rule: #symbolLiteral -! - -testSymbolLiteral3 - self - parse: '#key:' - rule: #symbolLiteral -! - -testSymbolLiteral4 - self - parse: '#key:value:' - rule: #symbolLiteral -! - -testSymbolLiteral5 - self - parse: '#''testing-result''' - rule: #symbolLiteral -! - -testSymbolLiteral6 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: '#__gen__binding' - rule: #symbolLiteral ] -! - -testSymbolLiteral7 - self - parse: '# fucker' - rule: #symbolLiteral -! - -testSymbolLiteral8 - self - parse: '##fucker' - rule: #symbolLiteral -! - -testSymbolLiteral9 - self - parse: '## fucker' - rule: #symbolLiteral -! ! - -!PPCompiledSmalltalkParserTests methodsFor:'testing-messages'! - -testBinaryExpression1 - self - parse: '1 + 2' - rule: #expression -! - -testBinaryExpression2 - self - parse: '1 + 2 + 3' - rule: #expression -! - -testBinaryExpression3 - self - parse: '1 // 2' - rule: #expression -! - -testBinaryExpression4 - self - parse: '1 -- 2' - rule: #expression -! - -testBinaryExpression5 - self - parse: '1 ==> 2' - rule: #expression. -! - -testBinaryMethod1 - self - parse: '+ a' - rule: #method -! - -testBinaryMethod2 - self - parse: '+ a | b |' - rule: #method -! - -testBinaryMethod3 - self - parse: '+ a b' - rule: #method -! - -testBinaryMethod4 - self - parse: '+ a | b | c' - rule: #method -! - -testBinaryMethod5 - self - parse: '-- a' - rule: #method -! - -testCascadeExpression1 - self - parse: '1 abs; negated' - rule: #expression -! - -testCascadeExpression2 - self - parse: '1 abs negated; raisedTo: 12; negated' - rule: #expression -! - -testCascadeExpression3 - self - parse: '1 + 2; - 3' - rule: #expression -! - -testIdentifierToken - self - parse: 'foo' - rule: #identifierToken -! - -testIdentifierToken2 - self - parse: ' foo' - rule: #identifierToken -! - -testKeywordExpression1 - self - parse: '1 to: 2' - rule: #expression -! - -testKeywordExpression2 - self - parse: '1 to: 2 by: 3' - rule: #expression -! - -testKeywordExpression3 - self - parse: '1 to: 2 by: 3 do: 4' - rule: #expression -! - -testKeywordMethod1 - self - parse: 'to: a' - rule: #method -! - -testKeywordMethod2 - self - parse: 'to: a do: b | c |' - rule: #method -! - -testKeywordMethod3 - self - parse: 'to: a do: b by: c d' - rule: #method -! - -testKeywordMethod4 - self - parse: 'to: a do: b by: c | d | e' - rule: #method -! - -testUnaryExpression1 - self - parse: '1 abs' - rule: #expression -! - -testUnaryExpression2 - self - parse: '1 abs negated' - rule: #expression -! - -testUnaryMethod1 - self - parse: 'abs' - rule: #method -! - -testUnaryMethod2 - self - parse: 'abs | a |' - rule: #method -! - -testUnaryMethod3 - self - parse: 'abs a' - rule: #method -! - -testUnaryMethod4 - self - parse: 'abs | a | b' - rule: #method -! - -testUnaryMethod5 - self - parse: 'abs | a |' - rule: #method -! ! - -!PPCompiledSmalltalkParserTests methodsFor:'testing-pragmas'! - -testPragma1 - self - parse: 'method ' - rule: #method -! - -testPragma10 - self - parse: 'method ' - rule: #method -! - -testPragma11 - self - parse: 'method ' - rule: #method -! - -testPragma12 - self - parse: 'method ' - rule: #method -! - -testPragma13 - self - parse: 'method ' - rule: #method -! - -testPragma14 - self - parse: 'method ' - rule: #method -! - -testPragma15 - self - parse: 'method ' - rule: #method -! - -testPragma16 - self - parse: 'method < + 1 >' - rule: #method -! - -testPragma2 - self - parse: 'method ' - rule: #method -! - -testPragma3 - self - parse: 'method | a | ' - rule: #method -! - -testPragma4 - self - parse: 'method | a |' - rule: #method -! - -testPragma5 - self - parse: 'method | a | ' - rule: #method -! - -testPragma6 - self - parse: 'method ' - rule: #method -! - -testPragma7 - self - parse: 'method ' - rule: #method -! - -testPragma8 - self - parse: 'method ' - rule: #method -! - -testPragma9 - self - parse: 'method ' - rule: #method -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPCompiledSmalltalkVerificationTest.st --- a/compiler/tests/extras/PPCompiledSmalltalkVerificationTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCSmalltalkVerificationTest subclass:#PPCompiledSmalltalkVerificationTest - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - - -!PPCompiledSmalltalkVerificationTest class methodsFor:'as yet unclassified'! - -resources - ^ (OrderedCollection with: PPCompiledSmalltalkGrammarResource) - addAll: super resources; - yourself -! ! - -!PPCompiledSmalltalkVerificationTest methodsFor:'accessing'! - -compiledSmalltalkGrammarClass - ^ (Smalltalk at: #PPCompiledSmalltalkGrammar) -! ! - -!PPCompiledSmalltalkVerificationTest methodsFor:'tests'! - -testSmalltalk - super testSmalltalk -! - -testSmalltalkClass - super testSmalltalkClass -! - -testSmalltalkObject - super testSmalltalkObject -! ! - -!PPCompiledSmalltalkVerificationTest class methodsFor:'documentation'! - -version_HG - - ^ '$Changeset: $' -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPExpressionGrammarVerificationTest_Tokenized.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPExpressionGrammarVerificationTest_Tokenized.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,32 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCExpressionGrammarVerificationTest subclass:#PPExpressionGrammarVerificationTest_Tokenized + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Expressions' +! + + +!PPExpressionGrammarVerificationTest_Tokenized methodsFor:'accessing'! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^ PPCConfiguration tokenizing + + "Modified: / 29-07-2015 / 17:07:39 / Jan Vrany " +! ! + +!PPExpressionGrammarVerificationTest_Tokenized class methodsFor:'documentation'! + +version + ^ 'Path: stx/goodies/petitparser/compiler/tests/extras/PPTokenizedExpressionsVerificationTest.st, Version: 1.0, User: jv, Time: 2015-07-29T18:57:05.904+01' +! + +version_HG + ^ 'Path: stx/goodies/petitparser/compiler/tests/extras/PPTokenizedExpressionsVerificationTest.st, Version: 1.0, User: jv, Time: 2015-07-29T18:57:05.904+01' +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPExpressionGrammarVerificationTest_Universal.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/PPExpressionGrammarVerificationTest_Universal.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,29 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" + +"{ NameSpace: Smalltalk }" + +PPCExpressionGrammarVerificationTest subclass:#PPExpressionGrammarVerificationTest_Universal + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'PetitCompiler-Extras-Tests-Expressions' +! + + +!PPExpressionGrammarVerificationTest_Universal methodsFor:'accessing'! + +compilerConfiguration + "Return configuration to use when compiling parser (as instance of PPCConfiguration)" + + ^PPCConfiguration universal + + "Modified: / 29-07-2015 / 17:06:46 / Jan Vrany " +! ! + +!PPExpressionGrammarVerificationTest_Universal class methodsFor:'documentation'! + +version_HG + + ^ '$Changeset: $' +! ! + diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPLL1ExpressionGrammar.st --- a/compiler/tests/extras/PPLL1ExpressionGrammar.st Fri Jul 31 08:22:18 2015 +0100 +++ b/compiler/tests/extras/PPLL1ExpressionGrammar.st Thu Jul 30 08:37:37 2015 +0100 @@ -9,7 +9,6 @@ category:'PetitCompiler-Extras-Tests-Expressions' ! - !PPLL1ExpressionGrammar methodsFor:'as yet unclassified'! add @@ -79,10 +78,3 @@ ^ $+ asParser trimmingToken, term ! ! -!PPLL1ExpressionGrammar class methodsFor:'documentation'! - -version_HG - - ^ '$Changeset: $' -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPLL1ExpressionGrammarTest.st --- a/compiler/tests/extras/PPLL1ExpressionGrammarTest.st Fri Jul 31 08:22:18 2015 +0100 +++ b/compiler/tests/extras/PPLL1ExpressionGrammarTest.st Thu Jul 30 08:37:37 2015 +0100 @@ -9,7 +9,6 @@ category:'PetitCompiler-Extras-Tests-Expressions' ! - !PPLL1ExpressionGrammarTest methodsFor:'as yet unclassified'! parserClass @@ -99,10 +98,3 @@ self assert: result third = 3. ! ! -!PPLL1ExpressionGrammarTest class methodsFor:'documentation'! - -version_HG - - ^ '$Changeset: $' -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedExpressionGrammarResource.st --- a/compiler/tests/extras/PPTokenizedExpressionGrammarResource.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -TestResource subclass:#PPTokenizedExpressionGrammarResource - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Expressions' -! - - -!PPTokenizedExpressionGrammarResource methodsFor:'as yet unclassified'! - -setUp - | time configuration | - configuration := PPCTokenizingConfiguration new. - configuration arguments parserName:#PPTokenizedExpressionGrammar. - - - time := Time millisecondsToRun: [ - PPExpressionGrammar new compileWithConfiguration: configuration. - ]. - Transcript show: 'Expression grammar tokenized in: '; show: time asString; show: 'ms'; cr. - - "Modified: / 26-05-2015 / 07:25:13 / Jan Vrany " -! ! - -!PPTokenizedExpressionGrammarResource class methodsFor:'documentation'! - -version_HG - - ^ '$Changeset: $' -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedExpressionGrammarTest.st --- a/compiler/tests/extras/PPTokenizedExpressionGrammarTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCompositeParserTest subclass:#PPTokenizedExpressionGrammarTest - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Expressions' -! - -!PPTokenizedExpressionGrammarTest class methodsFor:'as yet unclassified'! - -resources - ^ (OrderedCollection with: PPTokenizedExpressionGrammarResource) - addAll: super resources; - yourself -! ! - -!PPTokenizedExpressionGrammarTest methodsFor:'as yet unclassified'! - -compilerArguments - ^ PPCArguments default - profile: true; - yourself -! - -context - ^ PPCContext new -! - -parserClass - ^ Smalltalk at: #PPTokenizedExpressionGrammar -! - -parserInstanceFor: aSymbol - ^ (Smalltalk at: #PPTokenizedExpressionGrammar) new startSymbol: aSymbol -! - -testAdd - result := self parse: '1+2' rule: #add. - self assert: result isArray. - self assert: result first = 1. - self assert: result second inputValue = '+'. - self assert: result third = 2. -! - -testMul - result := self parse: '1 * 2' rule: #mul. - self assert: result isArray. - self assert: result first = 1. - self assert: result second inputValue = '*'. - self assert: result third = 2. -! - -testNumber - result := self parse: '1' rule: #number. - self assert: result = 1. -! - -testParens - result := self parse: '(1)' rule: #parens. - self assert: result size = 3. - self assert: result first inputValue = '('. - self assert: result second = 1. - self assert: result third inputValue = ')'. - -! - -testPrim - result := self parse: '1' rule: #prim. - self assert: result = 1. -! - -testPrim2 - result := self parse: '(1)' rule: #prim. - self assert: result size = 3. - self assert: result second = 1. -! - -testProd - result := self parse: '1' rule: #prod. - self assert: result = 1. -! - -testTerm - result := self parse: '1' rule: #term. - self assert: result = 1. - -! - -testTerm11 - result := self parse: '1 + 2' rule: #term. - self assert: result size = 3. - self assert: result first = 1. - self assert: result second inputValue = '+'. - self assert: result third = 2. - -! - -testTerm12 - result := self parse: '1 + 2 * 3' rule: #term. - self assert: result size = 3. - self assert: result second inputValue = '+'. - self assert: result first = 1. - self assert: result third isArray. - self assert: result third first = 2. - self assert: result third second inputValue = '*'. - self assert: result third third = 3. -! - -testTerm13 - result := self parse: '1 * 2 + 3' rule: #term. - self assert: result size = 3. - self assert: result first isArray. - self assert: result first first = 1. - self assert: result first second inputValue = '*'. - self assert: result first third = 2. - self assert: result second inputValue = '+'. - self assert: result third = 3. -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedExpressionsVerificationTest.st --- a/compiler/tests/extras/PPTokenizedExpressionsVerificationTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCExpressionsVerificationTest subclass:#PPTokenizedExpressionsVerificationTest - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Expressions' -! - -!PPTokenizedExpressionsVerificationTest class methodsFor:'as yet unclassified'! - -resources - ^ (OrderedCollection with: PPTokenizedExpressionGrammarResource) - addAll: super resources; - yourself -! ! - -!PPTokenizedExpressionsVerificationTest methodsFor:'as yet unclassified'! - -compiledGrammarClass - ^ (Smalltalk at: #PPTokenizedExpressionGrammar) -! ! - -!PPTokenizedExpressionsVerificationTest methodsFor:'testing'! - -testExpressions - ^ super testExpressions -! - -testSanity - ^ super testSanity -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedLL1ExpressionGrammarResource.st --- a/compiler/tests/extras/PPTokenizedLL1ExpressionGrammarResource.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -TestResource subclass:#PPTokenizedLL1ExpressionGrammarResource - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Expressions' -! - -!PPTokenizedLL1ExpressionGrammarResource methodsFor:'as yet unclassified'! - -setUp - | time configuration | - configuration := PPCTokenizingConfiguration new. - configuration arguments parserName:#PPTokenizedLL1ExpressionGrammar. - - - time := Time millisecondsToRun: [ - PPLL1ExpressionGrammar new compileWithConfiguration: configuration. - ]. - Transcript show: 'LL1 Expression grammar tokenized in: '; show: time asString; show: 'ms'; cr. - - "Modified: / 26-05-2015 / 07:24:35 / Jan Vrany " -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedLL1ExpressionGrammarTest.st --- a/compiler/tests/extras/PPTokenizedLL1ExpressionGrammarTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCompositeParserTest subclass:#PPTokenizedLL1ExpressionGrammarTest - instanceVariableNames:'context' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Expressions' -! - -!PPTokenizedLL1ExpressionGrammarTest class methodsFor:'as yet unclassified'! - -resources - ^ (OrderedCollection with: PPTokenizedLL1ExpressionGrammarResource) - addAll: super resources; - yourself -! ! - -!PPTokenizedLL1ExpressionGrammarTest methodsFor:'as yet unclassified'! - -compilerArguments - ^ PPCArguments default - profile: true; - ll: true; - yourself -! - -context - ^ context := PPCProfilingContext new -! - -parserClass - ^ Smalltalk at: #PPTokenizedLL1ExpressionGrammar -! - -parserInstanceFor: aSymbol - ^ (Smalltalk at: #PPTokenizedLL1ExpressionGrammar) new startSymbol: aSymbol -! - -testAdd - result := self parse: '1+2' rule: #term. - self assert: result isArray. - self assert: result first = 1. - self assert: result second inputValue = '+'. - self assert: result third = 2. -! - -testMul - result := self parse: '1 * 2' rule: #mul. - self assert: result isArray. - self assert: result first = 1. - self assert: result second inputValue = '*'. - self assert: result third = 2. -! - -testNumber - result := self parse: '1' rule: #number. - self assert: result = 1. -! - -testParens - result := self parse: '(1)' rule: #parens. - self assert: result size = 3. - self assert: result first inputValue = '('. - self assert: result second = 1. - self assert: result third inputValue = ')'. - -! - -testPrim - result := self parse: '1' rule: #prim. - self assert: result = 1. -! - -testPrim2 - result := self parse: '(1)' rule: #prim. - self assert: result size = 3. - self assert: result second = 1. -! - -testProd - result := self parse: '1' rule: #prod. - self assert: result = 1. -! - -testTerm01 - result := self parse: '1' rule: #term. - self assert: result = 1. - - self assert: context lwRememberCount = 2. - self assert: context lwRestoreCount = 0. -! - -testTerm02 - result := self parse: '1+2' rule: #term. - self assert: result size = 3. - - self assert: context lwRestoreCount = 0. -! - -testTerm03 - result := self parse: '1*2+3*4' rule: #term. - self assert: result size = 3. - - - self assert: context lwRestoreCount = 0. -! - -testTerm11 - result := self parse: '1 + 2' rule: #term. - self assert: result size = 3. - self assert: result first = 1. - self assert: result second inputValue = '+'. - self assert: result third = 2. - -! - -testTerm12 - result := self parse: '1 + 2 * 3' rule: #term. - self assert: result size = 3. - self assert: result second inputValue = '+'. - self assert: result first = 1. - self assert: result third isArray. - self assert: result third first = 2. - self assert: result third second inputValue = '*'. - self assert: result third third = 3. -! - -testTerm13 - result := self parse: '1 * 2 + 3' rule: #term. - self assert: result size = 3. - self assert: result first isArray. - self assert: result first first = 1. - self assert: result first second inputValue = '*'. - self assert: result first third = 2. - self assert: result second inputValue = '+'. - self assert: result third = 3. -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedSmalltalkGrammarResource.st --- a/compiler/tests/extras/PPTokenizedSmalltalkGrammarResource.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -TestResource subclass:#PPTokenizedSmalltalkGrammarResource - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - - -!PPTokenizedSmalltalkGrammarResource methodsFor:'as yet unclassified'! - -setUp - | time configuration | - configuration := PPCConfiguration tokenizing. - configuration arguments parserName:#PPTokenizedSmalltalkGrammar. - - time := Time millisecondsToRun: [ - PPSmalltalkGrammar new compileWithConfiguration: configuration. - ]. - Transcript show: 'Smalltalk Grammar tokenized in: '; show: time asString; show: 'ms'; cr. - - "Modified: / 10-05-2015 / 07:55:07 / Jan Vrany " -! - -tearDown - | parserClass | - super tearDown. - - parserClass := (Smalltalk at: #PPTokenizedSmalltalkGrammar ifAbsent: [nil]). - self flag: 'uncomment:'. -" - parserClass notNil ifTrue:[ - parserClass removeFromSystem - ]. -" -! ! - -!PPTokenizedSmalltalkGrammarResource class methodsFor:'documentation'! - -version_HG - - ^ '$Changeset: $' -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedSmalltalkGrammarTests.st --- a/compiler/tests/extras/PPTokenizedSmalltalkGrammarTests.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,935 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCompositeParserTest subclass:#PPTokenizedSmalltalkGrammarTests - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - -!PPTokenizedSmalltalkGrammarTests class methodsFor:'accessing'! - -resources - ^ (OrderedCollection with: PPTokenizedSmalltalkGrammarResource) - addAll: super resources; - yourself -! ! - -!PPTokenizedSmalltalkGrammarTests methodsFor:'accessing'! - -context - ^ PPCContext new -! - -parserClass - ^ Smalltalk at: #PPTokenizedSmalltalkGrammar -! - -parserInstanceFor: aSymbol - ^ (Smalltalk at: #PPTokenizedSmalltalkGrammar) new startSymbol: aSymbol -! - -testSmalltalkWhitespace - | whitespaces | - whitespaces := parser class methodDictionary keys select: [:e | e beginsWith: 'smalltalk_ws' ]. - self assert: whitespaces size = 1. -! ! - -!PPTokenizedSmalltalkGrammarTests methodsFor:'testing'! - -testArray1 - self - parse: '{}' - rule: #array -! - -testArray2 - self - parse: '{self foo}' - rule: #array -! - -testArray3 - self - parse: '{self foo. self bar}' - rule: #array -! - -testArray4 - self - parse: '{self foo. self bar.}' - rule: #array -! - -testAssignment1 - self - parse: '1' - rule: #expression -! - -testAssignment2 - self - parse: 'a := 1' - rule: #expression -! - -testAssignment3 - self - parse: 'a := b := 1' - rule: #expression -! - -testAssignment4 - PPSmalltalkGrammar allowUnderscoreAssignment - ifTrue: [ self parse: 'a _ 1' rule: #expression ] - ifFalse: [ self fail: 'a _ 1' rule: #expression ] -! - -testAssignment5 - PPSmalltalkGrammar allowUnderscoreAssignment - ifTrue: [ self parse: 'a _ b _ 1' rule: #expression ] - ifFalse: [ self fail: 'a _ b _ 1' rule: #expression ] -! - -testAssignment6 - self - parse: 'a := (b := c)' - rule: #expression -! - -testComment1 - self - parse: '1"one"+2' - rule: #expression -! - -testComment2 - self - parse: '1 "one" +2' - rule: #expression -! - -testComment3 - self - parse: '1"one"+"two"2' - rule: #expression -! - -testComment4 - self - parse: '1"one""two"+2' - rule: #expression -! - -testComment5 - self - parse: '1"one" "two"+2' - rule: #expression -! - -testCompleteness - "This test asserts that all subclasses override all test methods." - - self class allSubclasses do: [ :subclass | - self class testSelectors do: [ :selector | - self - assert: (selector = #testCompleteness or: [ subclass selectors includes: selector ]) - description: subclass printString , ' does not test ' , selector printString ] ] -! - -testMethod1 - self - parse: 'negated ^ 0 - self' - rule: #method -! - -testMethod2 - "Spaces at the beginning of the method." - self - parse: ' negated ^ 0 - self' - rule: #method -! - -testMethod3 - "Spaces at the end of the method." - self - parse: ' negated ^ 0 - self ' - rule: #method -! - -testMethod4 - self - parse: 'foo: bar - foo:= bar' - rule: #method -! - -testSequence1 - self - parse: '| a | 1 . 2' - rule: #sequence -! - -testStatements1 - self - parse: '1' - rule: #sequence -! - -testStatements2 - self - parse: '1 . 2' - rule: #sequence -! - -testStatements3 - self - parse: '1 . 2 . 3' - rule: #sequence -! - -testStatements4 - self - parse: '1 . 2 . 3 .' - rule: #sequence -! - -testStatements5 - self - parse: '1 . . 2' - rule: #sequence -! - -testStatements6 - self - parse: '1. 2' - rule: #sequence -! - -testStatements7 - self - parse: '. 1' - rule: #sequence -! - -testStatements8 - self - parse: '.1' - rule: #sequence -! - -testStatements9 - self - parse: '' - rule: #statements -! - -testTemporaries1 - self - parse: '| a |' - rule: #sequence -! - -testTemporaries2 - self - parse: '| a b |' - rule: #sequence -! - -testTemporaries3 - self - parse: '| a b c |' - rule: #sequence -! - -testVariable1 - self - parse: 'trueBinding' - rule: #primary -! - -testVariable2 - self - parse: 'falseBinding' - rule: #primary -! - -testVariable3 - self - parse: 'nilly' - rule: #primary -! - -testVariable4 - self - parse: 'selfish' - rule: #primary -! - -testVariable5 - self - parse: 'supernanny' - rule: #primary -! - -testVariable6 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: 'super_nanny' - rule: #primary ] -! - -testVariable7 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: '__gen_var_123__' - rule: #primary ] -! ! - -!PPTokenizedSmalltalkGrammarTests methodsFor:'testing-blocks'! - -testArgumentsBlock1 - self - parse: '[ :a | ]' - rule: #block -! - -testArgumentsBlock2 - self - parse: '[ :a :b | ]' - rule: #block -! - -testArgumentsBlock3 - self - parse: '[ :a :b :c | ]' - rule: #block -! - -testBlock1 - self - parse: '[]' - rule: #block -! - -testComplexBlock1 - self - parse: '[ :a | | b | c ]' - rule: #block -! - -testComplexBlock2 - self - parse: '[:a||b|c]' - rule: #block -! - -testSimpleBlock1 - self - parse: '[ ]' - rule: #block -! - -testSimpleBlock2 - self - parse: '[ nil ]' - rule: #block -! - -testSimpleBlock3 - self - parse: '[ :a ]' - rule: #block -! - -testStatementBlock1 - self - parse: '[ nil ]' - rule: #block -! - -testStatementBlock2 - self - parse: '[ | a | nil ]' - rule: #block -! - -testStatementBlock3 - self - parse: '[ | a b | nil ]' - rule: #block -! ! - -!PPTokenizedSmalltalkGrammarTests methodsFor:'testing-literals'! - -testArrayLiteral1 - self - parse: '#()' - rule: #arrayLiteral -! - -testArrayLiteral10 - self - parse: '#((1 2) #(1 2 3))' - rule: #arrayLiteral -! - -testArrayLiteral11 - self - parse: '#([1 2] #[1 2 3])' - rule: #arrayLiteral -! - -testArrayLiteral2 - self - parse: '#(1)' - rule: #arrayLiteral -! - -testArrayLiteral3 - self - parse: '#(1 2)' - rule: #arrayLiteral -! - -testArrayLiteral4 - self - parse: '#(true false nil)' - rule: #arrayLiteral -! - -testArrayLiteral5 - self - parse: '#($a)' - rule: #arrayLiteral -! - -testArrayLiteral6 - self - parse: '#(1.2)' - rule: #arrayLiteral -! - -testArrayLiteral7 - self - parse: '#(size #at: at:put: #''=='')' - rule: #arrayLiteral -! - -testArrayLiteral8 - self - parse: '#(''baz'')' - rule: #arrayLiteral -! - -testArrayLiteral9 - self - parse: '#((1) 2)' - rule: #arrayLiteral -! - -testByteLiteral1 - self - parse: '#[]' - rule: #byteLiteral -! - -testByteLiteral2 - self - parse: '#[0]' - rule: #byteLiteral -! - -testByteLiteral3 - self - parse: '#[255]' - rule: #byteLiteral -! - -testByteLiteral4 - self - parse: '#[ 1 2 ]' - rule: #byteLiteral -! - -testByteLiteral5 - self - parse: '#[ 2r1010 8r77 16rFF ]' - rule: #byteLiteral -! - -testCharLiteral1 - self - parse: '$a' - rule: #charLiteral -! - -testCharLiteral2 - self - parse: '$ ' - rule: #charLiteral -! - -testCharLiteral3 - self - parse: '$$' - rule: #charLiteral -! - -testNumberLiteral1 - self - parse: '0' - rule: #numberLiteral -! - -testNumberLiteral10 - self - parse: '10r10' - rule: #numberLiteral -! - -testNumberLiteral11 - self - parse: '8r777' - rule: #numberLiteral -! - -testNumberLiteral12 - self - parse: '16rAF' - rule: #numberLiteral -! - -testNumberLiteral13 - self - parse: '16rCA.FE' - rule: #numberLiteral -! - -testNumberLiteral14 - self - parse: '3r-22.2' - rule: #numberLiteral -! - -testNumberLiteral15 - self - parse: '0.50s2' - rule: #numberLiteral -! - -testNumberLiteral2 - self - parse: '0.1' - rule: #numberLiteral -! - -testNumberLiteral3 - self - parse: '123' - rule: #numberLiteral -! - -testNumberLiteral4 - self - parse: '123.456' - rule: #numberLiteral -! - -testNumberLiteral5 - self - parse: '-0' - rule: #numberLiteral -! - -testNumberLiteral6 - self - parse: '-0.1' - rule: #numberLiteral -! - -testNumberLiteral7 - self - parse: '-123' - rule: #numberLiteral -! - -testNumberLiteral8 - self - parse: '-125' - rule: #numberLiteral -! - -testNumberLiteral9 - self - parse: '-123.456' - rule: #numberLiteral -! - -testSpecialLiteral1 - self - parse: 'true' - rule: #trueLiteral -! - -testSpecialLiteral2 - self - parse: 'false' - rule: #falseLiteral -! - -testSpecialLiteral3 - self - parse: 'nil' - rule: #nilLiteral -! - -testStringLiteral1 - self - parse: '''''' - rule: #stringLiteral -! - -testStringLiteral2 - self - parse: '''ab''' - rule: #stringLiteral -! - -testStringLiteral3 - self - parse: '''ab''''cd''' - rule: #stringLiteral -! - -testSymbolLiteral1 - self - parse: '#foo' - rule: #symbolLiteral -! - -testSymbolLiteral2 - self - parse: '#+' - rule: #symbolLiteral -! - -testSymbolLiteral3 - self - parse: '#key:' - rule: #symbolLiteral -! - -testSymbolLiteral4 - self - parse: '#key:value:' - rule: #symbolLiteral -! - -testSymbolLiteral5 - self - parse: '#''testing-result''' - rule: #symbolLiteral -! - -testSymbolLiteral6 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: '#__gen__binding' - rule: #symbolLiteral ] -! - -testSymbolLiteral7 - self - parse: '# fucker' - rule: #symbolLiteral -! - -testSymbolLiteral8 - self - parse: '##fucker' - rule: #symbolLiteral -! - -testSymbolLiteral9 - self - parse: '## fucker' - rule: #symbolLiteral -! ! - -!PPTokenizedSmalltalkGrammarTests methodsFor:'testing-messages'! - -testBinaryExpression1 - self - parse: '1 + 2' - rule: #expression -! - -testBinaryExpression2 - self - parse: '1 + 2 + 3' - rule: #expression -! - -testBinaryExpression3 - self - parse: '1 // 2' - rule: #expression -! - -testBinaryExpression4 - self - parse: '1 -- 2' - rule: #expression -! - -testBinaryExpression5 - self - parse: '1 ==> 2' - rule: #expression. -! - -testBinaryMethod1 - self - parse: '+ a' - rule: #method -! - -testBinaryMethod2 - self - parse: '+ a | b |' - rule: #method -! - -testBinaryMethod3 - self - parse: '+ a b' - rule: #method -! - -testBinaryMethod4 - self - parse: '+ a | b | c' - rule: #method -! - -testBinaryMethod5 - self - parse: '-- a' - rule: #method -! - -testCascadeExpression1 - self - parse: '1 abs; negated' - rule: #expression -! - -testCascadeExpression2 - self - parse: '1 abs negated; raisedTo: 12; negated' - rule: #expression -! - -testCascadeExpression3 - self - parse: '1 + 2; - 3' - rule: #expression -! - -testIdentifierToken - self - parse: 'foo' - rule: #identifierToken -! - -testIdentifierToken2 - self - parse: ' foo' - rule: #identifierToken -! - -testKeywordExpression1 - self - parse: '1 to: 2' - rule: #expression -! - -testKeywordExpression2 - self - parse: '1 to: 2 by: 3' - rule: #expression -! - -testKeywordExpression3 - self - parse: '1 to: 2 by: 3 do: 4' - rule: #expression -! - -testKeywordMethod1 - self - parse: 'to: a' - rule: #method -! - -testKeywordMethod2 - self - parse: 'to: a do: b | c |' - rule: #method -! - -testKeywordMethod3 - self - parse: 'to: a do: b by: c d' - rule: #method -! - -testKeywordMethod4 - self - parse: 'to: a do: b by: c | d | e' - rule: #method -! - -testUnaryExpression1 - self - parse: '1 abs' - rule: #expression -! - -testUnaryExpression2 - self - parse: '1 abs negated' - rule: #expression -! - -testUnaryMethod1 - self - parse: 'abs' - rule: #method -! - -testUnaryMethod2 - self - parse: 'abs | a |' - rule: #method -! - -testUnaryMethod3 - self - parse: 'abs a' - rule: #method -! - -testUnaryMethod4 - self - parse: 'abs | a | b' - rule: #method -! - -testUnaryMethod5 - self - parse: 'abs | a |' - rule: #method -! ! - -!PPTokenizedSmalltalkGrammarTests methodsFor:'testing-pragmas'! - -testPragma1 - self - parse: 'method ' - rule: #method -! - -testPragma10 - self - parse: 'method ' - rule: #method -! - -testPragma11 - self - parse: 'method ' - rule: #method -! - -testPragma12 - self - parse: 'method ' - rule: #method -! - -testPragma13 - self - parse: 'method ' - rule: #method -! - -testPragma14 - self - parse: 'method ' - rule: #method -! - -testPragma15 - self - parse: 'method ' - rule: #method -! - -testPragma16 - self - parse: 'method < + 1 >' - rule: #method -! - -testPragma2 - self - parse: 'method ' - rule: #method -! - -testPragma3 - self - parse: 'method | a | ' - rule: #method -! - -testPragma4 - self - parse: 'method | a |' - rule: #method -! - -testPragma5 - self - parse: 'method | a | ' - rule: #method -! - -testPragma6 - self - parse: 'method ' - rule: #method -! - -testPragma7 - self - parse: 'method ' - rule: #method -! - -testPragma8 - self - parse: 'method ' - rule: #method -! - -testPragma9 - self - parse: 'method ' - rule: #method -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedSmalltalkParserResource.st --- a/compiler/tests/extras/PPTokenizedSmalltalkParserResource.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -TestResource subclass:#PPTokenizedSmalltalkParserResource - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - -!PPTokenizedSmalltalkParserResource methodsFor:'as yet unclassified'! - -setUp - | time configuration | - configuration := PPCConfiguration tokenizing. - configuration arguments parserName:#PPTokenizedSmalltalkParser. - - time := Time millisecondsToRun: [ - PPSmalltalkParser new compileWithConfiguration: configuration. - ]. - Transcript show: 'Smalltalk Parser tokenized in: '; show: time asString; show: 'ms'; cr. - - "Modified: / 10-05-2015 / 07:55:07 / Jan Vrany " -! - -tearDown - | parserClass | - super tearDown. - - parserClass := (Smalltalk at: #PPTokenizedSmalltalkParser ifAbsent: [nil]). - self flag: 'uncomment:'. -" - parserClass notNil ifTrue:[ - parserClass removeFromSystem - ]. -" -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedSmalltalkParserTests.st --- a/compiler/tests/extras/PPTokenizedSmalltalkParserTests.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,935 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCompositeParserTest subclass:#PPTokenizedSmalltalkParserTests - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - -!PPTokenizedSmalltalkParserTests class methodsFor:'accessing'! - -resources - ^ (OrderedCollection with: PPTokenizedSmalltalkParserResource) - addAll: super resources; - yourself -! ! - -!PPTokenizedSmalltalkParserTests methodsFor:'accessing'! - -context - ^ PPCContext new -! - -parserClass - ^ Smalltalk at: #PPTokenizedSmalltalkParser -! - -parserInstanceFor: aSymbol - ^ (Smalltalk at: #PPTokenizedSmalltalkParser) new startSymbol: aSymbol -! - -testSmalltalkWhitespace - | whitespaces | - whitespaces := parser class methodDictionary keys select: [:e | e beginsWith: 'smalltalk_ws' ]. - self assert: whitespaces size = 1. -! ! - -!PPTokenizedSmalltalkParserTests methodsFor:'testing'! - -testArray1 - self - parse: '{}' - rule: #array -! - -testArray2 - self - parse: '{self foo}' - rule: #array -! - -testArray3 - self - parse: '{self foo. self bar}' - rule: #array -! - -testArray4 - self - parse: '{self foo. self bar.}' - rule: #array -! - -testAssignment1 - self - parse: '1' - rule: #expression -! - -testAssignment2 - self - parse: 'a := 1' - rule: #expression -! - -testAssignment3 - self - parse: 'a := b := 1' - rule: #expression -! - -testAssignment4 - PPSmalltalkGrammar allowUnderscoreAssignment - ifTrue: [ self parse: 'a _ 1' rule: #expression ] - ifFalse: [ self fail: 'a _ 1' rule: #expression ] -! - -testAssignment5 - PPSmalltalkGrammar allowUnderscoreAssignment - ifTrue: [ self parse: 'a _ b _ 1' rule: #expression ] - ifFalse: [ self fail: 'a _ b _ 1' rule: #expression ] -! - -testAssignment6 - self - parse: 'a := (b := c)' - rule: #expression -! - -testComment1 - self - parse: '1"one"+2' - rule: #expression -! - -testComment2 - self - parse: '1 "one" +2' - rule: #expression -! - -testComment3 - self - parse: '1"one"+"two"2' - rule: #expression -! - -testComment4 - self - parse: '1"one""two"+2' - rule: #expression -! - -testComment5 - self - parse: '1"one" "two"+2' - rule: #expression -! - -testCompleteness - "This test asserts that all subclasses override all test methods." - - self class allSubclasses do: [ :subclass | - self class testSelectors do: [ :selector | - self - assert: (selector = #testCompleteness or: [ subclass selectors includes: selector ]) - description: subclass printString , ' does not test ' , selector printString ] ] -! - -testMethod1 - self - parse: 'negated ^ 0 - self' - rule: #method -! - -testMethod2 - "Spaces at the beginning of the method." - self - parse: ' negated ^ 0 - self' - rule: #method -! - -testMethod3 - "Spaces at the end of the method." - self - parse: ' negated ^ 0 - self ' - rule: #method -! - -testMethod4 - self - parse: 'foo: bar - foo:= bar' - rule: #method -! - -testSequence1 - self - parse: '| a | 1 . 2' - rule: #sequence -! - -testStatements1 - self - parse: '1' - rule: #sequence -! - -testStatements2 - self - parse: '1 . 2' - rule: #sequence -! - -testStatements3 - self - parse: '1 . 2 . 3' - rule: #sequence -! - -testStatements4 - self - parse: '1 . 2 . 3 .' - rule: #sequence -! - -testStatements5 - self - parse: '1 . . 2' - rule: #sequence -! - -testStatements6 - self - parse: '1. 2' - rule: #sequence -! - -testStatements7 - self - parse: '. 1' - rule: #sequence -! - -testStatements8 - self - parse: '.1' - rule: #sequence -! - -testStatements9 - self - parse: '' - rule: #statements -! - -testTemporaries1 - self - parse: '| a |' - rule: #sequence -! - -testTemporaries2 - self - parse: '| a b |' - rule: #sequence -! - -testTemporaries3 - self - parse: '| a b c |' - rule: #sequence -! - -testVariable1 - self - parse: 'trueBinding' - rule: #primary -! - -testVariable2 - self - parse: 'falseBinding' - rule: #primary -! - -testVariable3 - self - parse: 'nilly' - rule: #primary -! - -testVariable4 - self - parse: 'selfish' - rule: #primary -! - -testVariable5 - self - parse: 'supernanny' - rule: #primary -! - -testVariable6 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: 'super_nanny' - rule: #primary ] -! - -testVariable7 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: '__gen_var_123__' - rule: #primary ] -! ! - -!PPTokenizedSmalltalkParserTests methodsFor:'testing-blocks'! - -testArgumentsBlock1 - self - parse: '[ :a | ]' - rule: #block -! - -testArgumentsBlock2 - self - parse: '[ :a :b | ]' - rule: #block -! - -testArgumentsBlock3 - self - parse: '[ :a :b :c | ]' - rule: #block -! - -testBlock1 - self - parse: '[]' - rule: #block -! - -testComplexBlock1 - self - parse: '[ :a | | b | c ]' - rule: #block -! - -testComplexBlock2 - self - parse: '[:a||b|c]' - rule: #block -! - -testSimpleBlock1 - self - parse: '[ ]' - rule: #block -! - -testSimpleBlock2 - self - parse: '[ nil ]' - rule: #block -! - -testSimpleBlock3 - self - parse: '[ :a ]' - rule: #block -! - -testStatementBlock1 - self - parse: '[ nil ]' - rule: #block -! - -testStatementBlock2 - self - parse: '[ | a | nil ]' - rule: #block -! - -testStatementBlock3 - self - parse: '[ | a b | nil ]' - rule: #block -! ! - -!PPTokenizedSmalltalkParserTests methodsFor:'testing-literals'! - -testArrayLiteral1 - self - parse: '#()' - rule: #arrayLiteral -! - -testArrayLiteral10 - self - parse: '#((1 2) #(1 2 3))' - rule: #arrayLiteral -! - -testArrayLiteral11 - self - parse: '#([1 2] #[1 2 3])' - rule: #arrayLiteral -! - -testArrayLiteral2 - self - parse: '#(1)' - rule: #arrayLiteral -! - -testArrayLiteral3 - self - parse: '#(1 2)' - rule: #arrayLiteral -! - -testArrayLiteral4 - self - parse: '#(true false nil)' - rule: #arrayLiteral -! - -testArrayLiteral5 - self - parse: '#($a)' - rule: #arrayLiteral -! - -testArrayLiteral6 - self - parse: '#(1.2)' - rule: #arrayLiteral -! - -testArrayLiteral7 - self - parse: '#(size #at: at:put: #''=='')' - rule: #arrayLiteral -! - -testArrayLiteral8 - self - parse: '#(''baz'')' - rule: #arrayLiteral -! - -testArrayLiteral9 - self - parse: '#((1) 2)' - rule: #arrayLiteral -! - -testByteLiteral1 - self - parse: '#[]' - rule: #byteLiteral -! - -testByteLiteral2 - self - parse: '#[0]' - rule: #byteLiteral -! - -testByteLiteral3 - self - parse: '#[255]' - rule: #byteLiteral -! - -testByteLiteral4 - self - parse: '#[ 1 2 ]' - rule: #byteLiteral -! - -testByteLiteral5 - self - parse: '#[ 2r1010 8r77 16rFF ]' - rule: #byteLiteral -! - -testCharLiteral1 - self - parse: '$a' - rule: #charLiteral -! - -testCharLiteral2 - self - parse: '$ ' - rule: #charLiteral -! - -testCharLiteral3 - self - parse: '$$' - rule: #charLiteral -! - -testNumberLiteral1 - self - parse: '0' - rule: #numberLiteral -! - -testNumberLiteral10 - self - parse: '10r10' - rule: #numberLiteral -! - -testNumberLiteral11 - self - parse: '8r777' - rule: #numberLiteral -! - -testNumberLiteral12 - self - parse: '16rAF' - rule: #numberLiteral -! - -testNumberLiteral13 - self - parse: '16rCA.FE' - rule: #numberLiteral -! - -testNumberLiteral14 - self - parse: '3r-22.2' - rule: #numberLiteral -! - -testNumberLiteral15 - self - parse: '0.50s2' - rule: #numberLiteral -! - -testNumberLiteral2 - self - parse: '0.1' - rule: #numberLiteral -! - -testNumberLiteral3 - self - parse: '123' - rule: #numberLiteral -! - -testNumberLiteral4 - self - parse: '123.456' - rule: #numberLiteral -! - -testNumberLiteral5 - self - parse: '-0' - rule: #numberLiteral -! - -testNumberLiteral6 - self - parse: '-0.1' - rule: #numberLiteral -! - -testNumberLiteral7 - self - parse: '-123' - rule: #numberLiteral -! - -testNumberLiteral8 - self - parse: '-125' - rule: #numberLiteral -! - -testNumberLiteral9 - self - parse: '-123.456' - rule: #numberLiteral -! - -testSpecialLiteral1 - self - parse: 'true' - rule: #trueLiteral -! - -testSpecialLiteral2 - self - parse: 'false' - rule: #falseLiteral -! - -testSpecialLiteral3 - self - parse: 'nil' - rule: #nilLiteral -! - -testStringLiteral1 - self - parse: '''''' - rule: #stringLiteral -! - -testStringLiteral2 - self - parse: '''ab''' - rule: #stringLiteral -! - -testStringLiteral3 - self - parse: '''ab''''cd''' - rule: #stringLiteral -! - -testSymbolLiteral1 - self - parse: '#foo' - rule: #symbolLiteral -! - -testSymbolLiteral2 - self - parse: '#+' - rule: #symbolLiteral -! - -testSymbolLiteral3 - self - parse: '#key:' - rule: #symbolLiteral -! - -testSymbolLiteral4 - self - parse: '#key:value:' - rule: #symbolLiteral -! - -testSymbolLiteral5 - self - parse: '#''testing-result''' - rule: #symbolLiteral -! - -testSymbolLiteral6 - PPSmalltalkGrammar allowUnderscoreAssignment ifFalse: [ - self - parse: '#__gen__binding' - rule: #symbolLiteral ] -! - -testSymbolLiteral7 - self - parse: '# fucker' - rule: #symbolLiteral -! - -testSymbolLiteral8 - self - parse: '##fucker' - rule: #symbolLiteral -! - -testSymbolLiteral9 - self - parse: '## fucker' - rule: #symbolLiteral -! ! - -!PPTokenizedSmalltalkParserTests methodsFor:'testing-messages'! - -testBinaryExpression1 - self - parse: '1 + 2' - rule: #expression -! - -testBinaryExpression2 - self - parse: '1 + 2 + 3' - rule: #expression -! - -testBinaryExpression3 - self - parse: '1 // 2' - rule: #expression -! - -testBinaryExpression4 - self - parse: '1 -- 2' - rule: #expression -! - -testBinaryExpression5 - self - parse: '1 ==> 2' - rule: #expression. -! - -testBinaryMethod1 - self - parse: '+ a' - rule: #method -! - -testBinaryMethod2 - self - parse: '+ a | b |' - rule: #method -! - -testBinaryMethod3 - self - parse: '+ a b' - rule: #method -! - -testBinaryMethod4 - self - parse: '+ a | b | c' - rule: #method -! - -testBinaryMethod5 - self - parse: '-- a' - rule: #method -! - -testCascadeExpression1 - self - parse: '1 abs; negated' - rule: #expression -! - -testCascadeExpression2 - self - parse: '1 abs negated; raisedTo: 12; negated' - rule: #expression -! - -testCascadeExpression3 - self - parse: '1 + 2; - 3' - rule: #expression -! - -testIdentifierToken - self - parse: 'foo' - rule: #identifierToken -! - -testIdentifierToken2 - self - parse: ' foo' - rule: #identifierToken -! - -testKeywordExpression1 - self - parse: '1 to: 2' - rule: #expression -! - -testKeywordExpression2 - self - parse: '1 to: 2 by: 3' - rule: #expression -! - -testKeywordExpression3 - self - parse: '1 to: 2 by: 3 do: 4' - rule: #expression -! - -testKeywordMethod1 - self - parse: 'to: a' - rule: #method -! - -testKeywordMethod2 - self - parse: 'to: a do: b | c |' - rule: #method -! - -testKeywordMethod3 - self - parse: 'to: a do: b by: c d' - rule: #method -! - -testKeywordMethod4 - self - parse: 'to: a do: b by: c | d | e' - rule: #method -! - -testUnaryExpression1 - self - parse: '1 abs' - rule: #expression -! - -testUnaryExpression2 - self - parse: '1 abs negated' - rule: #expression -! - -testUnaryMethod1 - self - parse: 'abs' - rule: #method -! - -testUnaryMethod2 - self - parse: 'abs | a |' - rule: #method -! - -testUnaryMethod3 - self - parse: 'abs a' - rule: #method -! - -testUnaryMethod4 - self - parse: 'abs | a | b' - rule: #method -! - -testUnaryMethod5 - self - parse: 'abs | a |' - rule: #method -! ! - -!PPTokenizedSmalltalkParserTests methodsFor:'testing-pragmas'! - -testPragma1 - self - parse: 'method ' - rule: #method -! - -testPragma10 - self - parse: 'method ' - rule: #method -! - -testPragma11 - self - parse: 'method ' - rule: #method -! - -testPragma12 - self - parse: 'method ' - rule: #method -! - -testPragma13 - self - parse: 'method ' - rule: #method -! - -testPragma14 - self - parse: 'method ' - rule: #method -! - -testPragma15 - self - parse: 'method ' - rule: #method -! - -testPragma16 - self - parse: 'method < + 1 >' - rule: #method -! - -testPragma2 - self - parse: 'method ' - rule: #method -! - -testPragma3 - self - parse: 'method | a | ' - rule: #method -! - -testPragma4 - self - parse: 'method | a |' - rule: #method -! - -testPragma5 - self - parse: 'method | a | ' - rule: #method -! - -testPragma6 - self - parse: 'method ' - rule: #method -! - -testPragma7 - self - parse: 'method ' - rule: #method -! - -testPragma8 - self - parse: 'method ' - rule: #method -! - -testPragma9 - self - parse: 'method ' - rule: #method -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedSmalltalkParserVerificationTest.st --- a/compiler/tests/extras/PPTokenizedSmalltalkParserVerificationTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCSmalltalkVerificationTest subclass:#PPTokenizedSmalltalkParserVerificationTest - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - -!PPTokenizedSmalltalkParserVerificationTest class methodsFor:'as yet unclassified'! - -resources - ^ (OrderedCollection with: PPTokenizedSmalltalkParserResource) - addAll: super resources; - yourself -! ! - -!PPTokenizedSmalltalkParserVerificationTest methodsFor:'accessing'! - -compiledSmalltalkGrammarClass - ^ (Smalltalk at: #PPTokenizedSmalltalkParser) -! ! - -!PPTokenizedSmalltalkParserVerificationTest methodsFor:'tests'! - -testSmalltalk - super testSmalltalk -! - -testSmalltalkClass - super testSmalltalkClass -! - -testSmalltalkObject - super testSmalltalkObject -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/PPTokenizedSmalltalkVerificationTest.st --- a/compiler/tests/extras/PPTokenizedSmalltalkVerificationTest.st Fri Jul 31 08:22:18 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }" - -"{ NameSpace: Smalltalk }" - -PPCSmalltalkVerificationTest subclass:#PPTokenizedSmalltalkVerificationTest - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'PetitCompiler-Extras-Tests-Smalltalk' -! - - -!PPTokenizedSmalltalkVerificationTest class methodsFor:'as yet unclassified'! - -resources - ^ (OrderedCollection with: PPTokenizedSmalltalkGrammarResource) - addAll: super resources; - yourself -! ! - -!PPTokenizedSmalltalkVerificationTest methodsFor:'accessing'! - -compiledSmalltalkGrammarClass - ^ (Smalltalk at: #PPTokenizedSmalltalkGrammar) -! ! - -!PPTokenizedSmalltalkVerificationTest methodsFor:'tests'! - -testSmalltalk - super testSmalltalk -! - -testSmalltalkClass - super testSmalltalkClass -! - -testSmalltalkObject - super testSmalltalkObject -! ! - -!PPTokenizedSmalltalkVerificationTest class methodsFor:'documentation'! - -version_HG - - ^ '$Changeset: $' -! ! - diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/abbrev.stc --- a/compiler/tests/extras/abbrev.stc Fri Jul 31 08:22:18 2015 +0100 +++ b/compiler/tests/extras/abbrev.stc Thu Jul 30 08:37:37 2015 +0100 @@ -1,34 +1,37 @@ # automagically generated by the project definition # this file is needed for stc to be able to compile modules independently. # it provides information about a classes filename, category and especially namespace. +PPCAbstractParserTest PPCAbstractParserTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 1 PPCCompiledJavaVerificationTest PPCCompiledJavaVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1 -PPCExpressionsVerificationTest PPCExpressionsVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 +PPCCompositeParserTest PPCCompositeParserTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 1 PPCResources PPCResources stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 1 +PPCSetUpBeforeTearDownAfterResource PPCSetUpBeforeTearDownAfterResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Support' 2 +PPCSmalltalkGrammarTests PPCSmalltalkGrammarTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCSmalltalkParserTests PPCSmalltalkParserTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 PPCSmalltalkTests PPCSmalltalkTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPCSmalltalkVerificationTest PPCSmalltalkVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPCompiledExpressionGrammarResource PPCompiledExpressionGrammarResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 -PPCompiledExpressionGrammarTest PPCompiledExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 PPCompiledJavaResource PPCompiledJavaResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1 PPCompiledJavaSyntaxTest PPCompiledJavaSyntaxTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Java' 1 -PPCompiledSmalltalkGrammarResource PPCompiledSmalltalkGrammarResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPCompiledSmalltalkGrammarTests PPCompiledSmalltalkGrammarTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPCompiledSmalltalkParserResource PPCompiledSmalltalkParserResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPCompiledSmalltalkParserTests PPCompiledSmalltalkParserTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 PPExpressionGrammar PPExpressionGrammar stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 0 PPExpressionGrammarTest PPExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 PPLL1ExpressionGrammar PPLL1ExpressionGrammar stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 0 PPLL1ExpressionGrammarTest PPLL1ExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 -PPTokenizedExpressionGrammarResource PPTokenizedExpressionGrammarResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 -PPTokenizedExpressionGrammarTest PPTokenizedExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 -PPTokenizedLL1ExpressionGrammarResource PPTokenizedLL1ExpressionGrammarResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 -PPTokenizedLL1ExpressionGrammarTest PPTokenizedLL1ExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 -PPTokenizedSmalltalkGrammarResource PPTokenizedSmalltalkGrammarResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPTokenizedSmalltalkGrammarTests PPTokenizedSmalltalkGrammarTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPTokenizedSmalltalkParserResource PPTokenizedSmalltalkParserResource stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPTokenizedSmalltalkParserTests PPTokenizedSmalltalkParserTests stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 stx_goodies_petitparser_compiler_tests_extras stx_goodies_petitparser_compiler_tests_extras stx:goodies/petitparser/compiler/tests/extras '* Projects & Packages *' 3 -PPCompiledExpressionsVerificationTest PPCompiledExpressionsVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 -PPCompiledSmalltalkVerificationTest PPCompiledSmalltalkVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPTokenizedExpressionsVerificationTest PPTokenizedExpressionsVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 -PPTokenizedSmalltalkParserVerificationTest PPTokenizedSmalltalkParserVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 -PPTokenizedSmalltalkVerificationTest PPTokenizedSmalltalkVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCExpressionGrammarTest PPCExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 +PPCExpressionGrammarVerificationTest PPCExpressionGrammarVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 +PPCLL1ExpressionGrammarTest PPCLL1ExpressionGrammarTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 +PPCSmalltalkGrammarTests_Tokenized PPCSmalltalkGrammarTests_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCSmalltalkGrammarTests_Universal PPCSmalltalkGrammarTests_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCSmalltalkGrammarVerificationTest PPCSmalltalkGrammarVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCSmalltalkParserTests_Tokenized PPCSmalltalkParserTests_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCSmalltalkParserTests_Universal PPCSmalltalkParserTests_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCSmalltalkParserVerificationTest PPCSmalltalkParserVerificationTest stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCExpressionGrammarTest_Tokenized PPCExpressionGrammarTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 +PPCExpressionGrammarTest_Universal PPCExpressionGrammarTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 +PPCLL1ExpressionGrammarTest_Tokenized PPCLL1ExpressionGrammarTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 +PPCLL1ExpressionGrammarTest_Universal PPCLL1ExpressionGrammarTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 +PPCSmalltalkGrammarVerificationTest_Tokenized PPCSmalltalkGrammarVerificationTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCSmalltalkGrammarVerificationTest_Universal PPCSmalltalkGrammarVerificationTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCSmalltalkParserVerificationTest_Tokenized PPCSmalltalkParserVerificationTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPCSmalltalkParserVerificationTest_Universal PPCSmalltalkParserVerificationTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Smalltalk' 1 +PPExpressionGrammarVerificationTest_Tokenized PPExpressionGrammarVerificationTest_Tokenized stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 +PPExpressionGrammarVerificationTest_Universal PPExpressionGrammarVerificationTest_Universal stx:goodies/petitparser/compiler/tests/extras 'PetitCompiler-Extras-Tests-Expressions' 1 diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/bc.mak --- a/compiler/tests/extras/bc.mak Fri Jul 31 08:22:18 2015 +0100 +++ b/compiler/tests/extras/bc.mak Thu Jul 30 08:37:37 2015 +0100 @@ -35,7 +35,7 @@ -LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\goodies\petitparser\compiler -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\java -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk -I$(INCLUDE_TOP)\stx\goodies\petitparser\tests -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2 +LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\petitparser -I$(INCLUDE_TOP)\stx\goodies\petitparser\compiler -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\java -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk -I$(INCLUDE_TOP)\stx\goodies\petitparser\parsers\smalltalk\tests -I$(INCLUDE_TOP)\stx\goodies\petitparser\tests -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2 LOCALDEFINES= STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -varPrefix=$(LIBNAME) @@ -59,6 +59,7 @@ pushd ..\..\..\..\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) " pushd ..\..\..\tests & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) " pushd ..\..\..\parsers\java & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) " + pushd ..\..\..\parsers\smalltalk\tests & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) " @@ -75,31 +76,7 @@ # BEGINMAKEDEPEND --- do not remove this line; make depend needs it -$(OUTDIR)PPCCompiledJavaVerificationTest.$(O) PPCCompiledJavaVerificationTest.$(H): PPCCompiledJavaVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCExpressionsVerificationTest.$(O) PPCExpressionsVerificationTest.$(H): PPCExpressionsVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCResources.$(O) PPCResources.$(H): PPCResources.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCSmalltalkTests.$(O) PPCSmalltalkTests.$(H): PPCSmalltalkTests.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCSmalltalkVerificationTest.$(O) PPCSmalltalkVerificationTest.$(H): PPCSmalltalkVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledExpressionGrammarResource.$(O) PPCompiledExpressionGrammarResource.$(H): PPCompiledExpressionGrammarResource.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledExpressionGrammarTest.$(O) PPCompiledExpressionGrammarTest.$(H): PPCompiledExpressionGrammarTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPCompositeParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledJavaResource.$(O) PPCompiledJavaResource.$(H): PPCompiledJavaResource.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledSmalltalkGrammarResource.$(O) PPCompiledSmalltalkGrammarResource.$(H): PPCompiledSmalltalkGrammarResource.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledSmalltalkGrammarTests.$(O) PPCompiledSmalltalkGrammarTests.$(H): PPCompiledSmalltalkGrammarTests.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPCompositeParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPExpressionGrammar.$(O) PPExpressionGrammar.$(H): PPExpressionGrammar.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPCompositeParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPExpressionGrammarTest.$(O) PPExpressionGrammarTest.$(H): PPExpressionGrammarTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPCompositeParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPLL1ExpressionGrammar.$(O) PPLL1ExpressionGrammar.$(H): PPLL1ExpressionGrammar.st $(INCLUDE_TOP)\stx\goodies\petitparser\PPCompositeParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPDelegateParser.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\PPParser.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPLL1ExpressionGrammarTest.$(O) PPLL1ExpressionGrammarTest.$(H): PPLL1ExpressionGrammarTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPCompositeParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedExpressionGrammarResource.$(O) PPTokenizedExpressionGrammarResource.$(H): PPTokenizedExpressionGrammarResource.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedExpressionGrammarTest.$(O) PPTokenizedExpressionGrammarTest.$(H): PPTokenizedExpressionGrammarTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPCompositeParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedLL1ExpressionGrammarResource.$(O) PPTokenizedLL1ExpressionGrammarResource.$(H): PPTokenizedLL1ExpressionGrammarResource.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedLL1ExpressionGrammarTest.$(O) PPTokenizedLL1ExpressionGrammarTest.$(H): PPTokenizedLL1ExpressionGrammarTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPCompositeParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedSmalltalkGrammarResource.$(O) PPTokenizedSmalltalkGrammarResource.$(H): PPTokenizedSmalltalkGrammarResource.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedSmalltalkGrammarTests.$(O) PPTokenizedSmalltalkGrammarTests.$(H): PPTokenizedSmalltalkGrammarTests.st $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPCompositeParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)stx_goodies_petitparser_compiler_tests_extras.$(O) stx_goodies_petitparser_compiler_tests_extras.$(H): stx_goodies_petitparser_compiler_tests_extras.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR) -$(OUTDIR)PPCompiledExpressionsVerificationTest.$(O) PPCompiledExpressionsVerificationTest.$(H): PPCompiledExpressionsVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\compiler\tests\extras\PPCExpressionsVerificationTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPCompiledSmalltalkVerificationTest.$(O) PPCompiledSmalltalkVerificationTest.$(H): PPCompiledSmalltalkVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\compiler\tests\extras\PPCSmalltalkVerificationTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedExpressionsVerificationTest.$(O) PPTokenizedExpressionsVerificationTest.$(H): PPTokenizedExpressionsVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\compiler\tests\extras\PPCExpressionsVerificationTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) -$(OUTDIR)PPTokenizedSmalltalkVerificationTest.$(O) PPTokenizedSmalltalkVerificationTest.$(H): PPTokenizedSmalltalkVerificationTest.st $(INCLUDE_TOP)\stx\goodies\petitparser\compiler\tests\extras\PPCSmalltalkVerificationTest.$(H) $(INCLUDE_TOP)\stx\goodies\petitparser\tests\PPAbstractParserTest.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) +$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestResource.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR) # ENDMAKEDEPEND --- do not remove this line diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/extensions.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compiler/tests/extras/extensions.st Thu Jul 30 08:37:37 2015 +0100 @@ -0,0 +1,16 @@ +"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }"! + +!TestResource class methodsFor:'running'! + +availableFor: aTestAsserter + aTestAsserter + assert: self isAvailable + description: 'Unavailable resource ' , self name , ' requested by ', aTestAsserter printString. +! ! + +!stx_goodies_petitparser_compiler_tests_extras class methodsFor:'documentation'! + +extensionsVersion_HG + + ^ '$Changeset: $' +! ! diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/libInit.cc --- a/compiler/tests/extras/libInit.cc Fri Jul 31 08:22:18 2015 +0100 +++ b/compiler/tests/extras/libInit.cc Thu Jul 30 08:37:37 2015 +0100 @@ -27,32 +27,7 @@ void _libstx_goodies_petitparser_compiler_tests_extras_Init(pass, __pRT__, snd) OBJ snd; struct __vmData__ *__pRT__; { __BEGIN_PACKAGE2__("libstx_goodies_petitparser_compiler_tests_extras", _libstx_goodies_petitparser_compiler_tests_extras_Init, "stx:goodies/petitparser/compiler/tests/extras"); -_PPCCompiledJavaVerificationTest_Init(pass,__pRT__,snd); -_PPCExpressionsVerificationTest_Init(pass,__pRT__,snd); -_PPCResources_Init(pass,__pRT__,snd); -_PPCSmalltalkTests_Init(pass,__pRT__,snd); -_PPCSmalltalkVerificationTest_Init(pass,__pRT__,snd); -_PPCompiledExpressionGrammarResource_Init(pass,__pRT__,snd); -_PPCompiledExpressionGrammarTest_Init(pass,__pRT__,snd); -_PPCompiledJavaResource_Init(pass,__pRT__,snd); -_PPCompiledSmalltalkGrammarResource_Init(pass,__pRT__,snd); -_PPCompiledSmalltalkGrammarTests_Init(pass,__pRT__,snd); -_PPExpressionGrammar_Init(pass,__pRT__,snd); -_PPExpressionGrammarTest_Init(pass,__pRT__,snd); -_PPLL1ExpressionGrammar_Init(pass,__pRT__,snd); -_PPLL1ExpressionGrammarTest_Init(pass,__pRT__,snd); -_PPTokenizedExpressionGrammarResource_Init(pass,__pRT__,snd); -_PPTokenizedExpressionGrammarTest_Init(pass,__pRT__,snd); -_PPTokenizedLL1ExpressionGrammarResource_Init(pass,__pRT__,snd); -_PPTokenizedLL1ExpressionGrammarTest_Init(pass,__pRT__,snd); -_PPTokenizedSmalltalkGrammarResource_Init(pass,__pRT__,snd); -_PPTokenizedSmalltalkGrammarTests_Init(pass,__pRT__,snd); -_stx_137goodies_137petitparser_137compiler_137tests_137extras_Init(pass,__pRT__,snd); -_PPCompiledExpressionsVerificationTest_Init(pass,__pRT__,snd); -_PPCompiledSmalltalkVerificationTest_Init(pass,__pRT__,snd); -_PPTokenizedExpressionsVerificationTest_Init(pass,__pRT__,snd); -_PPTokenizedSmalltalkVerificationTest_Init(pass,__pRT__,snd); - +_stx_137goodies_137petitparser_137compiler_137tests_137extras_extensions_Init(pass,__pRT__,snd); __END_PACKAGE__(); } diff -r fd22630c7e62 -r 869853decf31 compiler/tests/extras/stx_goodies_petitparser_compiler_tests_extras.st --- a/compiler/tests/extras/stx_goodies_petitparser_compiler_tests_extras.st Fri Jul 31 08:22:18 2015 +0100 +++ b/compiler/tests/extras/stx_goodies_petitparser_compiler_tests_extras.st Thu Jul 30 08:37:37 2015 +0100 @@ -85,8 +85,9 @@ ^ #( #'stx:goodies/petitparser' "PPCompositeParser - superclass of PPExpressionGrammar" #'stx:goodies/petitparser/parsers/java' "PPJavaLexiconTest - superclass of PPCompiledJavaSyntaxTest" - #'stx:goodies/petitparser/tests' "PPAbstractParserTest - superclass of PPCCompiledJavaVerificationTest" - #'stx:goodies/sunit' "TestAsserter - superclass of PPCCompiledJavaVerificationTest" + #'stx:goodies/petitparser/parsers/smalltalk/tests' "PPSmalltalkGrammarTests - superclass of PPCSmalltalkGrammarTests" + #'stx:goodies/petitparser/tests' "PPAbstractParserTest - superclass of PPCAbstractParserTest" + #'stx:goodies/sunit' "TestAsserter - extended" #'stx:libbasic' "LibraryDefinition - superclass of stx_goodies_petitparser_compiler_tests_extras" ) ! @@ -103,7 +104,7 @@ ^ #( #'stx:goodies/petitparser/compiler' "PPCArguments - referenced by PPCSmalltalkTests>>setUp" - #'stx:goodies/petitparser/parsers/smalltalk' "PPSmalltalkGrammar - referenced by PPCSmalltalkVerificationTest>>smalltalkGrammar" + #'stx:goodies/petitparser/parsers/smalltalk' "PPSmalltalkGrammar - referenced by PPCSmalltalkGrammarTests>>petitParserClass" #'stx:libbasic2' "Random - referenced by PPCResources>>expressionOfSize:stream:" ) ! @@ -128,37 +129,40 @@ ^ #( " or ( attributes...) in load order" - PPCCompiledJavaVerificationTest - PPCExpressionsVerificationTest - PPCResources - PPCSmalltalkTests - PPCSmalltalkVerificationTest - PPCompiledExpressionGrammarResource - PPCompiledExpressionGrammarTest - PPCompiledJavaResource + (PPCAbstractParserTest autoload) + (PPCCompiledJavaVerificationTest autoload) + (PPCCompositeParserTest autoload) + (PPCResources autoload) + (PPCSetUpBeforeTearDownAfterResource autoload) + (PPCSmalltalkGrammarTests autoload) + (PPCSmalltalkParserTests autoload) + (PPCSmalltalkTests autoload) + (PPCompiledJavaResource autoload) (PPCompiledJavaSyntaxTest autoload) - PPCompiledSmalltalkGrammarResource - PPCompiledSmalltalkGrammarTests - (PPCompiledSmalltalkParserResource autoload) - (PPCompiledSmalltalkParserTests autoload) - PPExpressionGrammar - PPExpressionGrammarTest - PPLL1ExpressionGrammar - PPLL1ExpressionGrammarTest - PPTokenizedExpressionGrammarResource - PPTokenizedExpressionGrammarTest - PPTokenizedLL1ExpressionGrammarResource - PPTokenizedLL1ExpressionGrammarTest - PPTokenizedSmalltalkGrammarResource - PPTokenizedSmalltalkGrammarTests - (PPTokenizedSmalltalkParserResource autoload) - (PPTokenizedSmalltalkParserTests autoload) - #'stx_goodies_petitparser_compiler_tests_extras' - PPCompiledExpressionsVerificationTest - PPCompiledSmalltalkVerificationTest - PPTokenizedExpressionsVerificationTest - (PPTokenizedSmalltalkParserVerificationTest autoload) - PPTokenizedSmalltalkVerificationTest + (PPExpressionGrammar autoload) + (PPExpressionGrammarTest autoload) + (PPLL1ExpressionGrammar autoload) + (PPLL1ExpressionGrammarTest autoload) + (#'stx_goodies_petitparser_compiler_tests_extras' autoload) + (PPCExpressionGrammarTest autoload) + (PPCExpressionGrammarVerificationTest autoload) + (PPCLL1ExpressionGrammarTest autoload) + (#'PPCSmalltalkGrammarTests_Tokenized' autoload) + (#'PPCSmalltalkGrammarTests_Universal' autoload) + (PPCSmalltalkGrammarVerificationTest autoload) + (#'PPCSmalltalkParserTests_Tokenized' autoload) + (#'PPCSmalltalkParserTests_Universal' autoload) + (PPCSmalltalkParserVerificationTest autoload) + (#'PPCExpressionGrammarTest_Tokenized' autoload) + (#'PPCExpressionGrammarTest_Universal' autoload) + (#'PPCLL1ExpressionGrammarTest_Tokenized' autoload) + (#'PPCLL1ExpressionGrammarTest_Universal' autoload) + (#'PPCSmalltalkGrammarVerificationTest_Tokenized' autoload) + (#'PPCSmalltalkGrammarVerificationTest_Universal' autoload) + (#'PPCSmalltalkParserVerificationTest_Tokenized' autoload) + (#'PPCSmalltalkParserVerificationTest_Universal' autoload) + (#'PPExpressionGrammarVerificationTest_Tokenized' autoload) + (#'PPExpressionGrammarVerificationTest_Universal' autoload) ) ! @@ -167,6 +171,7 @@ A correponding method with real names must be present in my concrete subclasses" ^ #( + 'TestResource class' availableFor: ) ! !