Esempio n. 1
0
        //private List<object> GetFunctionsToOutput(List<TokenExpression> tokens)
        //{
        //    List<object> FunctionsToOutput = new List<object>();
        //    bool hasOutputZero = false;
        //    foreach (var function in ainFile.Functions)
        //    {
        //        if (function.Name == "NULL")
        //        {

        //        }
        //        else if (function.Name.EndsWith("@2"))
        //        {
        //            if (!hasOutputZero)
        //            {
        //                FunctionsToOutput.Add(ainFile.GetFunction("0"));
        //                hasOutputZero = true;
        //            }
        //            FunctionsToOutput.Add(function);
        //        }
        //        else if (function.Name == "0")
        //        {

        //        }
        //        else
        //        {
        //            FunctionsToOutput.Add(function);
        //        }
        //    }
        //    FunctionsToOutput.Add(ainFile.GetFunction("NULL"));

        //    return FunctionsToOutput;
        //}

        public void Test()
        {
            //List<TokenExpression> tokens = new List<TokenExpression>();
            ////string expression = "a - -obj.method()()[4] - -3;";
            ////string expression = "- -a - -obj.method()()[4] - -3;";
            ////string expression = "- -a - -obj.method()(-9*-8 + 5)[4 == 4 + 5 == 4] - -3;";
            ////string expression = "- -a - -obj.method()(-9*-8 + 5)[4 == 4 + 5 == 4] - -3;";
            //IncludeString(expression, tokens);
            //this.reader = new TokenReader(tokens);
            //var exp = ReadExpression();

            string projectFilename = @"<insert filename here>";

            Compile(projectFilename);

            string outputJamFileName = Path.Combine(Path.GetDirectoryName(projectFilename), "output\\main.jam");

            //string outputJamFileName = Path.Combine(Path.GetDirectoryName(projectFilename), "..\\DISASSEMBLED2\\main.jam");

            //string filename = @"<insert filename here>";
            //List<TokenExpression> tokens = new List<TokenExpression>();
            //IncludeFile(filename, tokens);

            //string libraryPath = @"<insert filename here>";
            //LoadHllFiles(libraryPath);

            ainFile.LoadAlternativeNames();
            ainFile.LoadMetadata();
            AssemblerProjectWriter writer = new AssemblerProjectWriter(ainFile);

            writer.Options.ShowGlobalPrefix = false;
            writer.SaveAsProject(outputJamFileName, false);

            //todo: fix _date_ macro, needs spaces instead of leading zeroes
        }
Esempio n. 2
0
        private static void CreateProject(string inputAinFilename, string outputProjectFilename)
        {
            var ainFile = new AinFile(inputAinFilename);

            ainFile.LoadAlternativeNames();
            //var alternativeNames = new AlternativeNames(inputAinFilename);
            var writer = new AssemblerProjectWriter(ainFile);

            //writer.AlternativeNames = alternativeNames;
            writer.SaveAsProject(outputProjectFilename, false);
        }