changes to redefine the token list, the scanner, and the parser and how they pass around variable types of different sizes

not ready for change to FixedPoint just yet

made this more const correct and added a switch statement for easier reading
This commit is contained in:
RJ Catalano
2016-02-18 11:22:52 -06:00
parent fca27b9ea0
commit 7b918a7bc7
14 changed files with 284 additions and 293 deletions
+11 -14
View File
@@ -756,18 +756,17 @@ public:
class ElementaryTypeName: public TypeName
{
public:
ElementaryTypeName(SourceLocation const& _location, Token::Value _type):
TypeName(_location), m_type(_type)
{
solAssert(Token::isElementaryTypeName(_type), "");
}
ElementaryTypeName(SourceLocation const& _location, ElementaryTypeNameToken const& _elem):
TypeName(_location), m_type(_elem)
{}
virtual void accept(ASTVisitor& _visitor) override;
virtual void accept(ASTConstVisitor& _visitor) const override;
Token::Value typeName() const { return m_type; }
ElementaryTypeNameToken const& typeName() const { return m_type; }
private:
Token::Value m_type;
ElementaryTypeNameToken m_type;
};
/**
@@ -1408,18 +1407,16 @@ private:
class ElementaryTypeNameExpression: public PrimaryExpression
{
public:
ElementaryTypeNameExpression(SourceLocation const& _location, Token::Value _typeToken):
PrimaryExpression(_location), m_typeToken(_typeToken)
{
solAssert(Token::isElementaryTypeName(_typeToken), "");
}
ElementaryTypeNameExpression(SourceLocation const& _location, ElementaryTypeNameToken const& _type):
PrimaryExpression(_location), m_typeToken(_type)
{}
virtual void accept(ASTVisitor& _visitor) override;
virtual void accept(ASTConstVisitor& _visitor) const override;
Token::Value typeToken() const { return m_typeToken; }
ElementaryTypeNameToken const& typeName() const { return m_typeToken; }
private:
Token::Value m_typeToken;
ElementaryTypeNameToken m_typeToken;
};
/**