compiler/PPCCompilationOptions.st
changeset 529 439c4057517f
parent 524 f6f68d32de73
child 533 666372dbe307
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/PPCCompilationOptions.st	Mon Aug 24 23:42:53 2015 +0100
@@ -0,0 +1,171 @@
+"{ Package: 'stx:goodies/petitparser/compiler' }"
+
+"{ NameSpace: Smalltalk }"
+
+Object subclass:#PPCCompilationOptions
+	instanceVariableNames:'options'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitCompiler-Core'
+!
+
+!PPCCompilationOptions class methodsFor:'as yet unclassified'!
+
+default
+    ^ self new
+!
+
+new
+    ^ self basicNew 
+        initialize;
+        yourself
+! !
+
+!PPCCompilationOptions methodsFor:'accessing'!
+
+cacheFirstFollow
+    ^ self at: #cacheFirstFollow ifAbsent: true
+!
+
+cacheFirstFollow: value
+    self set: #cacheFirstFollow to: value.
+!
+
+codeGenerator
+    self error: 'deprecated?'.
+    ^ self at: #codeGenerator ifAbsent: PPCCodeGenerator
+!
+
+codeGenerator: value
+    self set: #codeGenerator to: value.
+!
+
+debug
+    ^ self at: #debug ifAbsent: true
+!
+
+debug: value
+    self set: #debug to: value.
+!
+
+detectTokens
+    ^ self at: #detectTokens ifAbsent: true
+!
+
+detectTokens: value
+    self set: #detectTokens to: value.
+!
+
+generate
+    ^ self at: #generate ifAbsent: true
+!
+
+generate: value
+    ^ self set: #generate to: value
+!
+
+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.
+!
+
+parserName
+    ^ self at: #parserName ifAbsent: #PPGeneratedParser 
+!
+
+parserName: value
+    self set: #parserName to: value.
+!
+
+parserSuperclass
+    ^ self at: #parserSuperclass ifAbsent: PPTokenizingCompiledParser
+!
+
+parserSuperclass: value
+    self set: #parserSuperclass to: value.
+!
+
+profile
+    ^ self at: #profile ifAbsent: false
+!
+
+profile: value
+    self set: #profile to: value.
+!
+
+recognizingComponents
+    ^ self at: #recognizingComponents ifAbsent: true
+!
+
+recognizingComponents: value
+    self set: #recognizingComponents to: value.
+!
+
+scannerName
+    ^ self at: #scannerName ifAbsent: #PPGeneratedScanner
+!
+
+scannerName: value
+    self set: #scannerName to: value.
+!
+
+scannerSuperclass
+    ^ self at: #scannerSuperclass ifAbsent: PPCDistinctScanner
+!
+
+scannerSuperclass: value
+    self set: #scannerSuperclass 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.
+! !
+
+!PPCCompilationOptions methodsFor:'initialization'!
+
+initialize
+    super initialize.
+    options := IdentityDictionary new
+! !
+
+!PPCCompilationOptions methodsFor:'private'!
+
+at: symbol ifAbsent: defaultValue
+    ^ options at: symbol ifAbsent: [ ^ defaultValue  ]
+!
+
+set: symbol to: defaultValue
+    ^ options at: symbol put: defaultValue 
+! !
+