Beispiel #1
0
        public InterfaceMethodCallToken(Scope scope, VariableToken intVarToken, DotToken dotToken, IdentifierToken nameToken, BracketsToken argsToken, InterfaceMethodDefinition def)
            : base(scope)
        {
#if DEBUG
            if (intVarToken == null)
            {
                throw new ArgumentNullException("intVarToken");
            }
            if (dotToken == null)
            {
                throw new ArgumentNullException("dotToken");
            }
            if (nameToken == null)
            {
                throw new ArgumentNullException("nameToken");
            }
            if (argsToken == null)
            {
                throw new ArgumentNullException("argsToken");
            }
            if (def == null)
            {
                throw new ArgumentNullException("def");
            }
#endif
            AddToken(intVarToken);
            AddToken(dotToken);
            AddToken(_nameToken = nameToken);
            AddToken(argsToken);

            _methodDef = def;
            _nameToken.SourceDefinition = def;
        }
Beispiel #2
0
        private DataType _dataType;             // Can be null

        /// <summary>
        /// Creates a function call token.
        /// </summary>
        /// <param name="scope">(required) Current scope</param>
        /// <param name="classToken">(optional) Class name token</param>
        /// <param name="dotToken">(optional) Dot delimiter between class and function name</param>
        /// <param name="nameToken">(required) Function name</param>
        /// <param name="argsToken">(required) Function args</param>
        /// <param name="def">(optional) Existing function definition</param>
        public FunctionCallToken(Scope scope, ClassToken classToken, DotToken dotToken, IdentifierToken nameToken, BracketsToken argsToken, FunctionDefinition def)
            : base(scope)
        {
#if DEBUG
            if (nameToken == null)
            {
                throw new ArgumentNullException("nameToken");
            }
            if (argsToken == null)
            {
                throw new ArgumentNullException("argsToken");
            }
#endif
            AddToken(_classToken = classToken);
            AddToken(dotToken);
            AddToken(_nameToken         = nameToken);
            _nameToken.SourceDefinition = def;
            AddToken(_argsToken         = argsToken);

            _dataType = def.DataType;
        }
Beispiel #3
0
        public InterfacePropertyToken(Scope scope, VariableToken intVarToken, DotToken dotToken, IdentifierToken nameToken, InterfacePropertyDefinition propDef)
            : base(scope)
        {
#if DEBUG
            if (intVarToken == null)
            {
                throw new ArgumentNullException("intVarToken");
            }
            if (dotToken == null)
            {
                throw new ArgumentNullException("dotToken");
            }
            if (nameToken == null)
            {
                throw new ArgumentNullException("nameToken");
            }
            if (propDef == null)
            {
                throw new ArgumentNullException("propDef");
            }
#endif
            nameToken.SourceDefinition = propDef;
            _propDef = propDef;

            AddToken(intVarToken);
            AddToken(dotToken);
            AddToken(nameToken);
        }