내가 사용하는 정규 표현식은 전처리 기의 구현을위한 것입니다. 이 전처리 기는 매우 간단합니다. 그것은 규칙에 따라 순종 :"#"으로 시작하지만 #define이 아닌 모든 텍스트의 정규식
- 처리기 지시어는
- 처리기 식별자의 사용 사례는
#
기호로 시작 대문자로 식별자 다음에 #DEFINE 시작합니다. 예를 들어
는 : 내가 한
#define CONSTANT 100
//...
int x = #CONSTANT;
그래서 우선 문자열은 'D'다음에 또는 다음이 아닌 '#'로 시작
#define {
//store the identifier following #define in a lookup table
//do the relevant error checking
}
NO_POUND_DEFINE {
//The string should begin with a '#' sign but not with `#define`
//check if the string following '#' is upper case or not
//if in upper case do the lookup otherwise throw an error
}
어떤 언어입니까? #define과 일치하는'# define'은 어떨까요? – NullUserException