diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-12-26 00:03:07 -0800 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-12-26 00:03:09 -0800 |
commit | 957c2f75ceccfab3d8a8e546961db5f053876689 (patch) | |
tree | 5eae47044a720fa29b1f9396f54b7db9a482de4d /modelica-parser-lalrpop/src/ast.rs | |
parent | 1e04c8274e473039d2b183c120ab7f3b1b981c3e (diff) | |
download | modelthing-957c2f75ceccfab3d8a8e546961db5f053876689.tar.gz modelthing-957c2f75ceccfab3d8a8e546961db5f053876689.zip |
radically simplify scope of parsing
Parsing arbitrary files, packages, blocks, connectors, etc caused the
compilation time for this parser to explode exponentially, and resulted in huge
parser.rs and executable files.
This commit rips out all those features.
Diffstat (limited to 'modelica-parser-lalrpop/src/ast.rs')
-rw-r--r-- | modelica-parser-lalrpop/src/ast.rs | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/modelica-parser-lalrpop/src/ast.rs b/modelica-parser-lalrpop/src/ast.rs index 52e91b8..7eb9dda 100644 --- a/modelica-parser-lalrpop/src/ast.rs +++ b/modelica-parser-lalrpop/src/ast.rs @@ -3,61 +3,6 @@ use std::clone::Clone; use std::fmt::{Debug, Formatter, Error}; use std::collections::HashMap; -// This represents a block of Modelica code. -// A valid .mo file will be a sequence of these -#[derive(Clone, PartialEq)] -pub enum ModelicaCode { - Class, // unimpl; generic - Model(ModelicaModel), - Record(ModelicaRecord), - Block(ModelicaBlock), - Connector(ModelicaConnector), - Type(ModelicaType), - Package(ModelicaPackage), - Function, // unimpl -} - -// A package is basically a namespace; they can be nested and contain any other -// code chunks (models, etc). -// They are optional; models don't need to live in a package to be valid. -#[derive(Clone, PartialEq)] -pub struct ModelicaPackage { - pub name: String, - pub description: Option<String>, - pub children: Vec<ModelicaCode>, -} - -#[derive(Clone, PartialEq)] -pub struct ModelicaType { - pub name: String, - pub description: Option<String>, - pub component: ComponentDeclaration, -} - -#[derive(Clone, PartialEq)] -pub struct ModelicaBlock { - pub name: String, - pub description: Option<String>, - pub components: Vec<Component>, - pub public_components: Vec<Component>, - pub protected_components: Vec<Component>, - pub equations: Vec<SimpleEquation>, - pub connections: Vec<Connection>, -} - -#[derive(Clone, PartialEq)] -pub struct ModelicaConnector { - pub name: String, - pub description: Option<String>, - pub components: Vec<Component>, -} - -#[derive(Clone, PartialEq)] -pub struct ModelicaRecord { - pub name: String, - pub description: Option<String>, - pub components: Vec<Component>, -} #[derive(Clone, PartialEq)] pub struct ModelicaModel { |