示例#1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 public BaseParseVisitor(TokenStream tokenStream)
 {
     this.TokenStream = tokenStream;
 }
示例#2
0
        /// <summary>
        /// Returns a P# program.
        /// </summary>
        /// <param name="tokens">List of tokens</param>
        /// <returns>P# program</returns>
        public IPSharpProgram ParseTokens(List<Token> tokens)
        {
            this.OriginalTokens = tokens.ToList();
            this.TokenStream = new TokenStream(tokens);
            this.Program = this.CreateNewProgram();
            this.ExpectedTokenTypes = new List<TokenType>();
            this.ParsingErrorLog = "";

            try
            {
                this.ParseTokens();
            }
            catch (ParsingException ex)
            {
                this.ParsingErrorLog = ex.Message;
                this.ReportParsingError();
                this.ExpectedTokenTypes = ex.ExpectedTokenTypes;
            }

            return this.Program;
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal StateDeclarationVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal MachineDeclarationVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 public SeqTypeIdentifierVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal FieldOrMethodDeclarationVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal IgnoreEventsDeclarationVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal ReceivedPayloadVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal DeferEventsDeclarationVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal FunctionDeclarationVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
示例#11
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 public AttributeListVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
示例#12
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal ArgumentsListVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal EventDeclarationVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
示例#14
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal PayloadVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
示例#15
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal BlockSyntaxVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }
示例#16
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="tokenStream">TokenStream</param>
 internal ReceivedPayloadVisitor(TokenStream tokenStream)
     : base(tokenStream)
 {
 }