#define BACKSLASH '\\' #define bufsize 200/* size of internal buffers */ #define sc_size 5000/* size of save_com buffer */ #define label_offset 2/* number of levels a label is placed to left
* of code */
externchar *labbuf; /* buffer for label */ externchar *s_lab; /* start ... */ externchar *e_lab; /* .. and end of stored label */ externchar *l_lab; /* limit of label buffer */
externchar *codebuf; /* buffer for code section */ externchar *s_code; /* start ... */ externchar *e_code; /* .. and end of stored code */ externchar *l_code; /* limit of code section */
externchar *combuf; /* buffer for comments */ externchar *s_com; /* start ... */ externchar *e_com; /* ... and end of stored comments */ externchar *l_com; /* limit of comment buffer */
#define token s_token externchar *tokenbuf; /* the last token scanned */ externchar *s_token; externchar *e_token; externchar *l_token;
externchar *in_buffer; /* input buffer */ externchar *in_buffer_limit; /* the end of the input buffer */ externchar *buf_ptr; /* ptr to next character to be taken from
* in_buffer */ externchar *buf_end; /* ptr to first after last char in in_buffer */
externchar sc_buf[sc_size]; /* input text is saved here when looking for
* the brace after an if, while, etc */ externchar *save_com; /* start of the comment stored in sc_buf */ externchar *sc_end; /* pointer into save_com buffer */
externchar *bp_save; /* saved value of buf_ptr when taking input
* from save_com */ externchar *be_save; /* similarly saved value of buf_end */
externint found_err; externint blanklines_after_declarations; externint blanklines_before_blockcomments; externint blanklines_after_procs; externint blanklines_around_conditional_compilation; externint swallow_optional_blanklines; externint n_real_blanklines; externint prefix_blankline_requested; externint postfix_blankline_requested; externint break_comma; /* when true and not in parens, break after a
* comma */ externint btype_2; /* when true, brace should be on same line as
* if, while, etc */ externfloat case_ind; /* indentation level to be used for a "case
* n:" */ externint code_lines; /* count of lines with code */ externint had_eof; /* set to true when input is exhausted */ externint line_no; /* the current line number. */ externint max_col; /* the maximum allowable line length */ externint verbose; /* when true, non-essential error messages are
* printed */ externint cuddle_else; /* true if else should cuddle up to '}' */ externint star_comment_cont; /* true iff comment continuation lines should
* have stars at the beginning of each line. */ externint comment_delimiter_on_blankline; externint troff; /* true iff were generating troff input */ externint procnames_start_line; /* if true, the names of procedures *beingdefinedgetplacedincolumn *1(ie.anewlineisplacedbetween *thetypeoftheprocedureandits
* name) */ externint proc_calls_space; /* If true, procedure calls look like:
* foo(bar) rather than foo (bar) */ externint format_block_comments; /* true if comments beginning with
* `/ * \n' are to be reformatted */ externint format_col1_comments; /* If comments which start in column 1 *aretobemagicallyreformatted *(justlikecommentsthatbeginin
* later columns) */ externint inhibit_formatting; /* true if INDENT OFF is in effect */ externint suppress_blanklines;/* set iff following blanklines should be
* suppressed */ externint continuation_indent;/* set to the indentation between the edge of
* code and continuation lines */ externint lineup_to_parens; /* if true, continued code within parens will
* be lined up to the open paren */ externint lineup_to_parens_always; /* if true, do not attempt to keep
* lined-up code within the margin */ externint Bill_Shannon; /* true iff a blank should always be inserted
* after sizeof */ externint blanklines_after_declarations_at_proctop; /* This is vaguely *similarto *blanklines_after_decla *rationsexceptthat *itonlyappliesto *thefirstsetof *declarationsina *procedure(justafter *thefirst'{')andit *causesablankline *tobegeneratedeven *ifthereareno
* declarations */ externint block_comment_max_col; externint extra_expression_indent; /* true if continuation lines from the *expressionpartof"if(e)", *"while(e)","for(e;e;e)"shouldbe *indentedanextratabstopsothat *theydon'tconflictwiththecode
* that follows */ externint function_brace_split; /* split function declaration and
* brace onto separate lines */ externint use_tabs; /* set true to use tabs for spacing,
* false uses all spaces */ externint auto_typedefs; /* set true to recognize identifiers
* ending in "_t" like typedefs */ externint space_after_cast; /* "b = (int) a" vs "b = (int)a" */ externint postgres_tab_rules; /* use Postgres tab-vs-space rules */ externint tabsize; /* the size of a tab */ externint else_endif_com_ind; /* the column in which comments to *therightof#elseand#endif
* should start */
externint ifdef_level;
struct parser_state { int last_token; int p_stack[256]; /* this is the parsers stack */ int il[64]; /* this stack stores indentation levels */ float cstk[32]; /* used to store case stmt indentation levels */ int box_com; /* set to true when we are in a "boxed" *comment.Inthatcase,thefirstnon-blank
* char should be lined up with the / in / followed by * */ int comment_delta; /* used to set up indentation for all lines
* of a boxed comment after the first one */ int n_comment_delta;/* remembers how many columns there were *beforethestartofaboxcommentsothat *forthcominglinesofthecommentare
* indented properly */ int cast_mask; /* indicates which close parens potentially
* close off casts */ int not_cast_mask; /* indicates which close parens definitely
* close off something else than casts */ int block_init; /* true iff inside a block initialization */ int block_init_level; /* The level of brace nesting in an
* initialization */ int last_nl; /* this is true if the last thing scanned was
* a newline */ int in_or_st; /* Will be true iff there has been a *declarator(e.g.intorchar)andnoleft *parensincethelastsemicolon.Whentrue, *a'{'isstartingastructuredefinitionor
* an initialization list */ int bl_line; /* set to 1 by dump_line if the line is blank */ int col_1; /* set to true if the last token started in
* column 1 */ int com_col; /* this is the column in which the current
* comment should start */ int com_ind; /* the column in which comments to the right
* of code should start */ int com_lines; /* the number of lines with comments, set by
* dump_line */ int dec_nest; /* current nesting level for structure or init */ int decl_com_ind; /* the column in which comments after
* declarations should be put */ int decl_on_line; /* set to true if this line of code has part
* of a declaration on it */ int i_l_follow; /* the level to which ind_level should be set
* after the current line is printed */ int in_decl; /* set to true when we are in a declaration *stmt.Theprocessingofbracesisthen
* slightly different */ int in_stmt; /* set to 1 while in a stmt */ int ind_level; /* the current indentation level */ int ind_size; /* the size of one indentation level */ int ind_stmt; /* set to 1 if next line should have an extra *indentationlevelbecauseweareinthe
* middle of a stmt */ int last_u_d; /* set to true after scanning a token which
* forces a following operator to be unary */ int leave_comma; /* if true, never break declarations after
* commas */ int ljust_decl; /* true if declarations should be left
* justified */ int out_coms; /* the number of comments processed, set by
* pr_comment */ int out_lines; /* the number of lines written, set by
* dump_line */ int p_l_follow; /* used to remember how to indent following
* statement */ int paren_level; /* parenthesization level. used to indent
* within statements */ short paren_indents[20]; /* column positions of each paren */ int pcase; /* set to 1 if the current line label is a *case.Itisprinteddifferentlyfroma
* regular label */ int search_brace; /* set to true by parse when it is necessary *tobufferupallinfouptothestartofa
* stmt after an if, while, etc */ int unindent_displace; /* comments not to the right of code *willbeplacedthismany *indentationlevelstotheleftof
* code */ int use_ff; /* set to one if the current line should be
* terminated with a form feed */ int want_blank; /* set to true when the following token should *beprefixedbyablank.(Saidprefixingis
* ignored in some cases.) */ int else_if; /* True iff else if pairs should be handled
* specially */ int decl_indent; /* column to indent declared identifiers to */ int local_decl_indent; /* like decl_indent but for locals */ int keyword; /* the type of a keyword or 0 */ int dumped_decl_indent; float case_indent; /* The distance to indent case labels from the
* switch statement */ int in_parameter_declaration; int indent_parameters; int tos; /* pointer to top of stack */ char procname[100]; /* The name of the current procedure */ int just_saw_decl;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.