public StatementBase CreateRegionStartStatement(String content) { IList <TokenBase> input = new List <TokenBase>(); input.Add(TokenCreator.Create <RegionStartToken>(content)); return(new RegionStartStatement(input, Context)); }
public CloseBlockStatement CreateCloseBlockStatement() { IList <TokenBase> input = new List <TokenBase>(); input.Add(TokenCreator.Create <CloseCurlyBracketToken>()); return(new CloseBlockStatement(input, Context)); }
/// <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)); }
public virtual void SetUp() { _mocker = new MockRepository(); IStatementContext context = _mocker.DynamicMock <IStatementContext>(); _tokenCreator = new TokenCreator(); _statementCreator = new StatementCreator(_tokenCreator, context); }
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)); }
/// <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)); }
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)); }
/// <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; }