compiler/PPCArguments.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 01 May 2015 14:39:47 +0200
changeset 445 eb33780df2f9
parent 438 20598d7ce9fa
child 452 9f4558b3be66
permissions -rw-r--r--
Portability: Inlined #asLegalSelector since Smalltalk/X does not support it

"{ Package: 'stx:goodies/petitparser/compiler' }"

"{ NameSpace: Smalltalk }"

Object subclass:#PPCArguments
	instanceVariableNames:'arguments'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Core'
!

!PPCArguments class methodsFor:'as yet unclassified'!

default
	^ self new
!

new
	^ self basicNew 
		initialize;
		yourself
! !

!PPCArguments methodsFor:'accessing'!

debug
	^ self at: #debug ifAbsent: true
!

debug: value
	self set: #debug to: value.
!

generate
	^ self at: #generate ifAbsent: true
!

guards
	^ self at: #guards ifAbsent: true
!

guards: value
	self set: #guards to: value.
!

inline
	^ self at: #inline ifAbsent: true
!

inline: value
	self set: #inline to: value.
!

merge
	^ self at: #merge ifAbsent: true
!

merge: value
	self set: #merge to: value.
!

name
	^ self at: #name ifAbsent: #PPGeneratedParser 
!

name: value
	self set: #name to: value.
!

profile
	^ self at: #profile ifAbsent: false
!

profile: value
	self set: #profile to: value.
!

specialize
	^ self at: #specialize ifAbsent: true
!

specialize: value
	self set: #specialize to: value.
!

tokenize
	^ self at: #tokenize ifAbsent: true
!

tokenize: value
	self set: #tokenize to: value.
! !

!PPCArguments methodsFor:'initialization'!

initialize
	super initialize.
	arguments := IdentityDictionary new
! !

!PPCArguments methodsFor:'private'!

at: symbol ifAbsent: defaultValue
	^ arguments at: symbol ifAbsent: [ ^ defaultValue  ]
!

set: symbol to: defaultValue
	^ arguments at: symbol put: defaultValue 
! !