compiler/extensions.st
changeset 529 439c4057517f
parent 525 751532c8f3db
child 534 a949c4fe44df
equal deleted inserted replaced
528:ebfddc82b8bb 529:439c4057517f
   397 ! !
   397 ! !
   398 
   398 
   399 !PPParser methodsFor:'*petitcompiler'!
   399 !PPParser methodsFor:'*petitcompiler'!
   400 
   400 
   401 compile
   401 compile
   402     ^ self compile: PPCArguments default
   402     ^ self compile: PPCCompilationOptions default
   403 ! !
   403 
   404 
   404     "Modified: / 24-08-2015 / 23:39:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   405 !PPParser methodsFor:'*petitcompiler'!
   405 ! !
   406 
   406 
   407 compile: arguments
   407 !PPParser methodsFor:'*petitcompiler'!
   408     self assert: (arguments isKindOf: PPCArguments).
   408 
       
   409 compile: options
       
   410     self assert: (options isKindOf: PPCCompilationOptions).
   409     
   411     
   410     ^ PPCConfiguration default
   412     ^ PPCConfiguration default
   411         arguments: arguments;
   413         options: options;
   412         compile: self
   414         compile: self
   413 ! !
   415 
   414 
   416     "Modified: / 24-08-2015 / 23:39:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   415 !PPParser methodsFor:'*petitcompiler'!
   417 ! !
   416 
   418 
   417 compile: arguments andParse: input
   419 !PPParser methodsFor:'*petitcompiler'!
   418     ^ (self compile: arguments) parse: input
   420 
       
   421 compile: options andParse: input
       
   422     ^ (self compile: options) parse: input
   419 ! !
   423 ! !
   420 
   424 
   421 !PPParser methodsFor:'*petitcompiler'!
   425 !PPParser methodsFor:'*petitcompiler'!
   422 
   426 
   423 compileAs: name
   427 compileAs: name
   424     | arguments |
   428     | options |
   425     arguments := PPCArguments default.
   429     options := PPCCompilationOptions default.
   426     arguments name: name.
   430     options name: name.
   427     
   431     
   428     ^ self compile: arguments
   432     ^ self compile: options
       
   433 
       
   434     "Modified: / 24-08-2015 / 23:39:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   429 ! !
   435 ! !
   430 
   436 
   431 !PPParser methodsFor:'*petitcompiler'!
   437 !PPParser methodsFor:'*petitcompiler'!
   432 
   438 
   433 compileTokenizing
   439 compileTokenizing
   646 !PPSequenceParser methodsFor:'*petitcompiler'!
   652 !PPSequenceParser methodsFor:'*petitcompiler'!
   647 
   653 
   648 map: aBlock
   654 map: aBlock
   649         ^ aBlock numArgs = self children size
   655         ^ aBlock numArgs = self children size
   650                 ifTrue: [ PPMappedActionParser on: self block: aBlock ]
   656                 ifTrue: [ PPMappedActionParser on: self block: aBlock ]
   651                 ifFalse: [ self error: aBlock numArgs asString , ' arguments expected.' ]
   657                 ifFalse: [ self error: aBlock numArgs asString , ' options expected.' ]
   652 
   658 
   653     "Modified: / 02-06-2015 / 17:16:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   659     "Modified: / 02-06-2015 / 17:16:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   654 ! !
   660 ! !
   655 
   661 
   656 !PPSmalltalkGrammar methodsFor:'*petitcompiler'!
   662 !PPSmalltalkGrammar methodsFor:'*petitcompiler'!