コード例 #1
0
ファイル: tree.cpp プロジェクト: ohhepicfail/qualifier
int main ()
{
    SetConsoleOutputCP(1251);
    SetConsoleCP(1251);
    const char dumpFilename[] = "dump";
    const char saveFilename[] = "save";

//    Node_t * nd = newNode ("aha",  newNode ("столовка", NULL, newNode ("ops", NULL, NULL)), NULL);
    Node_t * nd = TreeLoad (saveFilename);

    QUIZ (nd);

//    TreePrint  (nd, stdout);

    TreeDump (nd, dumpFilename);

    FILE * out = fopen (saveFilename, "w");
    assert (out);
    TreePrint (nd, out);
    fclose (out);

    TreeDel (&nd);

    return 0;

}
コード例 #2
0
ファイル: main.cpp プロジェクト: edosedgar/xs-pkg
int main ( int argc, char* argv[] )
{
    Token* TokenCode = NULL;
    ///$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    #ifndef BUG
    if ( argc > 1 )
    {
        TokenCode = CodeToToken ( argv[1] );

        if ( TokenCode == NULL && errno != 0 )
        {
            getchar ( );
            return 0;
        };
    } else return 0;
    #else
    TokenCode = CodeToToken ( "C:/Users/EdgarAdmin/Documents/Repositories/Informatic/Hometask8/bin/Debug/Startup.eds" );
    if ( TokenCode != NULL )
        ExpressionDump ( TokenCode );
    else
        return 0;
    TreeNode* TreeCode = CodeToTree ( TokenCode );
    TreeDump ( TreeCode );
    char* CopyN = (char*) calloc ( 1, sizeof ( char ));
    strcpy ( CopyN, "C:/Users/EdgarAdmin/Documents/Repositories/Informatic/Hometask8/bin/Debug/Startup.eds" );
    GenerateASMCode (  CopyN,TreeCode );
    #endif
    ///$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    free ( TokenCode );    TokenCode = NULL;
    return 0;
}