Preprocessor Directive

Định nghĩa Preprocessor Directive là gì?

Preprocessor DirectivePreprocessor Chỉ thị. Đây là nghĩa tiếng Việt của thuật ngữ Preprocessor Directive - một thuật ngữ thuộc nhóm Technology Terms - Công nghệ thông tin.

Độ phổ biến(Factor rating): 5/10

Preprocessor chỉ là những đường có trong một chương trình bắt đầu với nhân vật #, mà làm cho họ khác nhau từ một văn bản mã nguồn điển hình. Họ được gọi bởi trình biên dịch để xử lý một số chương trình trước khi biên dịch. Preprocessor chỉ thị thay đổi nội dung của mã nguồn và kết quả là một mã nguồn mới không có những directives.Although tiền xử lý trong C # là khái niệm tương tự như trong C / C ++, nó là khác nhau ở hai khía cạnh. Thứ nhất, tiền xử lý trong C # không liên quan đến một bước riêng biệt để thực hiện tiền xử lý trước khi biên dịch. Nó được xử lý như một phần của giai đoạn phân tích từ vựng. Thứ hai, nó không thể được sử dụng để tạo các macro. Bên cạnh đó, các chỉ thị #region và #unregion mới đã được thêm vào trong C # cùng với việc loại trừ một số chỉ thị sử dụng trước đó (#include là một chỉ thị đáng chú ý mà sử dụng được thay thế bằng "sử dụng" bao gồm lắp ráp) java không hỗ trợ tiền xử lý chỉ thị.

Xem thêm: Thuật ngữ công nghệ A-Z

Giải thích ý nghĩa

Một chỉ thị tiền xử lý thường được đặt ở phía trên cùng của mã nguồn trong một dòng đầu riêng biệt với các ký tự "#", tiếp theo là tên chỉ thị và một khoảng trắng không bắt buộc trước và sau nó. Bởi vì một lời nhận xét trên cùng một dòng khai các chỉ thị tiền xử lý phải được sử dụng và không thể di chuyển qua các dòng sau, ý kiến ​​phân định không thể được sử dụng. Một tuyên bố chỉ thị tiền xử lý không phải kết thúc bằng dấu chấm phẩy (;). Preprocessor chỉ có thể được xác định trong mã nguồn hoặc trong dòng phổ biến như là đối số trong compilation.Examples cho tiền xử lý chỉ có thể được sử dụng trong C # bao gồm:

What is the Preprocessor Directive? - Definition

Preprocessor directives are lines included in a program that begin with the character #, which make them different from a typical source code text. They are invoked by the compiler to process some programs before compilation. Preprocessor directives change the text of the source code and the result is a new source code without these directives.Although preprocessing in C# is conceptually similar to that in C/C++, it is different in two aspects. First, preprocessing in C# does not involve a separate step for preprocessor execution before compilation. It is processed as a part of the lexical analysis phase. Second, it cannot be used to create macros. In addition, the new directives #region and #unregion have been added in C# along with the exclusion of some directives used earlier (#include is a notable directive whose use is replaced with "using" to include assemblies).Java does not support preprocessor directives.

Understanding the Preprocessor Directive

A preprocessor directive is usually placed in the top of the source code in a separate line beginning with the character "#", followed by directive name and an optional white space before and after it. Because a comment on the same line of declaration of the preprocessor directive has to be used and cannot scroll through the following line, delimited comments cannot be used. A preprocessor directive statement must not end with a semicolon (;). Preprocessor directives can be defined in source code or in the common line as argument during compilation.Examples for preprocessing directives that can be used in C# include:

Thuật ngữ liên quan

  • C Programming Language (C)
  • Compiler
  • Lexical Analysis
  • Macro
  • Java
  • Source Code
  • Command Line
  • Commit
  • Access Modifiers
  • Acyclic

Source: ? Technology Dictionary - Filegi - Techtopedia - Techterm

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *