Removed @wire from schema
This commit is contained in:
1 parent
5ccd9b2fa4
commit
9ff6633777
5 files changed
+8
-87
No files matched your search
@@ -302,13 +302,6 @@ struct LibraryNode: public AstNode
|
||||
};
|
||||
|
||||
// SCHEMA models
|
||||
struct WireInstanceNode: public AstNode
|
||||
{
|
||||
IdentifierNode name;
|
||||
std::optional<CountNode> position;
|
||||
std::optional<DisplayNode> display;
|
||||
};
|
||||
|
||||
struct InstanceAttributeNode: public AstNode
|
||||
{
|
||||
IdentifierNode name;
|
||||
@@ -338,7 +331,6 @@ struct ConnectionInstanceNode: public AstNode
|
||||
std::optional<ConnectionComponentInstance> second;
|
||||
|
||||
IdentifierNode bus;
|
||||
std::optional<IdentifierNode> wire;
|
||||
|
||||
std::vector<InstanceAttributeNode> attributes;
|
||||
};
|
||||
@@ -349,7 +341,6 @@ struct SchemaNode: public AstNode
|
||||
std::optional<StringNode> source;
|
||||
|
||||
std::vector<InstanceNode> instances;
|
||||
std::vector<WireInstanceNode> wires;
|
||||
std::vector<ConnectionInstanceNode> connections;
|
||||
|
||||
std::optional<LibraryNode> library;
|
||||
|
||||
@@ -1170,8 +1170,6 @@ std::optional<SchemaNode> ComdelParser::parseSchema() {
|
||||
PResult<poly<AstNode>> err;
|
||||
if(check(TokenType::KW_INSTANCE)){
|
||||
APPEND_OR_SET_ERR(schema.instances, parseInstance());
|
||||
} else if(check(TokenType::KW_WIRE)) {
|
||||
APPEND_OR_SET_ERR(schema.wires, parseWireInstance());
|
||||
} else if(check(TokenType::KW_CONNECTION)) {
|
||||
APPEND_OR_SET_ERR(schema.connections, parseConnectionInstance());
|
||||
} else {
|
||||
@@ -1181,6 +1179,10 @@ std::optional<SchemaNode> ComdelParser::parseSchema() {
|
||||
if(!err.has_value()) {
|
||||
errors.push_back(err.error());
|
||||
skipUntilNextKeyword();
|
||||
if(check(TokenType::END_OF_FILE)) {
|
||||
errors.emplace_back(current().span, "expected `}` reached EOF");
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!check(TokenType::RBRACE)) {
|
||||
@@ -1199,38 +1201,6 @@ std::optional<SchemaNode> ComdelParser::parseSchema() {
|
||||
|
||||
return spanner(schema);
|
||||
}
|
||||
PResult<WireInstanceNode> ComdelParser::parseWireInstance() {
|
||||
auto spanner = getSpanner();
|
||||
WireInstanceNode wireInstance;
|
||||
|
||||
RETURN_IF_NOT_TOKEN(TokenType::KW_WIRE);
|
||||
ASSIGN_OR_RETURN_IF_ERR(wireInstance.name, parseIdentifier());
|
||||
RETURN_IF_NOT_TOKEN(TokenType::LBRACE);
|
||||
|
||||
while(!check(TokenType::RBRACE)) {
|
||||
PResult<poly<AstNode>> err;
|
||||
if(check(TokenType::KW_POSITION)) {
|
||||
ASSIGN_OR_SET_ERR(wireInstance.position, parsePosition());
|
||||
} else if(check(TokenType::KW_DISPLAY)) {
|
||||
ASSIGN_OR_SET_ERR(wireInstance.display, parseDisplay());
|
||||
} else {
|
||||
err = unexpected();
|
||||
}
|
||||
if(!err.has_value()) {
|
||||
errors.push_back(err.error());
|
||||
skipUntilNextKeyword();
|
||||
if(check(TokenType::END_OF_FILE)) {
|
||||
return PError({Span(spanner.lo), "Reached EOF"});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_IF_NOT_TOKEN(TokenType::RBRACE);
|
||||
|
||||
return spanner(wireInstance);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
@@ -1333,13 +1303,11 @@ PResult<ConnectionInstanceNode> ComdelParser::parseConnectionInstance() {
|
||||
|
||||
while(!check(TokenType::RBRACE)) {
|
||||
PResult<poly<AstNode>> err;
|
||||
if(check(TokenType::KW_WIRE)) {
|
||||
bump();
|
||||
ASSIGN_OR_SET_ERR(connection.wire, parseIdentifier());
|
||||
} else if(check(TokenType::KW_ATTRIBUTE)) {
|
||||
if(check(TokenType::KW_ATTRIBUTE)) {
|
||||
APPEND_OR_SET_ERR(connection.attributes, parseInstanceAttribute());
|
||||
} else {
|
||||
err = unexpected();
|
||||
bump();
|
||||
}
|
||||
if(!err.has_value()) {
|
||||
errors.push_back(err.error());
|
||||
|
||||
@@ -88,7 +88,6 @@ private:
|
||||
PResult<ValueNode> parseValue();
|
||||
|
||||
|
||||
PResult<WireInstanceNode> parseWireInstance();
|
||||
PResult<CountNode> parsePosition();
|
||||
PResult<InstanceNode> parseInstance();
|
||||
PResult<InstanceAttributeNode> parseInstanceAttribute();
|
||||
|
||||
Reference in new issue
Block a user