ptx_parser/parser/instruction/
pmevent.rs1#![allow(unused)]
7
8use crate::parser::{
9 PtxParseError, PtxParser, PtxTokenStream, Span,
10 util::{
11 between, comma_p, directive_p, exclamation_p, lbracket_p, lparen_p, map, minus_p, optional,
12 pipe_p, rbracket_p, rparen_p, semicolon_p, sep_by, string_p, try_map,
13 },
14};
15use crate::r#type::common::*;
16use crate::{alt, ok, seq_n};
17
18pub mod section_0 {
19 use super::*;
20 use crate::r#type::instruction::pmevent::section_0::*;
21
22 impl PtxParser for Pmevent {
23 fn parse() -> impl Fn(&mut PtxTokenStream) -> Result<(Self, Span), PtxParseError> {
24 try_map(
25 seq_n!(string_p("pmevent"), GeneralOperand::parse(), semicolon_p()),
26 |(_, a, _), span| {
27 ok!(Pmevent {
28 a = a,
29
30 })
31 },
32 )
33 }
34 }
35
36 impl PtxParser for PmeventMask {
37 fn parse() -> impl Fn(&mut PtxTokenStream) -> Result<(Self, Span), PtxParseError> {
38 try_map(
39 seq_n!(
40 string_p("pmevent"),
41 string_p(".mask"),
42 GeneralOperand::parse(),
43 semicolon_p()
44 ),
45 |(_, mask, a, _), span| {
46 ok!(PmeventMask {
47 mask = mask,
48 a = a,
49
50 })
51 },
52 )
53 }
54 }
55}