ptx_parser/parser/instruction/
nanosleep.rs

1//! Original PTX specification:
2//!
3//! nanosleep.u32 t;
4
5#![allow(unused)]
6
7use crate::lexer::PtxToken;
8use crate::parser::{PtxParseError, PtxParser, PtxTokenStream, Span};
9use crate::r#type::common::*;
10
11pub mod section_0 {
12    use super::*;
13    use crate::r#type::instruction::nanosleep::section_0::*;
14
15    impl PtxParser for NanosleepU32 {
16        fn parse(stream: &mut PtxTokenStream) -> Result<Self, PtxParseError> {
17            stream.expect_string("nanosleep")?;
18            stream.expect_string(".u32")?;
19            let u32 = ();
20            stream.expect_complete()?;
21            let t = GeneralOperand::parse(stream)?;
22            stream.expect_complete()?;
23            stream.expect_complete()?;
24            stream.expect(&PtxToken::Semicolon)?;
25            Ok(NanosleepU32 { u32, t })
26        }
27    }
28}