internal override void Parse(ObjWastTranspiler transpiler) { string instructionName = transpiler.ParseName(); if (transpiler.PeekSignificant() == '.') { instructionName += transpiler.Read(); instructionName += transpiler.ParseName(); } var context = Create(() => new ObjWastInstructionContext(this, instructionName)); context.Parse(transpiler); }
internal override void Parse(ObjWastTranspiler transpiler) { // ex. (func private $test (param i32) (result i32) (local i32) ... ) if (identifier == null && !parseBody) { string name = transpiler.ParseName(); access = OwMemberAccess.Private; if (!string.IsNullOrWhiteSpace(name)) { var tempAccess = transpiler.ParseAccess(name); if (tempAccess == null) { throw new Exception(); } access = tempAccess.Value; } identifier = transpiler.ParseIdentifier(); return; } parseBody = true; }
internal override ObjWastTranspilerContext GetContext(string statement, ObjWastTranspiler transpiler) { string instructionName = statement; if (transpiler.PeekSignificant() == '.') { instructionName += transpiler.Read(); instructionName += transpiler.ParseName(); } return(Create(() => new ObjWastInstructionContext(this, instructionName))); }
internal override void Parse(ObjWastTranspiler transpiler) { string identifier = null; OwMemberAccess access = OwMemberAccess.Private; OwType type; string name = transpiler.ParseName(); if (string.IsNullOrWhiteSpace(name)) { // ex. (field $test i32) identifier = transpiler.ParseIdentifier(); if (identifier == null) { throw new Exception(); } type = transpiler.ParseType(@struct.Module); } else { // ex. (field i32) // ex. (field private i32) // ex. (field private $test i32) OwMemberAccess?tempAccess = transpiler.ParseAccess(name); if (tempAccess == null) { // ex. (field i32) type = transpiler.ParseType(@struct.Module, name); } else { // ex. (field private i32) // ex. (field private $test i32) access = tempAccess.Value; identifier = transpiler.ParseIdentifier(); type = transpiler.ParseType(@struct.Module); } } @struct.DefineField(access, identifier, type); }
internal override void Parse(ObjWastTranspiler transpiler) { string name = transpiler.ParseName(); type = Module.DefineType(name); }