Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ParseMessage.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 //
4 // ----------------------------------------------------------------------
5 // Gold Parser engine.
6 // See more details on http://www.devincook.com/goldparser/
7 //
8 // Original code is written in VB by Devin Cook (GOLDParser@DevinCook.com)
9 //
10 // This translation is done by Vladimir Morozov (vmoroz@hotmail.com)
11 //
12 // The translation is based on the other engine translations:
13 // Delphi engine by Alexandre Rai (riccio@gmx.at)
14 // C# engine by Marcus Klimstra (klimstra@home.nl)
15 // ----------------------------------------------------------------------
16 #region Using directives
17 
18 using System;
19 
20 #endregion
21 
22 namespace GoldParser
23 {
24  /// <summary>
25  /// Available parse messages.
26  /// </summary>
27  internal enum ParseMessage
28  {
29  /// <summary>
30  /// Nothing
31  /// </summary>
32  Empty = 0,
33 
34  /// <summary>
35  /// Each time a token is read, this message is generated.
36  /// </summary>
37  TokenRead = 1,
38 
39  /// <summary>
40  /// When the engine is able to reduce a rule,
41  /// this message is returned. The rule that was
42  /// reduced is set in the GOLDParser's ReduceRule property.
43  /// The tokens that are reduced and correspond the
44  /// rule's definition are stored in the Tokens() property.
45  /// </summary>
46  Reduction = 2,
47 
48  /// <summary>
49  /// The engine will returns this message when the source
50  /// text has been accepted as both complete and correct.
51  /// In other words, the source text was successfully analyzed.
52  /// </summary>
53  Accept = 3,
54 
55  /// <summary>
56  /// Before any parsing can take place,
57  /// a Compiled Grammar Table file must be loaded.
58  /// </summary>
59  NotLoadedError = 4,
60 
61  /// <summary>
62  /// The tokenizer will generate this message when
63  /// it is unable to recognize a series of characters
64  /// as a valid token. To recover, pop the invalid
65  /// token from the input queue.
66  /// </summary>
67  LexicalError = 5,
68 
69  /// <summary>
70  /// Often the parser will read a token that is not expected
71  /// in the grammar. When this happens, the Tokens() property
72  /// is filled with tokens the parsing engine expected to read.
73  /// To recover: push one of the expected tokens on the input queue.
74  /// </summary>
75  SyntaxError = 6,
76 
77  /// <summary>
78  /// The parser reached the end of the file while reading a comment.
79  /// This is caused when the source text contains a "run-away"
80  /// comment, or in other words, a block comment that lacks the
81  /// delimiter.
82  /// </summary>
83  CommentError = 7,
84 
85  /// <summary>
86  /// Something is wrong, very wrong.
87  /// </summary>
88  InternalError = 8,
89 
90  /// <summary>
91  /// A block comment is complete.
92  /// When this message is returned, the content of the CurrentComment
93  /// property is set to the comment text. The text includes starting and ending
94  /// block comment characters.
95  /// </summary>
96  CommentBlockRead = 9,
97 
98  /// <summary>
99  /// Line comment is read.
100  /// When this message is returned, the content of the CurrentComment
101  /// property is set to the comment text. The text includes starting
102  /// line comment characters.
103  /// </summary>
104  CommentLineRead = 10,
105  }
106 }
Often the parser will read a token that is not expected in the grammar. When this happens...
The tokenizer will generate this message when it is unable to recognize a series of characters as a v...
The parser reached the end of the file while reading a comment. This is caused when the source text c...
Line comment is read. When this message is returned, the content of the CurrentComment property is se...
Input successfully parsed
Before any parsing can take place, a Compiled Grammar Table file must be loaded.
Something is wrong, very wrong.
A block comment is complete. When this message is returned, the content of the CurrentComment propert...
Each time a token is read, this message is generated.
When the engine is able to reduce a rule, this message is returned. The rule that was reduced is set ...