Example #1
0
        static void Main(string[] args)
        {
            if (args.Count() != 1)
            {
                throw new System.ArgumentException();
            }
            var inputPath     = args [0];
            var inputContents = File.ReadAllText(inputPath);
            var input         = new ProgramDescripton {
                new SourceFileDescription {
                    File = new NPath(inputPath), Contents = inputContents
                }
            };
            var csharp = new JamToCSharpConverter().Convert(input);

            foreach (var convertedFile in csharp)
            {
                convertedFile.File.WriteAllText(convertedFile.Contents);
            }
        }
Example #2
0
        public string[] Run(ProgramDescripton program, IEnumerable <NPath> additionalLibs = null)
        {
            var executable = Compile(program, additionalLibs);

            return(Shell.Execute(executable, "").Split(new[] { Environment.NewLine }, StringSplitOptions.None));
        }