ParserErrors
Errors that can happing whilest parsing the source code.
error{ParsingError} || Allocator.ErrorDeinit
Clears any allocated memory.
Signature
pub fn deinit(self: *Parser) voidParseSource
Parses all of the source and build the Ast.
Signature
pub fn parseSource(self: *Parser) ParserErrors!voidParseUnits
Parsers all of the solidity source unit values.
More info can be found here
Signature
pub fn parseUnits(self: *Parser) ParserErrors!Node.RangeExpectUnit
Expects to find a source unit otherwise it will fail.
Signature
pub fn expectUnit(self: *Parser) ParserErrors!Node.IndexParseUnit
Parses a single source unit.
More info can be found here
Signature
pub fn parseUnit(self: *Parser) ParserErrors!Node.IndexParseFunctionProto
Parses a solidity function accordingly to the language grammar.
Signature
pub fn parseFunctionProto(self: *Parser) ParserErrors!Node.IndexParseReceiveProto
Parses a solidity receive function accordingly to the language grammar.
Signature
pub fn parseReceiveProto(self: *Parser) ParserErrors!Node.IndexParseFallbackProto
Parses a solidity fallback function accordingly to the language grammar.
Signature
pub fn parseFallbackProto(self: *Parser) ParserErrors!Node.IndexParseConstructorProto
Parses a solidity constructor declaration accordingly to the language grammar.
Signature
pub fn parseConstructorProto(self: *Parser) ParserErrors!Node.IndexParseSpecifiers
Parses all of the solidity mutability or visibility specifiers.
Signature
pub fn parseSpecifiers(self: *Parser) ParserErrors!Node.IndexParseErrorProto
Parses a solidity error declaration accordingly to the language grammar.
Signature
pub fn parseErrorProto(self: *Parser) ParserErrors!Node.IndexParseEventProto
Parses a solidity event declaration accordingly to the language grammar.
Signature
pub fn parseEventProto(self: *Parser) ParserErrors!Node.IndexParseEventVarDecls
Parses the possible event declaration parameters according to the language grammar.
Signature
pub fn parseEventVarDecls(self: *Parser) ParserErrors!SpanParseErrorVarDecls
Parses the possible error declaration parameters according to the language grammar.
Signature
pub fn parseErrorVarDecls(self: *Parser) ParserErrors!SpanParseReturnParams
Parses the possible function declaration parameters according to the language grammar.
Signature
pub fn parseReturnParams(self: *Parser) ParserErrors!Node.RangeParseVariableDecls
Parses the possible function declaration parameters according to the language grammar.
Signature
pub fn parseVariableDecls(self: *Parser) ParserErrors!SpanExpectErrorVarDecl
Expects to find a error_var_decl. Otherwise returns an error.
Signature
pub fn expectErrorVarDecl(self: *Parser) ParserErrors!Node.IndexParseErrorVarDecl
Parses the possible error declaration parameter according to the language grammar.
Signature
pub fn parseErrorVarDecl(self: *Parser) ParserErrors!Node.IndexExpectEventVarDecl
Expects to find a event_var_decl. Otherwise returns an error.
Signature
pub fn expectEventVarDecl(self: *Parser) ParserErrors!Node.IndexParseEventVarDecl
Parses the possible event declaration parameter according to the language grammar.
Signature
pub fn parseEventVarDecl(self: *Parser) ParserErrors!Node.IndexExpectVarDecl
Expects to find a var_decl. Otherwise returns an error.
Signature
pub fn expectVarDecl(self: *Parser) ParserErrors!Node.IndexParseVariableDecl
Parses the possible function declaration parameter according to the language grammar.
Signature
pub fn parseVariableDecl(self: *Parser) ParserErrors!Node.IndexParseStructDecl
Parses a struct declaration according to the language grammar.
Signature
pub fn parseStructDecl(self: *Parser) ParserErrors!Node.IndexParseStructFields
Parses all of the structs fields according to the language grammar.
Signature
pub fn parseStructFields(self: *Parser) ParserErrors!SpanExpectStructField
Expects to find a struct parameter or fails.
Signature
pub fn expectStructField(self: *Parser) ParserErrors!Node.IndexExpectType
Expects to find either a elementary_type, tuple_type, tuple_type_one, array_type or struct_type
Signature
pub fn expectType(self: *Parser) ParserErrors!Node.IndexParseType
Parses the token into either a elementary_type, tuple_type, tuple_type_one, array_type or struct_type
Signature
pub fn parseType(self: *Parser) ParserErrors!Node.IndexParseTupleType
Parses the tuple type similarly to parseErrorVarDecls.
Signature
pub fn parseTupleType(self: *Parser) ParserErrors!Node.IndexConsumeElementaryType
Creates a elementary_type node based on the solidity type keywords.
Signature
pub fn consumeElementaryType(self: *Parser) Allocator.Error!Node.Index