Пример #1
0
        /// <summary>
        /// Converts an array of Tokens to an array of Hexa's
        /// </summary>
        /// <param name="values">Token array</param>
        /// <returns>array of Hexa's</returns>
        public static Hexa[] ToArray(Token[] values)
        {
            Hexa[] hexas = new Hexa[values.Length];

            int idx = 0;

            foreach (Token t in values)
            {
                hexas[idx] = new Hexa(t);
                idx++;
            }

            return(hexas);
        }
Пример #2
0
 /// <summary>
 /// Creates a ConstantAssign instantance
 /// </summary>
 /// <param name="op">Operator of the instruction</param>
 /// <param name="name">Name of the constant.</param>
 /// <param name="value">Value of the constant,in Hexadecimal format.</param>
 public ConstantAssign(Token op, Token name, Token value)
 {
     Operator = op;
     Name     = new VariableName(name);
     Value    = new Hexa(value);
 }
Пример #3
0
 /// <summary>
 /// Creates a VariableAssign instance
 /// </summary>
 /// <param name="op">Variable assign operator Token</param>
 /// <param name="name">(Optional) Name of the Variable. A variable can be assigned without a name</param>
 /// <param name="values">Array of values as Tokens</param>
 public VariableAssign(Token op, Token name, Token[] values)
 {
     Operator = op;
     Name     = new VariableName(name);
     Values   = Hexa.ToArray(values);
 }