Exemplo n.º 1
0
 private void WriteLoadPrefix(MjoFlags flags, IColoredWriter writer)
 {
     WritePunctuation(flags.InvertMode() switch {
         MjoInvertMode.Numeric => "-",
         MjoInvertMode.Boolean => "!",
         MjoInvertMode.Bitwise => "~",
         _ => ""
     }, writer);
Exemplo n.º 2
0
 public Assignment(Expression value, uint hash, MjoFlags flags, MjoType type, BinaryOperation operation)
 {
     Value     = value;
     Hash      = hash;
     Flags     = flags;
     Type      = type;
     Operation = operation;
 }
Exemplo n.º 3
0
        private void WriteIdentifier(uint hash, MjoFlags flags, IColoredWriter writer)
        {
            writer.ForegroundColor = ConsoleColor.Red;
            char scope = flags.Scope() switch {
                MjoScope.Persistent => '#',
                MjoScope.SaveFile => '@',
                MjoScope.Thread => '%',
                MjoScope.Local => '_',
                _ => throw new ArgumentOutOfRangeException()
            };
            string type = flags.Type() switch {
                MjoType.Int => "",
                MjoType.Float => "%",
                MjoType.String => "$",
                MjoType.IntArray => "#",
                MjoType.FloatArray => "%#",
                MjoType.StringArray => "$#",
                MjoType.Unknown => "?",
                _ => throw new ArgumentOutOfRangeException()
            };

            writer.Write($"{scope}{{{hash:x8}}}{type}");
        }
Exemplo n.º 4
0
 public static MjoModifier Modifier(this MjoFlags flags) => (MjoModifier)((ushort)flags & (ushort)MjoFlagMask.Modifier);
Exemplo n.º 5
0
 public static MjoInvertMode InvertMode(this MjoFlags flags) => (MjoInvertMode)(((ushort)flags & (ushort)MjoFlagMask.Invert) >> 3);
Exemplo n.º 6
0
 public static MjoScope Scope(this MjoFlags flags) => (MjoScope)(((ushort)flags & (ushort)MjoFlagMask.Scope) >> 5);
Exemplo n.º 7
0
 public static MjoType Type(this MjoFlags flags) => (MjoType)(((ushort)flags & (ushort)MjoFlagMask.Type) >> 8);
Exemplo n.º 8
0
 public static int Dimension(this MjoFlags flags) => ((ushort)flags & (ushort)MjoFlagMask.Dim) >> 11;
Exemplo n.º 9
0
 public Identifier(uint hash, MjoFlags flags)
 {
     Hash  = hash;
     Flags = flags;
 }
Exemplo n.º 10
0
 public ArrayAssignment(Expression value, Expression[] indices, uint hash, MjoFlags flags, MjoType type, BinaryOperation operation)
     : base(value, hash, flags, type, operation)
 {
     Indices = indices;
 }
Exemplo n.º 11
0
 public ArrayAccess(uint hash, MjoFlags flags, Expression[] indices)
 {
     Hash    = hash;
     Flags   = flags;
     Indices = indices;
 }