firstStage static method

Danger<CitrusSymbolTableStruct, CitrusSymbolTableException> firstStage(
  1. Chain chain,
  2. TemplateFileSetting tempalteFileSetting
)

fragment symbol が参照されてしまわれないように, permanently symbol と list symbol のみ値を入力する.

Implementation

static Danger<CitrusSymbolTableStruct, CitrusSymbolTableException> firstStage(Chain chain, TemplateFileSetting tempalteFileSetting) {

    final log = Log(classLocation: CitrusSymbolTableStruct, functionLocation: 'firstStage');

    // default の値は設定せず 入力が無い場合は exception として user に報告する.

    final textSymbolRosterResult = TextSymbol.fromChainAndTemplateFileSetting(chain, tempalteFileSetting);
    log.add(textSymbolRosterResult);
    if (textSymbolRosterResult is! Success<List<TextSymbol>, ChainException>) return Failure(CitrusSymbolTableExceptionF(), log);

    final textArraySymbolRosterResult = TextArraySymbol.fromChainAndTemplateFileSetting(chain, tempalteFileSetting);
    log.add(textArraySymbolRosterResult);
    if (textArraySymbolRosterResult is! Success<List<TextArraySymbol>, ChainException>) return Failure(CitrusSymbolTableExceptionF(), log);

    final flagSymbolRosterResult = FlagSymbol.fromChainAndTemplateFileSetting(chain, tempalteFileSetting);
    log.add(flagSymbolRosterResult);

    final objectSymbolRosterResult = ObjectSymbol.fromChainAndTemplateFileSetting(chain, tempalteFileSetting);
    log.add(objectSymbolRosterResult);
    if (objectSymbolRosterResult is! Success<List<ObjectSymbol>, ChainException>) return Failure(CitrusSymbolTableExceptionF(), log);

    final objectArraySymbolRosterResult = ObjectArraySymbol.fromChainAndTemplateFileSetting(chain, tempalteFileSetting);
    log.add(objectArraySymbolRosterResult);
    if (objectArraySymbolRosterResult is! Success<List<ObjectArraySymbol>, ChainException>) return Failure(CitrusSymbolTableExceptionF(), log);

    final result = CitrusSymbolTableStruct(
        textSymbolRosterResult.wrapped,
        [],
        textArraySymbolRosterResult.wrapped,
        [],
        flagSymbolRosterResult.wrapped,
        objectSymbolRosterResult.wrapped,
        objectArraySymbolRosterResult.wrapped,
    );

    return Success(result, log);

}