Comprehensive Rust(한국어) 202412Iterator- Token, TokenizerError>>를구현하도록 Tokenizer 를 업데이트하고 파서에서 처리합니다. use std::iter::Peekable; use std::str::Chars; /// 산술 연산자입니다. enum Op { Add, Sub, } /// 표현식 언어의 토큰입니다. enum Token { Number(String) Tokenizer<'a>(Peekable
>); impl<'a> Iterator for Tokenizer<'a> { type Item = Token; fn next(&mut self) -> Option<Token> { let c = self.0.next()?; match c { '0'..='9' => { let mut num = String::from(c); } Some(Token::Number(num)) } 'a'..='z' => { let mut ident = String::from(c); while let Some(c @ ('a'..='z' | '_' | '0'..='9')) = self.0.peek() { ident.push(*c); self.0.next(); } Some(Token::Identifier(ident)) 0 码力 | 369 页 | 1.29 MB | 10 月前3- Token, TokenizerError>>를구현하도록 Tokenizer 를 업데이트하고 파서에서 처리합니다. use std::iter::Peekable; use std::str::Chars; /// 산술 연산자입니다. enum Op { Add, Sub, } /// 표현식 언어의 토큰입니다. enum Token { Number(String) Tokenizer<'a>(Peekable
Comprehensive RustIterator- Token, TokenizerError>>를구현하도록 Tokenizer 를 업데이트하고 파서에서 처리합니다. use std::iter::Peekable; use std::str::Chars; /// 산술 연산자입니다. enum Op { Add, Sub, } /// 표현식 언어의 토큰입니다. enum Token { Number(String) Tokenizer<'a>(Peekable
>); impl<'a> Iterator for Tokenizer<'a> { type Item = Token; fn next(&mut self) -> Option<Token> { let c = self.0.next()?; match c { '0'..='9' => { let mut num = String::from(c); } Some(Token::Number(num)) } 'a'..='z' => { let mut ident = String::from(c); while let Some(c @ ('a'..='z' | '_' | '0'..='9')) = self.0.peek() { ident.push(*c); self.0.next(); } Some(Token::Identifier(ident)) 0 码力 | 368 页 | 1.29 MB | 1 年前3- Token, TokenizerError>>를구현하도록 Tokenizer 를 업데이트하고 파서에서 처리합니다. use std::iter::Peekable; use std::str::Chars; /// 산술 연산자입니다. enum Op { Add, Sub, } /// 표현식 언어의 토큰입니다. enum Token { Number(String) Tokenizer<'a>(Peekable
PlantUML 을사용해서 UML 그리기 - PlantUML 언어참조가이드(Version 1.2019.2)다른다이어그램에는다른규칙이적용된다. @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response @enduml 1.2 참여자선언 declare: participant L as "I have a really\nlong name" #99FF99 '/ Alice->Bob: Authentication Request Bob->Alice: Authentication Response Bob->L: Log transaction @enduml You can use the orderkeyword to custom 된다. @startuml autonumber Bob -> Alice : Authentication Request PlantUML 언어참조가이드 (1.2019.2) 4 / 157 1.7 메시지순서에번호매기기 1 시퀀스다이어그램 Bob <- Alice : Authentication Response @enduml autonumber 시작번호의형태로표시하면특정번호로시작할수있으며0 码力 | 158 页 | 1.76 MB | 1 年前3
PlantUML 1.2019.4 언어참조가이드다른다이어그램에는다른규칙이적용된다. @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response @enduml 1.2 참여자선언 declare: participant L as "I have a really\nlong name" #99FF99 '/ Alice->Bob: Authentication Request Bob->Alice: Authentication Response Bob->L: Log transaction @enduml You can use the orderkeyword to custom 된다. @startuml autonumber Bob -> Alice : Authentication Request PlantUML 언어참조가이드 (1.2019.4) 4 / 165 1.7 메시지순서에번호매기기 1 시퀀스다이어그램 Bob <- Alice : Authentication Response @enduml autonumber 시작번호의형태로표시하면특정번호로시작할수있으며0 码力 | 166 页 | 1.86 MB | 1 年前3
PlantUML 1.2019.1 언어참조가이드다른다이어그램에는다른규칙이적용된다. @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response @enduml 1.2 참여자선언 declare: participant L as "I have a really\nlong name" #99FF99 '/ Alice->Bob: Authentication Request Bob->Alice: Authentication Response Bob->L: Log transaction @enduml You can use the orderkeyword to custom autonumber 키워드의경우메시지에자동으로번호매길대에사용된다. @startuml autonumber Bob -> Alice : Authentication Request Bob <- Alice : Authentication Response @enduml PlantUML 언어참조가이드 (1.2019.1) 4 / 145 1.7 메시지순서에번호매기기 1 시퀀스다이어그램0 码力 | 146 页 | 1.89 MB | 1 年前3
PlantUML 을사용해서 UML 그리기 - PlantUML 언어참조가이드(Version 1.2019.3)다른다이어그램에는다른규칙이적용된다. @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response @enduml 1.2 참여자선언 declare: participant L as "I have a really\nlong name" #99FF99 '/ Alice->Bob: Authentication Request Bob->Alice: Authentication Response Bob->L: Log transaction @enduml You can use the orderkeyword to custom 된다. @startuml autonumber Bob -> Alice : Authentication Request PlantUML 언어참조가이드 (1.2019.3) 4 / 157 1.7 메시지순서에번호매기기 1 시퀀스다이어그램 Bob <- Alice : Authentication Response @enduml autonumber 시작번호의형태로표시하면특정번호로시작할수있으며0 码力 | 158 页 | 1.76 MB | 1 年前3
PlantUML 을사용해서 UML 그리기 - PlantUML 언어참조가이드(Version 1.2019.9)다른다이어그램에는다른규칙이적용된다. @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response @enduml 1.2 참여자 (participant) declare: participant L as "I have a really\nlong name" #99FF99 '/ Alice->Bob: Authentication Request Bob->Alice: Authentication Response Bob->L: Log transaction @enduml order 키워드를이용하여, 참여자의출력순서를지정할수있다. 한다. @startuml autonumber Bob -> Alice : Authentication Request PlantUML 언어참조가이드 (1.2019.9) 4 / 171 1.7 메시지순서에번호매기기 1 시퀀스다이어그램 Bob <- Alice : Authentication Response @enduml autonumber 시작번호의형태로표시하면특정번호로시작할수있으며0 码力 | 172 页 | 1.97 MB | 1 年前3
PlantUML 1.2019.6 언어참조가이드다른다이어그램에는다른규칙이적용된다. @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response @enduml 1.2 참여자 (participant) declare: participant L as "I have a really\nlong name" #99FF99 '/ Alice->Bob: Authentication Request Bob->Alice: Authentication Response Bob->L: Log transaction @enduml order 키워드를이용하여, 참여자의출력순서를지정할수있다. 한다. @startuml autonumber Bob -> Alice : Authentication Request PlantUML 언어참조가이드 (1.2019.6) 4 / 171 1.7 메시지순서에번호매기기 1 시퀀스다이어그램 Bob <- Alice : Authentication Response @enduml autonumber 시작번호의형태로표시하면특정번호로시작할수있으며0 码力 | 172 页 | 1.95 MB | 1 年前3
PlantUML 을사용해서 UML 그리기 - PlantUML 언어참조가이드(Version 1.2020.23)다른다이어그램에는다른규칙이적용된다. @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response @enduml 1.2 참여자 (participant) declare: participant L as "I have a really\nlong name" #99FF99 '/ Alice->Bob: Authentication Request Bob->Alice: Authentication Response Bob->L: Log transaction @enduml order 키워드를이용하여, 참여자의출력순서를지정할수있다. autonumber 키워드는메시지에자동으로번호를매길때에사용한다. @startuml autonumber Bob -> Alice : Authentication Request Bob <- Alice : Authentication Response @enduml autonumber //시작번호// 의형태로표시하면특정번호로시작할수있으며, autonumber //시작번호//0 码力 | 307 页 | 3.16 MB | 1 年前3
PlantUML 1.2020.22 언어참조가이드다른다이어그램에는다른규칙이적용된다. @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: another authentication Response @enduml 1.2 참여자 (participant) declare: participant L as "I have a really\nlong name" #99FF99 '/ Alice->Bob: Authentication Request Bob->Alice: Authentication Response Bob->L: Log transaction @enduml order 키워드를이용하여, 참여자의출력순서를지정할수있다. autonumber 키워드는메시지에자동으로번호를매길때에사용한다. @startuml autonumber Bob -> Alice : Authentication Request Bob <- Alice : Authentication Response @enduml autonumber //시작번호// 의형태로표시하면특정번호로시작할수있으며, autonumber //시작번호//0 码力 | 295 页 | 3.08 MB | 1 年前3
共 14 条
- 1
- 2













