Admin/Benchmarks/HOL-datatype/Verilog.thy
changeset 7373 776d888472aa
parent 7013 8a7fb425e04a
child 16417 9bc16273c2d4
equal deleted inserted replaced
7372:79e911c0c7d1 7373:776d888472aa
     1 (*  Title:      Admin/Benchmarks/HOL-datatype/Verilog.thy
     1 (*  Title:      Admin/Benchmarks/HOL-datatype/Verilog.thy
     2     ID:         $Id$
     2     ID:         $Id$
     3 *)
     3 *)
     4 
     4 
     5 Verilog = Main +
     5 theory Verilog = Main:
     6 
     6 
     7 (* ------------------------------------------------------------------------- *)
     7 (* ------------------------------------------------------------------------- *)
     8 (* Example from Daryl: a Verilog grammar.                                    *)
     8 (* Example from Daryl: a Verilog grammar.                                    *)
     9 (* ------------------------------------------------------------------------- *)
     9 (* ------------------------------------------------------------------------- *)
    10 
    10 
    11 datatype
    11 datatype
    12   Source_text
    12   Source_text
    13      = module string (string list) (Module_item list)
    13      = module string "string list" "Module_item list"
    14      | Source_textMeta string
    14      | Source_textMeta string
    15 and
    15 and
    16   Module_item
    16   Module_item
    17      = declaration Declaration
    17      = declaration Declaration
    18      | initial Statement
    18      | initial Statement
    19      | always Statement
    19      | always Statement
    20      | assign Lvalue Expression
    20      | assign Lvalue Expression
    21      | Module_itemMeta string
    21      | Module_itemMeta string
    22 and
    22 and
    23   Declaration
    23   Declaration
    24      = reg_declaration (Range option) (string list)
    24      = reg_declaration "Range option" "string list"
    25      | net_declaration (Range option) (string list)
    25      | net_declaration "Range option" "string list"
    26      | input_declaration (Range option) (string list)
    26      | input_declaration "Range option" "string list"
    27      | output_declaration (Range option) (string list)
    27      | output_declaration "Range option" "string list"
    28      | DeclarationMeta string
    28      | DeclarationMeta string
    29 and
    29 and
    30   Range = range Expression Expression | RangeMeta string
    30   Range = range Expression Expression | RangeMeta string
    31 and
    31 and
    32   Statement
    32   Statement
    33      = clock_statement Clock Statement_or_null
    33      = clock_statement Clock Statement_or_null
    34      | blocking_assignment Lvalue Expression
    34      | blocking_assignment Lvalue Expression
    35      | non_blocking_assignment Lvalue Expression
    35      | non_blocking_assignment Lvalue Expression
    36      | conditional_statement
    36      | conditional_statement
    37           Expression Statement_or_null (Statement_or_null option)
    37           Expression Statement_or_null "Statement_or_null option"
    38      | case_statement Expression (Case_item list)
    38      | case_statement Expression "Case_item list"
    39      | while_loop Expression Statement
    39      | while_loop Expression Statement
    40      | repeat_loop Expression Statement
    40      | repeat_loop Expression Statement
    41      | for_loop
    41      | for_loop
    42           Lvalue Expression Expression Lvalue Expression Statement
    42           Lvalue Expression Expression Lvalue Expression Statement
    43      | forever_loop Statement
    43      | forever_loop Statement
    44      | disable string
    44      | disable string
    45      | seq_block (string option) (Statement list)
    45      | seq_block "string option" "Statement list"
    46      | StatementMeta string
    46      | StatementMeta string
    47 and
    47 and
    48   Statement_or_null
    48   Statement_or_null
    49      = statement Statement | null_statement | Statement_or_nullMeta string
    49      = statement Statement | null_statement | Statement_or_nullMeta string
    50 and
    50 and
    53      | negedge string
    53      | negedge string
    54      | clock string
    54      | clock string
    55      | ClockMeta string
    55      | ClockMeta string
    56 and
    56 and
    57   Case_item
    57   Case_item
    58      = case_item (Expression list) Statement_or_null
    58      = case_item "Expression list" Statement_or_null
    59      | default_case_item Statement_or_null
    59      | default_case_item Statement_or_null
    60      | Case_itemMeta string
    60      | Case_itemMeta string
    61 and
    61 and
    62   Expression
    62   Expression
    63      = plus Expression Expression
    63      = plus Expression Expression
   110      | lvalue_concatenation Concatenation
   110      | lvalue_concatenation Concatenation
   111      | LvalueMeta string
   111      | LvalueMeta string
   112 and
   112 and
   113   Number
   113   Number
   114      = decimal string
   114      = decimal string
   115      | based (string option) string
   115      | based "string option" string
   116      | NumberMeta string
   116      | NumberMeta string
   117 and
   117 and
   118   Concatenation
   118   Concatenation
   119      = concatenation (Expression list) | ConcatenationMeta string
   119      = concatenation "Expression list" | ConcatenationMeta string
   120 and
   120 and
   121   Multiple_concatenation
   121   Multiple_concatenation
   122      = multiple_concatenation Expression (Expression list)
   122      = multiple_concatenation Expression "Expression list"
   123      | Multiple_concatenationMeta string
   123      | Multiple_concatenationMeta string
   124 and
   124 and
   125   meta
   125   meta
   126      = Meta_Source_text Source_text
   126      = Meta_Source_text Source_text
   127      | Meta_Module_item Module_item
   127      | Meta_Module_item Module_item