Beispiel #1
0
        private bool Generate(CompileArgs args)
        {
            if (string.IsNullOrEmpty(args.InputContents))
            {
                args.Error(0, 0, "Input file is empty");
                return(false);
            }

            TryGetFramePath(args.InputFilePath, out var parserFrame);

            // Log.LogMessage(MessageImportance.Normal, "Opal: beginning compile {0}", DateTime.Now);
            var isOk = GenerateCode(args, parserFrame);

            return(isOk);
        }
Beispiel #2
0
        private bool GenerateCode(CompileArgs args, string parserFrame)
        {
            try
            {
                var compiler = new Compiler2(args)
                {
                    ParserFrame = parserFrame
                };

                return(compiler.Compile());
            }
            catch (Exception ex)
            {
                args.Error(0, 0, "Fatal error: " + ex);
            }
            return(false);
        }