Implement abstract syntax tree parsing of XML layout

This commit is contained in:
Keavon Chambers
2020-05-27 04:08:52 -07:00
parent decff5681b
commit 0c7e6bc883
22 changed files with 391 additions and 62 deletions
+23
View File
@@ -0,0 +1,23 @@
use crate::layout_abstract_attributes::*;
#[derive(Debug)]
pub struct LayoutAbstractSyntaxNode {
pub namespace: Option<String>,
pub name: String,
pub attributes: Vec<Attribute>,
}
impl LayoutAbstractSyntaxNode {
pub fn new(namespace: Option<String>, tag: String, attributes: &Vec<(String, String)>) -> Self {
for attribute in attributes {
let parsed = parse_attribute(&attribute.1[..]);
println!("{} : {:?} -> {:?}", attribute.0, attribute.1, parsed);
}
Self {
namespace,
name: tag,
attributes: Vec::new(),
}
}
}