compiler/PPCArguments.st
changeset 438 20598d7ce9fa
child 452 9f4558b3be66
equal deleted inserted replaced
437:54b3bc9e3987 438:20598d7ce9fa
       
     1 "{ Package: 'stx:goodies/petitparser/compiler' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
       
     4 
       
     5 Object subclass:#PPCArguments
       
     6 	instanceVariableNames:'arguments'
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'PetitCompiler-Core'
       
    10 !
       
    11 
       
    12 !PPCArguments class methodsFor:'as yet unclassified'!
       
    13 
       
    14 default
       
    15 	^ self new
       
    16 !
       
    17 
       
    18 new
       
    19 	^ self basicNew 
       
    20 		initialize;
       
    21 		yourself
       
    22 ! !
       
    23 
       
    24 !PPCArguments methodsFor:'accessing'!
       
    25 
       
    26 debug
       
    27 	^ self at: #debug ifAbsent: true
       
    28 !
       
    29 
       
    30 debug: value
       
    31 	self set: #debug to: value.
       
    32 !
       
    33 
       
    34 generate
       
    35 	^ self at: #generate ifAbsent: true
       
    36 !
       
    37 
       
    38 guards
       
    39 	^ self at: #guards ifAbsent: true
       
    40 !
       
    41 
       
    42 guards: value
       
    43 	self set: #guards to: value.
       
    44 !
       
    45 
       
    46 inline
       
    47 	^ self at: #inline ifAbsent: true
       
    48 !
       
    49 
       
    50 inline: value
       
    51 	self set: #inline to: value.
       
    52 !
       
    53 
       
    54 merge
       
    55 	^ self at: #merge ifAbsent: true
       
    56 !
       
    57 
       
    58 merge: value
       
    59 	self set: #merge to: value.
       
    60 !
       
    61 
       
    62 name
       
    63 	^ self at: #name ifAbsent: #PPGeneratedParser 
       
    64 !
       
    65 
       
    66 name: value
       
    67 	self set: #name to: value.
       
    68 !
       
    69 
       
    70 profile
       
    71 	^ self at: #profile ifAbsent: false
       
    72 !
       
    73 
       
    74 profile: value
       
    75 	self set: #profile to: value.
       
    76 !
       
    77 
       
    78 specialize
       
    79 	^ self at: #specialize ifAbsent: true
       
    80 !
       
    81 
       
    82 specialize: value
       
    83 	self set: #specialize to: value.
       
    84 !
       
    85 
       
    86 tokenize
       
    87 	^ self at: #tokenize ifAbsent: true
       
    88 !
       
    89 
       
    90 tokenize: value
       
    91 	self set: #tokenize to: value.
       
    92 ! !
       
    93 
       
    94 !PPCArguments methodsFor:'initialization'!
       
    95 
       
    96 initialize
       
    97 	super initialize.
       
    98 	arguments := IdentityDictionary new
       
    99 ! !
       
   100 
       
   101 !PPCArguments methodsFor:'private'!
       
   102 
       
   103 at: symbol ifAbsent: defaultValue
       
   104 	^ arguments at: symbol ifAbsent: [ ^ defaultValue  ]
       
   105 !
       
   106 
       
   107 set: symbol to: defaultValue
       
   108 	^ arguments at: symbol put: defaultValue 
       
   109 ! !
       
   110