#include "options.ih"

    // by parser/cleanup.cc

void Options::setAccessorVariables()
{
    Arg &arg = Arg::instance();

    d_debug = d_debug or arg.option('d');   // debug facility requested

    if (d_debug)
        d_matchedRules = false;             // as debug implies -R

    d_print = d_print or arg.option('t');

    if (d_arg.option(&d_className, "class-name"))
        s_warnOptions.insert("class-name");

    if (d_className.empty())
        d_className = s_defaultClassName;

    if (d_lexFunctionName.empty())
        d_lexFunctionName = s_defaultLexFunctionName;

    if (d_startConditionName.empty())       // not a program option
        d_startConditionName = s_defaultStartConditionName;

    string value;
    d_maxDepth = arg.option(&value, 'm') ? 
                    stoul(value)
                : 
                    MAX_DEPTH;

    if (arg.option(&d_nameSpace, 'n'))
        s_warnOptions.insert("namespace");

    setNameSpaceIdentifier();

    // Skeletons
    if (
        not arg.option(&d_skeletonDirectory, 'S') 
        and d_skeletonDirectory.empty()
    )
        d_skeletonDirectory = s_defaultSkeletonDirectory;

    arg.option(&d_tokenPath, 'O');
//    if (not arg.option(&d_tokenPath, 'O') and d_tokenPath.empty())
//        d_tokenPath = s_defaultTokenPath;

    if (not arg.option(&d_baseClassSkeleton, 'B'))
        d_baseClassSkeleton      = d_skeletonDirectory + FLEXCPPBASE_H;

    if (not arg.option(&d_classSkeleton, 'C'))
        d_classSkeleton          = d_skeletonDirectory + FLEXCPP_H;

    if (not arg.option(&d_implementationSkeleton, 'I'))
        d_implementationSkeleton = d_skeletonDirectory + FLEXCPP_IH;

    if (not arg.option(&d_lexSkeleton, 'L'))
        d_lexSkeleton            = d_skeletonDirectory + FLEXCPP_CC;

    d_arg.option(&d_baseClassPreinclude, 'H');

    // Paths

    arg.option(&d_targetDirectory, "target-directory");

    if (d_targetDirectory.length() and *d_targetDirectory.rbegin() != '/')
        d_targetDirectory += '/';

    if (d_arg.option('K'))
        d_constructionPath = d_targetDirectory + d_arg[0] + ".output";

}






