scripts/genksyms/lex.l

Source file repositories/reference/linux-study-clean/scripts/genksyms/lex.l

File Facts

System
Linux kernel
Corpus path
scripts/genksyms/lex.l
Extension
.l
Size
8902 bytes
Lines
450
Domain
Support Tooling And Documentation
Bucket
scripts
Inferred role
Support Tooling And Documentation: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!source_file) {
        source_file = xstrdup(cur_filename);
        in_source_file = 1;
      } else {
        in_source_file = (strcmp(cur_filename, source_file) == 0);
      }

      goto repeat;
    }

  switch (lexstate)
    {
    case ST_NORMAL:
      APP;
      switch (token)
	{
	case IDENT:
	  {
	    int r = is_reserved_word(yytext, yyleng);
	    if (r >= 0)
	      {
		switch (token = r)
		  {
		  case ATTRIBUTE_KEYW:
		    lexstate = ST_ATTRIBUTE;
		    count = 0;
		    goto repeat;
		  case ASM_KEYW:
		    lexstate = ST_ASM;
		    count = 0;
		    goto repeat;
		  case TYPEOF_KEYW:
		    lexstate = ST_TYPEOF;
		    count = 0;
		    goto repeat;

		  case STRUCT_KEYW:
		  case UNION_KEYW:
		  case ENUM_KEYW:
		    dont_want_brace_phrase = 3;
		    suppress_type_lookup = 2;
		    goto fini;

		  case EXPORT_SYMBOL_KEYW:
		      goto fini;

		  case STATIC_ASSERT_KEYW:
		    lexstate = ST_STATIC_ASSERT;
		    count = 0;
		    goto repeat;
		  }
	      }
	    if (!suppress_type_lookup && !dont_want_type_specifier)
	      {
		if (find_symbol(yytext, SYM_TYPEDEF, 1))
		  token = TYPE;
	      }
	  }
	  break;

	case '[':
	  lexstate = ST_BRACKET;
	  count = 1;
	  goto repeat;

	case '{':
	  if (dont_want_brace_phrase)
	    break;
	  lexstate = ST_BRACE;
	  count = 1;

Annotation

Implementation Notes