C# 클래스 LexicalAnalysis.FSAChar

The FSA for scanning a C character. Note that this FSA doesn't scan the surrounding quotes. It is used in both FSACharConst and FSAString. There are multiple ways to represent a character: * A normal character : any character other than \\ \n or [quote] Note that [quote] might be \' or \" depending on the context. For example, inside a String, single quote are allowed, which means that the following code is legal: Char *str = "single quote here: ' see that?"; However, if we need a double quote inside a String, we have to use an escape character, like this: Char *str = "double quote needs to be escaped: \" "; Inside a Char, double quotes are allowed while single quotes need to be escaped. Char double_quote = '"'; // allowed Char single_quote = '\''; // needs to be escaped * An escape character : \a \b \f \n \r \t \v \' \" \\ \? Note that even though \' and \" might not needs to be escaped, you can always use them as escaped. If you escape a character not listed above, the behavior is undefined in the standard. I'll just assume you need the unescaped character. For example, if you typed '\c', then I'll just treat it as 'c'. * An octal number after a backslash. For example : \123. * A hexadecimal number after a backslash and an 'x' or 'X'. FOr example : \xFF.
상속: FSA
파일 보기 프로젝트 열기: phisiart/C-Compiler 1 사용 예제들

공개 메소드들

메소드 설명
FSAChar ( Char quote ) : System
GetStatus ( ) : FSAStatus
ReadChar ( Char ch ) : void
ReadEOF ( ) : void
Reset ( ) : void
RetrieveChar ( ) : Char
RetrieveRaw ( ) : String
RetrieveToken ( ) : Token

비공개 메소드들

메소드 설명
IsChar ( Char ch ) : System.Boolean

메소드 상세

FSAChar() 공개 메소드

public FSAChar ( Char quote ) : System
quote Char
리턴 System

GetStatus() 공개 메소드

public GetStatus ( ) : FSAStatus
리턴 FSAStatus

ReadChar() 공개 메소드

public ReadChar ( Char ch ) : void
ch Char
리턴 void

ReadEOF() 공개 메소드

public ReadEOF ( ) : void
리턴 void

Reset() 공개 메소드

public Reset ( ) : void
리턴 void

RetrieveChar() 공개 메소드

public RetrieveChar ( ) : Char
리턴 Char

RetrieveRaw() 공개 메소드

public RetrieveRaw ( ) : String
리턴 String

RetrieveToken() 공개 메소드

public RetrieveToken ( ) : Token
리턴 Token