/// <summary> /// Assembles the assembly code from the <see cref="TextReader"/> /// </summary> /// <param name="asmCodeReader">A reader that will read the assembly code</param> /// <returns>A program</returns> public static int[][] AssembleFrom(TextReader asmCodeReader) { var lc = LexContext.CreateFrom(asmCodeReader); return(Assembler.Emit(Assembler.Parse(lc)).ToArray()); }
/// <summary> /// Assembles the assembly code into a program /// </summary> /// <param name="asmCode">The code to assemble</param> /// <returns>A program</returns> public static int[][] Assemble(LexContext asmCode) { return(Assembler.Emit(Assembler.Parse(asmCode)).ToArray()); }
/// <summary> /// Assembles the assembly code into a program /// </summary> /// <param name="asmCode">The code to assemble</param> /// <returns>A program</returns> public static int[][] Assemble(string asmCode) { var lc = LexContext.Create(asmCode); return(Assembler.Emit(Assembler.Parse(lc)).ToArray()); }
/// <summary> /// Assembles the assembly code from the specified url /// </summary> /// <param name="asmUrl">An URL that points to the assembly code</param> /// <returns>A program</returns> public static int[][] AssembleFromUrl(string asmUrl) { using (var lc = LexContext.CreateFromUrl(asmUrl)) return(Assembler.Emit(Assembler.Parse(lc)).ToArray()); }