Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
GrammarData.cs
Go to the documentation of this file.
1 #region License
2 /* **********************************************************************************
3  * Copyright (c) Roman Ivantsov
4  * This source code is subject to terms and conditions of the MIT License
5  * for Irony. A copy of the license can be found in the License.txt file
6  * at the root of this distribution.
7  * By using this source code in any fashion, you are agreeing to be bound by the terms of the
8  * MIT License.
9  * You must not remove this notice from this software.
10  * **********************************************************************************/
11 #endregion
12 
13 using System;
14 using System.Collections.Generic;
15 using System.Linq;
16 using System.Text;
17 
18 namespace Irony.Parsing {
19 
20  //GrammarData is a container for all basic info about the grammar
21  // GrammarData is a field in LanguageData object.
22  public class GrammarData {
23  public readonly LanguageData Language;
24  public readonly Grammar Grammar;
26  public NonTerminalSet AugmentedSnippetRoots = new NonTerminalSet();
27  public readonly BnfTermSet AllTerms = new BnfTermSet();
28  public readonly TerminalList Terminals = new TerminalList();
29  public readonly NonTerminalList NonTerminals = new NonTerminalList();
30  public readonly StringSet ClosingBraces = new StringSet();
31  public string WhitespaceAndDelimiters { get; internal set; }
32 
33  public GrammarData(LanguageData language) {
34  Language = language;
35  Grammar = language.Grammar;
36  }
37 
38  }//class
39 
40 
41  [Flags]
42  public enum LanguageFlags {
43  None = 0,
44 
45  //Compilation options
46  //Be careful - use this flag ONLY if you use NewLine terminal in grammar explicitly!
47  // - it happens only in line-based languages like Basic.
48  NewLineBeforeEOF = 0x01,
49  //Emit LineStart token
50  EmitLineStartToken = 0x02,
51  DisableScannerParserLink = 0x04, //in grammars that define TokenFilters (like Python) this flag should be set
52  CreateAst = 0x08, //create AST nodes
53 
54  //Runtime
55  CanRunSample = 0x0100,
56  SupportsCommandLine = 0x0200,
57  TailRecursive = 0x0400, //Tail-recursive language - Scheme is one example
58 
59  //Default value
60  Default = None,
61  }
62 
63  //Operator associativity types
64  public enum Associativity {
65  Left,
66  Right,
67  Neutral //don't know what that means
68  }
69 
70  [Flags]
71  public enum TermListOptions {
72  None = 0,
74  }
75 
76 }//namespace
Flags
Enumeration of the new Assimp's flags.
readonly Grammar Grammar
Definition: GrammarData.cs:24
Describes a language.
Definition: LanguageData.cs:23
readonly LanguageData Language
Definition: GrammarData.cs:23
GrammarData(LanguageData language)
Definition: GrammarData.cs:33