Oolite 1.91.0.7645-241119-222d325
|
import "OOCocoa.h"
import "OOStringExpander.h"
import "Universe.h"
import "OOJavaScriptEngine.h"
import "OOCollectionExtractors.h"
import "OOStringParsing.h"
import "ResourceManager.h"
import "PlayerEntityScriptMethods.h"
import "PlayerEntity.h"
Go to the source code of this file.
Classes | |
struct | OOStringExpansionContext |
Macros | |
#define | WARNINGS OOLITE_DEBUG |
#define | OO_EXPANDER_RANDOM (context->useGoodRNG ? (Ranrot()&0xFF) : gen_rnd_number()) |
#define | SyntaxError(CONTEXT, CLASS, FORMAT, ...) |
#define | SyntaxWarning(CONTEXT, CLASS, FORMAT, ...) |
#define | OPERATOR(name) |
#define | kInvalidGEscapeMessage @"String escape code %G must be followed by six integers." |
#define | kInvalidJEscapeMessage @"String escape code %J must be followed by three integers." |
Enumerations | |
enum | { kStackAllocationLimit = UINT16_MAX , kRecursionLimit = 100 } |
Functions | |
static NSString * | GetSystemName (OOStringExpansionContext *context) |
static NSString * | GetSystemNameIan (OOStringExpansionContext *context) |
static NSString * | GetRandomNameN (OOStringExpansionContext *context) |
static NSString * | GetRandomNameR (OOStringExpansionContext *context) |
static NSArray * | GetSystemDescriptions (OOStringExpansionContext *context) |
static void | AppendCharacters (NSMutableString **result, const unichar *characters, NSUInteger start, NSUInteger end) |
static NSString * | NewRandomDigrams (OOStringExpansionContext *context) |
static NSString * | OldRandomDigrams (void) |
static NSString * | Expand (OOStringExpansionContext *context, NSString *string, NSUInteger sizeLimit, NSUInteger recursionLimit) |
static NSString * | ExpandKey (OOStringExpansionContext *context, const unichar *characters, NSUInteger size, NSUInteger idx, NSUInteger *replaceLength, NSUInteger sizeLimit, NSUInteger recursionLimit) |
static NSString * | ExpandDigitKey (OOStringExpansionContext *context, const unichar *characters, NSUInteger keyStart, NSUInteger keyLength, NSUInteger sizeLimit, NSUInteger recursionLimit) |
static NSString * | ExpandStringKey (OOStringExpansionContext *context, NSString *key, NSUInteger sizeLimit, NSUInteger recursionLimit) |
static NSString * | ExpandStringKeyOverride (OOStringExpansionContext *context, NSString *key) |
static NSString * | ExpandStringKeySpecial (OOStringExpansionContext *context, NSString *key) |
static NSString * | ExpandStringKeyKeyboardBinding (OOStringExpansionContext *context, NSString *key) |
static NSMapTable * | SpecialSubstitutionSelectors (void) |
static NSString * | ExpandStringKeyFromDescriptions (OOStringExpansionContext *context, NSString *key, NSUInteger sizeLimit, NSUInteger recursionLimit) |
static NSString * | ExpandStringKeyMissionVariable (OOStringExpansionContext *context, NSString *key) |
static NSString * | ExpandStringKeyLegacyLocalVariable (OOStringExpansionContext *context, NSString *key) |
static NSString * | ExpandLegacyScriptSelectorKey (OOStringExpansionContext *context, NSString *key) |
static SEL | LookUpLegacySelector (NSString *key) |
static NSString * | ExpandPercentEscape (OOStringExpansionContext *context, const unichar *characters, NSUInteger size, NSUInteger idx, NSUInteger *replaceLength) |
static NSString * | ExpandSystemNameForGalaxyEscape (OOStringExpansionContext *context, const unichar *characters, NSUInteger size, NSUInteger idx, NSUInteger *replaceLength) |
static NSString * | ExpandSystemNameEscape (OOStringExpansionContext *context, const unichar *characters, NSUInteger size, NSUInteger idx, NSUInteger *replaceLength) |
static NSString * | ExpandPercentR (OOStringExpansionContext *context, NSString *input) |
static void | ReportWarningForUnknownKey (OOStringExpansionContext *context, NSString *key) |
static NSString * | ApplyOperators (NSString *string, NSString *operatorsString) |
static NSString * | ApplyOneOperator (NSString *string, NSString *op, NSString *param) |
static void | SyntaxIssue (OOStringExpansionContext *context, const char *function, const char *fileName, NSUInteger line, NSString *logMessageClass, NSString *prefix, NSString *format,...) OO_TAKES_FORMAT_STRING(7 |
NSString * | OOExpandDescriptionString (Random_Seed seed, NSString *string, NSDictionary *overrides, NSDictionary *legacyLocals, NSString *systemName, OOExpandOptions options) |
NSString * | OOGenerateSystemDescription (Random_Seed seed, NSString *name) |
Random_Seed | OOStringExpanderDefaultRandomSeed (void) |
static NSString * | Operator_cr (NSString *string, NSString *param) |
static NSString * | Operator_dcr (NSString *string, NSString *param) |
static NSString * | Operator_icr (NSString *string, NSString *param) |
static NSString * | Operator_idcr (NSString *string, NSString *param) |
static NSString * | Operator_precision (NSString *string, NSString *param) |
static NSString * | Operator_multiply (NSString *string, NSString *param) |
static NSString * | Operator_add (NSString *string, NSString *param) |
#define kInvalidGEscapeMessage @"String escape code %G must be followed by six integers." |
Referenced by ExpandSystemNameForGalaxyEscape().
#define kInvalidJEscapeMessage @"String escape code %J must be followed by three integers." |
Referenced by ExpandSystemNameEscape().
#define OO_EXPANDER_RANDOM (context->useGoodRNG ? (Ranrot()&0xFF) : gen_rnd_number()) |
Definition at line 39 of file OOStringExpander.m.
Referenced by ExpandDigitKey(), ExpandStringKeyFromDescriptions(), and NewRandomDigrams().
#define OPERATOR | ( | name | ) |
#define SyntaxError | ( | CONTEXT, | |
CLASS, | |||
FORMAT, | |||
... ) |
Definition at line 148 of file OOStringExpander.m.
Referenced by ExpandSystemNameEscape(), ExpandSystemNameForGalaxyEscape(), and ReportWarningForUnknownKey().
#define SyntaxWarning | ( | CONTEXT, | |
CLASS, | |||
FORMAT, | |||
... ) |
Definition at line 151 of file OOStringExpander.m.
Referenced by Expand(), ExpandDigitKey(), ExpandKey(), ExpandPercentEscape(), ExpandStringKeyOverride(), and ReportWarningForUnknownKey().
#define WARNINGS OOLITE_DEBUG |
Definition at line 37 of file OOStringExpander.m.
anonymous enum |
Enumerator | |
---|---|
kStackAllocationLimit | |
kRecursionLimit |
Definition at line 41 of file OOStringExpander.m.
|
static |
Definition at line 1133 of file OOStringExpander.m.
References nil.
Referenced by Expand().
|
static |
Definition at line 516 of file OOStringExpander.m.
Referenced by ApplyOperators().
|
static |
Definition at line 444 of file OOStringExpander.m.
References ApplyOneOperator(), and nil.
Referenced by ExpandKey().
|
static |
Definition at line 257 of file OOStringExpander.m.
References AppendCharacters(), OOStringExpansionContext::convertBackslashN, ExpandKey(), ExpandPercentEscape(), EXPECT_NOT, kStackAllocationLimit, nil, and SyntaxWarning.
Referenced by ExpandDigitKey(), ExpandStringKeyFromDescriptions(), and OOExpandDescriptionString().
|
static |
Definition at line 555 of file OOStringExpander.m.
References count, Expand(), EXPECT_NOT, GetSystemDescriptions(), nil, OO_EXPANDER_RANDOM, OOLogERR, SyntaxWarning, OOStringExpansionContext::sysDescCount, and OOStringExpansionContext::useGoodRNG.
Referenced by ExpandKey().
|
static |
Definition at line 379 of file OOStringExpander.m.
References ApplyOperators(), ExpandDigitKey(), ExpandStringKey(), EXPECT_NOT, nil, and SyntaxWarning.
Referenced by Expand().
|
static |
Definition at line 823 of file OOStringExpander.m.
References LookUpLegacySelector(), and nil.
Referenced by ExpandStringKey().
|
static |
Definition at line 937 of file OOStringExpander.m.
References ExpandSystemNameEscape(), ExpandSystemNameForGalaxyEscape(), GetRandomNameN(), GetSystemName(), GetSystemNameIan(), OOStringExpansionContext::hasPercentR, nil, and SyntaxWarning.
Referenced by Expand().
|
static |
Definition at line 1009 of file OOStringExpander.m.
References GetRandomNameR().
Referenced by OOExpandDescriptionString().
|
static |
Definition at line 614 of file OOStringExpander.m.
References ExpandLegacyScriptSelectorKey(), ExpandStringKeyFromDescriptions(), ExpandStringKeyKeyboardBinding(), ExpandStringKeyLegacyLocalVariable(), ExpandStringKeyMissionVariable(), ExpandStringKeyOverride(), ExpandStringKeySpecial(), nil, and ReportWarningForUnknownKey().
Referenced by ExpandKey(), and OOExpandDescriptionString().
|
static |
Definition at line 764 of file OOStringExpander.m.
References count, Expand(), nil, OO_EXPANDER_RANDOM, and OOLogERR.
Referenced by ExpandStringKey().
|
static |
Definition at line 710 of file OOStringExpander.m.
References nil.
Referenced by ExpandStringKey().
|
static |
Definition at line 811 of file OOStringExpander.m.
Referenced by ExpandStringKey().
|
static |
Definition at line 794 of file OOStringExpander.m.
References nil.
Referenced by ExpandStringKey().
|
static |
Definition at line 658 of file OOStringExpander.m.
References nil, and SyntaxWarning.
Referenced by ExpandStringKey().
|
static |
Definition at line 684 of file OOStringExpander.m.
References nil, PLAYER, and SpecialSubstitutionSelectors().
Referenced by ExpandStringKey().
|
static |
Definition at line 1096 of file OOStringExpander.m.
References EXPECT_NOT, kInvalidJEscapeMessage, kOOMaximumSystemID, nil, and SyntaxError.
Referenced by ExpandPercentEscape().
|
static |
Definition at line 1044 of file OOStringExpander.m.
References EXPECT_NOT, kInvalidGEscapeMessage, kOOMaximumGalaxyID, kOOMaximumSystemID, nil, and SyntaxError.
Referenced by ExpandPercentEscape().
|
static |
Definition at line 1186 of file OOStringExpander.m.
References nil, and OOStringExpansionContext::randomNameN.
Referenced by ExpandPercentEscape().
|
static |
Definition at line 1199 of file OOStringExpander.m.
References nil, and OOStringExpansionContext::randomNameR.
Referenced by ExpandPercentR().
|
static |
Definition at line 1212 of file OOStringExpander.m.
References nil, OOStringExpansionContext::sysDescCount, and OOStringExpansionContext::systemDescriptions.
Referenced by ExpandDigitKey().
|
static |
Definition at line 1162 of file OOStringExpander.m.
References nil, and OOStringExpansionContext::systemName.
Referenced by ExpandPercentEscape().
|
static |
Definition at line 1173 of file OOStringExpander.m.
References nil, and OOStringExpansionContext::systemNameWithIan.
Referenced by ExpandPercentEscape().
|
static |
Definition at line 845 of file OOStringExpander.m.
References count, nil, PLAYER, and ResourceManager::whitelistDictionary.
Referenced by ExpandLegacyScriptSelectorKey().
|
static |
Definition at line 1250 of file OOStringExpander.m.
References count, and OO_EXPANDER_RANDOM.
|
static |
Definition at line 1230 of file OOStringExpander.m.
References gen_rnd_number(), and x.
NSString * OOExpandDescriptionString | ( | Random_Seed | seed, |
NSString * | string, | ||
NSDictionary * | overrides, | ||
NSDictionary * | legacyLocals, | ||
NSString * | systemName, | ||
OOExpandOptions | options ) |
Definition at line 160 of file OOStringExpander.m.
References Expand(), ExpandPercentR(), ExpandStringKey(), OOStringExpansionContext::hasPercentR, kOOExpandBackslashN, kOOExpandDisallowPercentI, kOOExpandForJavaScript, kOOExpandGoodRNG, kOOExpandKey, kOOExpandReseedRNG, kRecursionLimit, kStackAllocationLimit, nil, OORestoreRandomState(), OOSaveRandomState(), OOSetReallyRandomRANROTAndRndSeeds(), and OOStringExpansionContext::systemNameWithIan.
Referenced by GlobalExpandDescription(), GlobalExpandMissionText(), OOGenerateSystemDescription(), and PlayerEntity(Scripting)::PerformActionStatment.
NSString * OOGenerateSystemDescription | ( | Random_Seed | seed, |
NSString * | name ) |
Definition at line 231 of file OOStringExpander.m.
References kOOExpandKey, nil, OOExpandDescriptionString(), and seed_RNG_only_for_planet_description().
Random_Seed OOStringExpanderDefaultRandomSeed | ( | void | ) |
Definition at line 238 of file OOStringExpander.m.
Referenced by PlayerEntity(Scripting)::PerformActionStatment.
|
static |
Definition at line 501 of file OOStringExpander.m.
|
static |
Definition at line 465 of file OOStringExpander.m.
References OOCredits().
|
static |
Definition at line 471 of file OOStringExpander.m.
References OOCredits().
|
static |
Definition at line 477 of file OOStringExpander.m.
References OOIntCredits().
|
static |
Definition at line 483 of file OOStringExpander.m.
References OOIntCredits().
|
static |
Definition at line 495 of file OOStringExpander.m.
|
static |
Definition at line 489 of file OOStringExpander.m.
|
static |
Definition at line 903 of file OOStringExpander.m.
References SyntaxError, and SyntaxWarning.
Referenced by ExpandStringKey().
|
static |
Definition at line 727 of file OOStringExpander.m.
References count.
Referenced by ExpandStringKeySpecial().
|
static |
Definition at line 1267 of file OOStringExpander.m.
References OOStringExpansionContext::isJavaScript, OOJSAcquireContext(), OOJSRelinquishContext(), OOJSReportWarningWithArguments(), OOLogWillDisplayMessagesInClass(), and OOLogWithFunctionFileAndLineAndArguments().