コード例 #1
0
        /// <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());
        }
コード例 #2
0
 /// <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());
 }
コード例 #3
0
        /// <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());
        }
コード例 #4
0
 /// <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());
 }