예제 #1
0
        public StatementBase CreateRegionStartStatement(String content)
        {
            IList <TokenBase> input = new List <TokenBase>();

            input.Add(TokenCreator.Create <RegionStartToken>(content));
            return(new RegionStartStatement(input, Context));
        }
예제 #2
0
        public CloseBlockStatement CreateCloseBlockStatement()
        {
            IList <TokenBase> input = new List <TokenBase>();

            input.Add(TokenCreator.Create <CloseCurlyBracketToken>());
            return(new CloseBlockStatement(input, Context));
        }
예제 #3
0
        /// <summary>
        /// Create a line comment statement with the supplied identifier
        /// </summary>
        /// <param name="commentText">The text</param>
        /// <returns>A line comment with the text</returns>
        public LineCommentStatement CreateLineCommentStatement(String commentText)
        {
            IList <TokenBase> input = new List <TokenBase>();

            input.Add(TokenCreator.Create <LineCommentToken>(commentText));
            return(new LineCommentStatement(input, Context));
        }
예제 #4
0
        public virtual void SetUp()
        {
            _mocker = new MockRepository();

            IStatementContext context = _mocker.DynamicMock <IStatementContext>();

            _tokenCreator     = new TokenCreator();
            _statementCreator = new StatementCreator(_tokenCreator, context);
        }
예제 #5
0
        public InterfaceStatement CreateInterfaceStatement()
        {
            IList <TokenBase> input = new List <TokenBase>();

            input.Add(TokenCreator.Create <PublicModifierToken>());
            input.Add(TokenCreator.Create <SpaceToken>());
            input.Add(TokenCreator.Create <InterfaceToken>());
            input.Add(TokenCreator.Create <SpaceToken>());
            input.Add(TokenCreator.Create <IdentifierToken>("Test"));
            return(new InterfaceStatement(input, Context));
        }
예제 #6
0
        /// <summary>
        /// Create a member statement with the supplied identifier
        /// </summary>
        /// <param name="identifier">The identifier</param>
        /// <returns>A statement with the identifier</returns>
        public MemberStatement CreateMemberStatement(String identifier)
        {
            IList <TokenBase> input = new List <TokenBase>();

            input.Add(TokenCreator.Create <PrivateModifierToken>());
            input.Add(TokenCreator.Create <SpaceToken>());
            input.Add(TokenCreator.Create <IdentifierToken>("String"));
            input.Add(TokenCreator.Create <SpaceToken>());
            input.Add(TokenCreator.Create <IdentifierToken>(identifier));
            input.Add(TokenCreator.Create <SemiColonToken>());

            return(new MemberStatement(input, Context));
        }
예제 #7
0
        public MethodStatement CreateMethodStatement()
        {
            IList <TokenBase> input = new List <TokenBase>();

            input.Add(TokenCreator.Create <PrivateModifierToken>());
            input.Add(TokenCreator.Create <SpaceToken>());
            input.Add(TokenCreator.Create <IdentifierToken>("test"));
            input.Add(TokenCreator.Create <SpaceToken>());
            input.Add(TokenCreator.Create <IdentifierToken>("MyMethod"));
            input.Add(TokenCreator.Create <OpenRoundBracketToken>());
            input.Add(TokenCreator.Create <CloseRoundBracketToken>());
            return(new MethodStatement(input, Context));
        }
예제 #8
0
 /// <summary>
 /// Create a new instance of this object
 /// </summary>
 /// <param name="tokenCreator">The token creator to use</param>
 /// <param name="context">The statement context to pass</param>
 public StatementCreator(TokenCreator tokenCreator, IStatementContext context)
 {
     TokenCreator = tokenCreator;
     Context      = context;
 }