示例#1
0
        private Emitter(NsxModuleBuilder moduleBuilder, SubroutineSymbol subroutine)
        {
            _module                = moduleBuilder;
            _subroutine            = subroutine;
            _checker               = new Checker(subroutine, moduleBuilder.Diagnostics);
            _compilation           = moduleBuilder.Compilation;
            _breakScopes           = new ValueStack <BreakScope>(initialCapacity: 4);
            _code                  = default;
            _textId                = 0;
            _supressConstantLookup = false;
            _clearPage             = true;

            if (subroutine is FunctionSymbol function && function.Parameters.Length > 0)
            {
                foreach (ParameterSymbol p in function.Parameters)
                {
                    _ = GetVariableToken(p.Name);
                }
            }
        }
示例#2
0
 public LookupResult(SubroutineSymbol subroutine) : this()
     => (Variant, Subroutine) = (LookupResultVariant.Subroutine, subroutine);
示例#3
0
 public ushort GetSubroutineToken(SubroutineSymbol subroutine)
 {
     return(_subroutines.GetOrAddToken(subroutine));
 }