Sha256: 02803ff89ddd8f9bcf57e1f5050bbf3b3b74a58c41febe0f798ac9bed1ba0c64

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# -*- coding: utf-8 -*- #

module Rouge
  module Lexers
    class GAL < C
      tag 'gal'
      filenames '*.gal'

      title "GAL"
      desc "The Guarded Action Language"

      # optional comment or whitespace
      ws = %r((?:\s|//.*?\n|/[*].*?[*]/)+)
      id = /[a-zA-Z_][a-zA-Z0-9_\.]*/
      pid = /\$[a-zA-Z_][a-zA-Z0-9_]*/
      
      def self.keywords
        @keywords ||= Set.new %w(
          gal composite import interface extends 
	  TRANSIENT typedef hotbit
	  transition synchronization label predicate
	  for if else abort fixpoint
	  self main
	  property bounds reachable invariant never ctl ltl
	  AG AF AX EG EF EX A E U W M R X
	  true false
        )
      end

      def self.keywords_type
        @keywords_type ||= Set.new %w(
          int array
        )
      end

      def self.reserved
        @reserved ||= Set.new %w(
	  AG AF AX EG EF EX A E U W M R X
        )
      end
      
      append :statements do 
	rule pid do |m|
	  name = m[0]
	  token Name::Builtin
	end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rougegal-2.1.2 lib/rouge/lexers/gal.rb