IsString() public method

Determine wether the current token is a string and return it.
public IsString ( string &s ) : bool
s string Out : the string value.
return bool
コード例 #1
0
        protected override void OnCommandSent( object sender, CommandSentEventArgs e )
        {
            string cmd;
            string sub;
            string m;

            CommandParser p = new CommandParser( e.Command );

            if( !e.Canceled && p.IsIdentifier( out cmd ) && cmd == CMDChangeMode )
            {
                if( p.MatchIsolatedChar( '.' ) )
                {
                    p.IsIdentifier( out sub );
                    sub = sub.ToLower();

                    if( p.Match( CommandParser.Token.OpenPar ) )
                        if( p.IsString( out m ) )
                            if( p.Match( CommandParser.Token.ClosePar ) )
                            {
                                if( cmd == CMDChangeMode )
                                {
                                    switch( sub )
                                    {
                                        case "add": Add( m ); return;
                                        case "remove": Remove( m ); return;
                                        case "set": ChangeMode( m ); return;
                                        case "toggle": Toggle( m ); return;
                                    }
                                }
                            }
                }
            }
        }
コード例 #2
0
        protected override void OnCommandSent( object sender, CommandSentEventArgs e )
        {
            string cmd;
            string m;

            CommandParser p = new CommandParser( e.Command );

            if( !e.Canceled && p.IsIdentifier( out cmd ) && cmd == CMD )
            {
                if( p.Match( CommandParser.Token.OpenPar ) )
                    if( p.IsString( out m ) )
                        if( p.Match( CommandParser.Token.ClosePar ) )
                            if( cmd == CMD )
                                Exec( m );
            }
        }
コード例 #3
0
        protected override void OnCommandSent( object sender, CommandSentEventArgs e )
        {
            if( !e.Canceled )
            {
                CommandParser p = new CommandParser( e.Command );
                if( p.MatchIdentifier( CMD ) )
                {
                    string eventKey;
                    string eventName;

                    if( p.MatchIsolatedChar( '.' ) )
                    {
                        if( p.IsIdentifier( out eventName ) )
                        {
                            if( p.Match( CommandParser.Token.OpenPar ) )
                            {
                                if( p.IsString( out eventKey ) )
                                {
                                    if( p.Match( CommandParser.Token.ClosePar ) )
                                    {
                                        if( p.MatchIsolatedChar( ':' ) )
                                        {
                                            Parse( eventKey, eventName, e.Command.Split( ':' )[1] );
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }