Permalink
Browse files

updated from the CamFort project

  • Loading branch information...
1 parent 8718884 commit 1ff838ab5f0012b00bc26c282635f30d5fe2b836 @dorchard dorchard committed Feb 4, 2014
Showing with 994 additions and 13,146 deletions.
  1. +6 −9 language-fortran.cabal
  2. +309 −199 src/Language/Fortran.hs
  3. +0 −424 src/Language/Fortran/Lexer.hs
  4. +25 −36 src/Language/Fortran/Lexer.x
  5. +0 −11,794 src/Language/Fortran/Parser.hs
  6. +653 −682 src/Language/Fortran/Parser.y
  7. +1 −2 src/LexerTest.hs
View
15 language-fortran.cabal
@@ -1,11 +1,11 @@
name: language-fortran
-version: 0.1.0.0
+version: 0.2.0.0
synopsis: Fortran parser and language support
-- description:
license: BSD3
license-file: LICENSE
-author: Jason Dagit
-maintainer: dagitj@gmail.com
+author: Jason Dagit, Dominic Orchard
+maintainer: dagitj@gmail.com, dom.orchard@gmail.com
-- copyright:
category: Language
build-type: Simple
@@ -18,8 +18,7 @@ executable parser
haskell-src >= 1.0,
language-fortran,
syb >= 0.3,
- array >= 0.4,
- generic-deriving >= 1.5.5
+ array >= 0.4
executable lexer
main-is: LexerTest.hs
@@ -28,8 +27,7 @@ executable lexer
haskell-src >= 1.0,
language-fortran,
syb >= 0.3,
- array >= 0.4,
- generic-deriving >= 1.5.5
+ array >= 0.4
library
exposed-modules: Language.Fortran.Parser,
@@ -40,8 +38,7 @@ library
build-depends: base >=4.0 && < 5,
syb >= 0.3,
haskell-src >= 1.0,
- array >= 0.4,
- generic-deriving >= 1.5.5
+ array >= 0.4
hs-source-dirs: src
build-tools: alex, happy
View
508 src/Language/Fortran.hs
@@ -2,105 +2,104 @@
-- Fortran.hs -
-- Based on FortranP.hs from Parameterized Fortran by Martin Erwig.
--
--- A Fortran program generator implemented using the boilerplate approach and
--- existential types
-
-{-# LANGUAGE ExistentialQuantification #-}
-{-# LANGUAGE FlexibleContexts #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE UndecidableInstances #-}
-{-# LANGUAGE MultiParamTypeClasses #-}
-{-# LANGUAGE DeriveDataTypeable #-}
-{-# LANGUAGE QuasiQuotes #-}
-{-# LANGUAGE DeriveFunctor #-}
-{-# LANGUAGE ImplicitParams #-}
-{-# LANGUAGE OverlappingInstances #-}
-
-{-# LANGUAGE DeriveGeneric #-}
-module Language.Fortran where
+{-# LANGUAGE DeriveFunctor, DeriveDataTypeable #-}
----------------------------------------------------------------------------
--- IMPORTS
----------------------------------------------------------------------------
+module Language.Fortran where
-import Data.Generics -- Typeable class and boilerplate generic functions
+import Data.Generics -- All AST nodes are members of 'Data' and 'Typeable' so that
+ -- data type generic programming can be done with the AST
import Data.Maybe
import Data.List
-import Generics.Deriving.Base
-import Generics.Deriving.Copoint
-import GHC.Generics
----------------------------------------------------------------------------
--- Language definition for parametric Fortran
----------------------------------------------------------------------------
+import Language.Haskell.Syntax (SrcLoc)
+
+-----------------------------------------------------------------------------------
+-- Language definition for Fortran (covers a lot of standards, but still incomplete)
+--
+-- The AST is parameterised by type variable p which allows all nodes of the AST
+-- to be annotated. The default annotation is (). This is useful for analysis.
+-- The 'Anntotation' type class provides the function 'annotation :: d a -> a' to
+-- extract these annotations.
+-- Furthermore, many nodes of the tree have a 'SrcSpan' which is the start and end
+-- locations of the syntax in the source file (including whitespace etc.)
+-- This is useful for error reporting and refactoring.
+-- The 'Span' type class provides the function 'srcSpan :: d a -> SrcSpan' which
+-- which extracts the span (where possible)
--- Definition of data types
---
+-----------------------------------------------------------------------------------
--- All kinds of names ...
---
+type SrcSpan = (SrcLoc, SrcLoc)
+
type Variable = String
type ProgName = String -- Fortran program names
data SubName p = SubName p String -- Fortran subroutine names
| NullSubName p
- deriving (Show, Functor, Typeable, Data, Eq, Generic1)
+ deriving (Show, Functor, Typeable, Data, Eq)
-data VarName p = VarName p String
- deriving (Show, Functor, Typeable, Data, Eq, Read, Generic1)
+data VarName p = VarName p Variable
+ deriving (Show, Functor, Typeable, Data, Eq, Read)
data ArgName p = ArgName p String
| ASeq p (ArgName p) (ArgName p)
| NullArg p
- deriving (Show, Functor, Typeable, Data, Eq, Generic1)
+ deriving (Show, Functor, Typeable, Data, Eq)
-- Syntax defintions
--
-data Arg p = Arg p (ArgName p)
- deriving (Show, Functor, Typeable, Data, Eq, Generic1)
+data Arg p = Arg p (ArgName p) SrcSpan -- the src span denotes the end of the arg list before ')'
+ deriving (Show, Functor, Typeable, Data, Eq)
data ArgList p = ArgList p (Expr p)
deriving (Show, Functor, Typeable, Data, Eq)
- -- Prog type (type of result) name args body use's
-data Program p = Main p (SubName p) (Arg p) (Block p) [Program p]
- | Sub p (Maybe (BaseType p)) (SubName p) (Arg p) (Block p)
- | Function p (Maybe (BaseType p)) (SubName p) (Arg p) (Block p)
- | Module p (SubName p) [String] (Implicit p) (Decl p) [Program p]
- | BlockData p (SubName p) [String] (Implicit p) (Decl p)
- | PSeq p (Program p) (Program p) -- sequence of programs
- | Prog p (Program p) -- useful for {#p: #q : program ... }
- | NullProg p -- null
+type Program p = [ProgUnit p]
+
+ -- Prog type (type of result) name args body use's
+data ProgUnit p = Main p SrcSpan (SubName p) (Arg p) (Block p) [ProgUnit p]
+ | Sub p SrcSpan (Maybe (BaseType p)) (SubName p) (Arg p) (Block p)
+ | Function p SrcSpan (Maybe (BaseType p)) (SubName p) (Arg p) (Block p)
+ | Module p SrcSpan (SubName p) (Uses p) (Implicit p) (Decl p) [ProgUnit p]
+ | BlockData p SrcSpan (SubName p) (Uses p) (Implicit p) (Decl p)
+ | PSeq p SrcSpan (ProgUnit p) (ProgUnit p) -- sequence of programs
+ | Prog p SrcSpan (ProgUnit p) -- useful for {#p: #q : program ... }
+ | NullProg p SrcSpan -- null
deriving (Show, Functor, Typeable, Data, Eq)
- -- implicit none or no implicit
-data Implicit p = ImplicitNone p | ImplicitNull p
- deriving (Show, Functor, Typeable, Data, Eq, Generic1)
-
+data Implicit p = ImplicitNone p | ImplicitNull p
+ -- implicit none or no implicit
+ deriving (Show, Functor, Typeable, Data, Eq)
+
+type Renames = [(Variable, Variable)] -- renames for "use"s
+
+data Uses p = Use p (String, Renames) (Uses p) p -- (second 'p' let's you annotate the 'cons' part of the cell)
+ | UseNil p deriving (Show, Functor, Typeable, Data, Eq)
+
-- use's implicit decls stmts
-data Block p = Block p [String] (Implicit p) (Decl p) (Fortran p)
+data Block p = Block p (Uses p) (Implicit p) SrcSpan (Decl p) (Fortran p)
deriving (Show, Functor, Typeable, Data, Eq)
-data Decl p = Decl p [(Expr p, Expr p)] (Type p) -- declaration stmt
+data Decl p = Decl p SrcSpan [(Expr p, Expr p)] (Type p) -- declaration stmt
| Namelist p [(Expr p, [Expr p])] -- namelist declaration
| Data p [(Expr p, Expr p)] -- data declaration
+ | Equivalence p SrcSpan [(Expr p)]
| AccessStmt p (Attr p) [GSpec p] -- access stmt
| ExternalStmt p [String] -- external stmt
| Interface p (Maybe (GSpec p)) [InterfaceSpec p] -- interface declaration
- | Common p (Maybe String) [Expr p]
- | DerivedTypeDef p (SubName p) [Attr p] [Attr p] [Decl p] -- derivified
+ | Common p SrcSpan (Maybe String) [Expr p]
+ | DerivedTypeDef p SrcSpan (SubName p) [Attr p] [Attr p] [Decl p] -- derivified
| Include p (Expr p) -- include stmt
| DSeq p (Decl p) (Decl p) -- list of decls
| TextDecl p String -- cpp switches to carry over
- | NullDecl p -- null
+ | NullDecl p SrcSpan -- null
deriving (Show, Functor, Typeable, Data, Eq)
-- BaseType dimensions type Attributes kind len
@@ -110,7 +109,7 @@ data Type p = BaseType p (BaseType p) [Attr p] (Expr p) (
data BaseType p = Integer p | Real p | Character p | SomeType p | DerivedType p (SubName p)
| Recursive p | Pure p | Elemental p | Logical p | Complex p
- deriving (Show, Functor, Typeable, Data, Eq, Generic1)
+ deriving (Show, Functor, Typeable, Data, Eq)
data Attr p = Parameter p
| Allocatable p
@@ -126,68 +125,68 @@ data Attr p = Parameter p
| Private p
| Sequence p
-- | Dimension [(Expr,Expr)] -- in Type: ArrayT
- deriving (Show, Functor, Typeable, Data, Eq, Generic1)
+ deriving (Show, Functor, Typeable, Data, Eq)
data GSpec p = GName p (Expr p) | GOper p (BinOp p) | GAssg p
deriving (Show, Functor, Typeable, Data, Eq)
-data InterfaceSpec p = FunctionInterface p (SubName p) (Arg p) [String] (Implicit p) (Decl p)
- | SubroutineInterface p (SubName p) (Arg p) [String] (Implicit p) (Decl p)
+data InterfaceSpec p = FunctionInterface p (SubName p) (Arg p) (Uses p) (Implicit p) (Decl p)
+ | SubroutineInterface p (SubName p) (Arg p) (Uses p) (Implicit p) (Decl p)
| ModuleProcedure p [(SubName p)]
deriving (Show, Functor, Typeable, Data, Eq)
data IntentAttr p = In p
| Out p
| InOut p
- deriving (Show, Functor, Typeable, Data, Eq, Generic1)
+ deriving (Show, Functor, Typeable, Data, Eq)
-data Fortran p = Assg p (Expr p) (Expr p)
- | For p (VarName p) (Expr p) (Expr p) (Expr p) (Fortran p)
- | FSeq p (Fortran p) (Fortran p)
- | If p (Expr p) (Fortran p) [((Expr p),(Fortran p))] (Maybe (Fortran p))
- | Allocate p (Expr p) (Expr p)
- | Backspace p [Spec p]
- | Call p (Expr p) (ArgList p)
- | Equivalence p [(Expr p)]
- | Open p [Spec p]
- | Close p [Spec p]
- | Continue p
- | Cycle p String
- | Deallocate p [(Expr p)] (Expr p)
- | Endfile p [Spec p]
- | Exit p String
- | Forall p ([(String,(Expr p),(Expr p),(Expr p))],(Expr p)) (Fortran p)
- | Goto p String
- | Nullify p [(Expr p)]
- | Inquire p [Spec p] [(Expr p)]
- | Rewind p [Spec p]
- | Stop p (Expr p)
- | Where p (Expr p) (Fortran p)
- | Write p [Spec p] [(Expr p)]
- | PointerAssg p (Expr p) (Expr p)
- | Return p (Expr p)
- | Label p String (Fortran p)
- | Print p (Expr p) [(Expr p)]
- | ReadS p [Spec p] [(Expr p)]
- | TextStmt p String -- cpp switches to carry over
- | NullStmt p
+data Fortran p = Assg p SrcSpan (Expr p) (Expr p)
+ | For p SrcSpan (VarName p) (Expr p) (Expr p) (Expr p) (Fortran p)
+ | FSeq p SrcSpan (Fortran p) (Fortran p)
+ | If p SrcSpan (Expr p) (Fortran p) [((Expr p),(Fortran p))] (Maybe (Fortran p))
+ | Allocate p SrcSpan (Expr p) (Expr p)
+ | Backspace p SrcSpan [Spec p]
+ | Call p SrcSpan (Expr p) (ArgList p)
+ | Open p SrcSpan [Spec p]
+ | Close p SrcSpan [Spec p]
+ | Continue p SrcSpan
+ | Cycle p SrcSpan String
+ | Deallocate p SrcSpan [(Expr p)] (Expr p)
+ | Endfile p SrcSpan [Spec p]
+ | Exit p SrcSpan String
+ | Forall p SrcSpan ([(String,(Expr p),(Expr p),(Expr p))],(Expr p)) (Fortran p)
+ | Goto p SrcSpan String
+ | Nullify p SrcSpan [(Expr p)]
+ | Inquire p SrcSpan [Spec p] [(Expr p)]
+ | Rewind p SrcSpan [Spec p]
+ | Stop p SrcSpan (Expr p)
+ | Where p SrcSpan (Expr p) (Fortran p)
+ | Write p SrcSpan [Spec p] [(Expr p)]
+ | PointerAssg p SrcSpan (Expr p) (Expr p)
+ | Return p SrcSpan (Expr p)
+ | Label p SrcSpan String (Fortran p)
+ | Print p SrcSpan (Expr p) [(Expr p)]
+ | ReadS p SrcSpan [Spec p] [(Expr p)]
+ | TextStmt p SrcSpan String -- cpp switches to carry over
+ | NullStmt p SrcSpan
deriving (Show, Functor, Typeable, Data, Eq)
-- type Bound = ((Expr p),(Expr p))
-data Expr p = Con p String
- | ConS p String -- String constant
- | Var p [((VarName p),[(Expr p)])]
- | Bin p (BinOp p) (Expr p) (Expr p)
- | Unary p (UnaryOp p) (Expr p)
- | CallExpr p (Expr p) (ArgList p)
- | NullExpr p
- | Null p
- | ESeq p (Expr p) (Expr p)
- | Bound p (Expr p) (Expr p)
- | Sqrt p (Expr p)
- | ArrayCon p [(Expr p)]
- | AssgExpr p String (Expr p)
+data Expr p = Con p SrcSpan String
+ | ConL p SrcSpan Char String
+ | ConS p SrcSpan String -- String representing a constant
+ | Var p SrcSpan [((VarName p),[(Expr p)])]
+ | Bin p SrcSpan (BinOp p) (Expr p) (Expr p)
+ | Unary p SrcSpan (UnaryOp p) (Expr p)
+ | CallExpr p SrcSpan (Expr p) (ArgList p)
+ | NullExpr p SrcSpan
+ | Null p SrcSpan
+ | ESeq p SrcSpan (Expr p) (Expr p)
+ | Bound p SrcSpan (Expr p) (Expr p)
+ | Sqrt p SrcSpan (Expr p)
+ | ArrayCon p SrcSpan [(Expr p)]
+ | AssgExpr p SrcSpan String (Expr p)
deriving (Show, Functor, Typeable ,Data, Eq)
data BinOp p = Plus p
@@ -204,10 +203,10 @@ data BinOp p = Plus p
| RelLE p
| RelGT p
| RelGE p
- deriving (Show, Functor, Typeable, Data, Eq, Generic1)
+ deriving (Show, Functor, Typeable, Data, Eq)
data UnaryOp p = UMinus p | Not p
- deriving (Show, Functor,Typeable,Data, Eq, Generic1)
+ deriving (Show, Functor,Typeable,Data, Eq)
data Spec p = Access p (Expr p)
| Action p (Expr p)
@@ -247,98 +246,209 @@ data Spec p = Access p (Expr p)
| WriteSp p (Expr p)
deriving (Show, Functor,Typeable,Data, Eq)
-
--- smart constructors for language 'constants', that is, expressions
---
-
-ne = NullExpr
-
-class Copointed d where
- copoint :: d a -> a
-
-instance Copointed Attr where copoint = gcopoint
-instance Copointed BaseType where copoint = gcopoint
-instance Copointed SubName where copoint = gcopoint
-instance Copointed VarName where copoint = gcopoint
-instance Copointed ArgName where copoint = gcopoint
-instance Copointed Arg where copoint = gcopoint
-instance Copointed Implicit where copoint = gcopoint
-
-instance Copointed ArgList where
- copoint (ArgList x _) = x
-
-instance Copointed Program where
- copoint (Main x _ _ _ _) = x
- copoint (Sub x _ _ _ _) = x
- copoint (Function x _ _ _ _) = x
- copoint (Module x _ _ _ _ _ ) = x
- copoint (BlockData x _ _ _ _) = x
- copoint (PSeq x _ _) = x
- copoint (Prog x _) = x
- copoint (NullProg x) = x
-
-instance Copointed Decl where
- copoint (Decl x _ _) = x
- copoint (Namelist x _) = x
- copoint (Data x _) = x
- copoint (AccessStmt x _ _) = x
- copoint (ExternalStmt x _) = x
- copoint (Interface x _ _) = x
- copoint (Common x _ _) = x
- copoint (DerivedTypeDef x _ _ _ _) = x
- copoint (Include x _) = x
- copoint (DSeq x _ _) = x
- copoint (TextDecl x _) = x
- copoint (NullDecl x) = x
-
-instance Copointed Fortran where
- copoint (Assg x e1 e2) = x
- copoint (For x v e1 e2 e3 fs) = x
- copoint (FSeq x f1 f2) = x
- copoint (If x e f1 fes f3) = x
- copoint (Allocate x e1 e2) = x
- copoint (Backspace x sp) = x
- copoint (Call x e as) = x
- copoint (Open x s) = x
- copoint (Close x s) = x
- copoint (Continue x) = x
- copoint (Cycle x s) = x
- copoint (Deallocate x es e) = x
- copoint (Equivalence x _) = x
- copoint (Endfile x s) = x
- copoint (Exit x s) = x
- copoint (Forall x es f) = x
- copoint (Goto x s) = x
- copoint (Nullify x e) = x
- copoint (Inquire x s e) = x
- copoint (Rewind x s) = x
- copoint (Stop x e) = x
- copoint (Where x e f) = x
- copoint (Write x s e) = x
- copoint (PointerAssg x e1 e2) = x
- copoint (Return x e) = x
- copoint (Label x s f) = x
- copoint (Print x e es) = x
- copoint (ReadS x s e) = x
- copoint (TextStmt x s) = x
- copoint (NullStmt x) = x
-
-instance Copointed Expr where
- copoint (Con x _) = x
- copoint (ConS x _) = x
- copoint (Var x _ ) = x
- copoint (Bin x _ _ _) = x
- copoint (Unary x _ _) = x
- copoint (CallExpr x _ _) = x
- copoint (NullExpr x) = x
- copoint (Null x) = x
- copoint (ESeq x _ _) = x
- copoint (Bound x _ _) = x
- copoint (Sqrt x _) = x
- copoint (ArrayCon x _) = x
- copoint (AssgExpr x _ _) = x
-
-instance Copointed GSpec where
- copoint (GName x _) = x
- copoint (GOper x _) = x
- copoint (GAssg x) = x
+-- Extract span information from the source tree
+
+class Span t where
+ srcSpan :: t -> (SrcLoc, SrcLoc)
+
+instance Span (Block a) where
+ srcSpan (Block _ _ _ sp _ _) = sp
+
+instance Span (Decl a) where
+ srcSpan (Decl _ sp _ _) = sp
+ srcSpan (NullDecl _ sp) = sp
+ srcSpan (Common _ sp _ _) = sp
+ srcSpan (Equivalence x sp _) = sp
+ srcSpan (DerivedTypeDef x sp _ _ _ _) = sp
+ srcSpan _ = error "No span for non common/equiv/type/ null declarations"
+
+instance Span (ProgUnit a) where
+ srcSpan (Main x sp _ _ _ _) = sp
+ srcSpan (Sub x sp _ _ _ _) = sp
+ srcSpan (Function x sp _ _ _ _) = sp
+ srcSpan (Module x sp _ _ _ _ _ ) = sp
+ srcSpan (BlockData x sp _ _ _ _) = sp
+ srcSpan (PSeq x sp _ _) = sp
+ srcSpan (Prog x sp _) = sp
+ srcSpan (NullProg x sp) = sp
+
+instance Span (Expr a) where
+ srcSpan (Con x sp _) = sp
+ srcSpan (ConS x sp _) = sp
+ srcSpan (Var x sp _ ) = sp
+ srcSpan (Bin x sp _ _ _) = sp
+ srcSpan (Unary x sp _ _) = sp
+ srcSpan (CallExpr x sp _ _) = sp
+ srcSpan (NullExpr x sp) = sp
+ srcSpan (Null x sp) = sp
+ srcSpan (ESeq x sp _ _) = sp
+ srcSpan (Bound x sp _ _) = sp
+ srcSpan (Sqrt x sp _) = sp
+ srcSpan (ArrayCon x sp _) = sp
+ srcSpan (AssgExpr x sp _ _) = sp
+
+instance Span (Fortran a) where
+ srcSpan (Assg x sp e1 e2) = sp
+ srcSpan (For x sp v e1 e2 e3 fs) = sp
+ srcSpan (FSeq x sp f1 f2) = sp
+ srcSpan (If x sp e f1 fes f3) = sp
+ srcSpan (Allocate x sp e1 e2) = sp
+ srcSpan (Backspace x sp _) = sp
+ srcSpan (Call x sp e as) = sp
+ srcSpan (Open x sp s) = sp
+ srcSpan (Close x sp s) = sp
+ srcSpan (Continue x sp) = sp
+ srcSpan (Cycle x sp s) = sp
+ srcSpan (Deallocate x sp es e) = sp
+ srcSpan (Endfile x sp s) = sp
+ srcSpan (Exit x sp s) = sp
+ srcSpan (Forall x sp es f) = sp
+ srcSpan (Goto x sp s) = sp
+ srcSpan (Nullify x sp e) = sp
+ srcSpan (Inquire x sp s e) = sp
+ srcSpan (Rewind x sp s) = sp
+ srcSpan (Stop x sp e) = sp
+ srcSpan (Where x sp e f) = sp
+ srcSpan (Write x sp s e) = sp
+ srcSpan (PointerAssg x sp e1 e2) = sp
+ srcSpan (Return x sp e) = sp
+ srcSpan (Label x sp s f) = sp
+ srcSpan (Print x sp e es) = sp
+ srcSpan (ReadS x sp s e) = sp
+ srcSpan (TextStmt x sp s) = sp
+ srcSpan (NullStmt x sp) = sp
+
+-- Extract the annotation
+
+class Annotation d where
+ annotation :: d a -> a
+
+instance Annotation Attr where
+ annotation (Parameter x) = x
+ annotation (Allocatable x) = x
+ annotation (External x) = x
+ annotation (Intent x _) = x
+ annotation (Intrinsic x) = x
+ annotation (Optional x) = x
+ annotation (Pointer x) = x
+ annotation (Save x) = x
+ annotation (Target x) = x
+ annotation (Volatile x) = x
+ annotation (Public x) = x
+ annotation (Private x) = x
+ annotation (Sequence x) = x
+
+instance Annotation BaseType where
+ annotation (Integer x) = x
+ annotation (Real x) = x
+ annotation (Character x) = x
+ annotation (SomeType x) = x
+ annotation (DerivedType x _) = x
+ annotation (Recursive x) = x
+ annotation (Pure x) = x
+ annotation (Elemental x) = x
+ annotation (Logical x) = x
+ annotation (Complex x) = x
+
+instance Annotation SubName where
+ annotation (SubName x _) = x
+ annotation (NullSubName x) = x
+
+instance Annotation VarName where
+ annotation (VarName x _) = x
+
+instance Annotation Implicit where
+ annotation (ImplicitNone x) = x
+ annotation (ImplicitNull x) = x
+
+instance Annotation Uses where
+ annotation (Use x _ _ _) = x
+ annotation (UseNil x) = x
+
+instance Annotation Arg where
+ annotation (Arg x _ _) = x
+
+instance Annotation ArgList where
+ annotation (ArgList x _) = x
+
+instance Annotation ArgName where
+ annotation (ASeq x _ _) = x
+ annotation (NullArg x) = x
+ annotation (ArgName x _) = x
+
+instance Annotation ProgUnit where
+ annotation (Main x sp _ _ _ _) = x
+ annotation (Sub x sp _ _ _ _) = x
+ annotation (Function x sp _ _ _ _) = x
+ annotation (Module x sp _ _ _ _ _ ) = x
+ annotation (BlockData x sp _ _ _ _) = x
+ annotation (PSeq x sp _ _) = x
+ annotation (Prog x sp _) = x
+ annotation (NullProg x sp) = x
+
+instance Annotation Decl where
+ annotation (Decl x _ _ _) = x
+ annotation (Namelist x _) = x
+ annotation (Data x _) = x
+ annotation (AccessStmt x _ _) = x
+ annotation (ExternalStmt x _) = x
+ annotation (Interface x _ _) = x
+ annotation (Common x _ _ _) = x
+ annotation (Equivalence x sp _) = x
+ annotation (DerivedTypeDef x sp _ _ _ _) = x
+ annotation (Include x _) = x
+ annotation (DSeq x _ _) = x
+ annotation (TextDecl x _) = x
+ annotation (NullDecl x _) = x
+
+instance Annotation Fortran where
+ annotation (Assg x s e1 e2) = x
+ annotation (For x s v e1 e2 e3 fs) = x
+ annotation (FSeq x sp f1 f2) = x
+ annotation (If x sp e f1 fes f3) = x
+ annotation (Allocate x sp e1 e2) = x
+ annotation (Backspace x sp _) = x
+ annotation (Call x sp e as) = x
+ annotation (Open x sp s) = x
+ annotation (Close x sp s) = x
+ annotation (Continue x sp) = x
+ annotation (Cycle x sp s) = x
+ annotation (Deallocate x sp es e) = x
+ annotation (Endfile x sp s) = x
+ annotation (Exit x sp s) = x
+ annotation (Forall x sp es f) = x
+ annotation (Goto x sp s) = x
+ annotation (Nullify x sp e) = x
+ annotation (Inquire x sp s e) = x
+ annotation (Rewind x sp s) = x
+ annotation (Stop x sp e) = x
+ annotation (Where x sp e f) = x
+ annotation (Write x sp s e) = x
+ annotation (PointerAssg x sp e1 e2) = x
+ annotation (Return x sp e) = x
+ annotation (Label x sp s f) = x
+ annotation (Print x sp e es) = x
+ annotation (ReadS x sp s e) = x
+ annotation (TextStmt x sp s) = x
+ annotation (NullStmt x sp) = x
+
+instance Annotation Expr where
+ annotation (Con x sp _) = x
+ annotation (ConL x sp _ _) = x
+ annotation (ConS x sp _) = x
+ annotation (Var x sp _ ) = x
+ annotation (Bin x sp _ _ _) = x
+ annotation (Unary x sp _ _) = x
+ annotation (CallExpr x sp _ _) = x
+ annotation (NullExpr x _) = x
+ annotation (Null x _) = x
+ annotation (ESeq x sp _ _) = x
+ annotation (Bound x sp _ _) = x
+ annotation (Sqrt x sp _) = x
+ annotation (ArrayCon x sp _) = x
+ annotation (AssgExpr x sp _ _) = x
+
+instance Annotation GSpec where
+ annotation (GName x _) = x
+ annotation (GOper x _) = x
+ annotation (GAssg x) = x
View
424 src/Language/Fortran/Lexer.hs
@@ -1,424 +0,0 @@
-{-# OPTIONS -cpp #-}
-{-# LINE 1 "Lexer.x" #-}
-
-
-{-# LANGUAGE DeriveGeneric #-}
-
-module Language.Fortran.Lexer where
-
-import Data.Char
-import Debug.Trace
-
-import Language.Fortran
-
-import Language.Haskell.Syntax (SrcLoc)
-import Language.Haskell.ParseMonad
-
-import Generics.Deriving.Base hiding (P)
-import Generics.Deriving.Copoint
-
-
-
-#if __GLASGOW_HASKELL__ >= 603
-#include "ghcconfig.h"
-#elif defined(__GLASGOW_HASKELL__)
-#include "config.h"
-#endif
-#if __GLASGOW_HASKELL__ >= 503
-import Data.Array
-import Data.Char (ord)
-import Data.Array.Base (unsafeAt)
-#else
-import Array
-import Char (ord)
-#endif
-{-# LINE 1 "templates/wrappers.hs" #-}
-{-# LINE 1 "templates/wrappers.hs" #-}
-{-# LINE 1 "<built-in>" #-}
-{-# LINE 1 "<command-line>" #-}
-{-# LINE 1 "templates/wrappers.hs" #-}
--- -----------------------------------------------------------------------------
--- Alex wrapper code.
---
--- This code is in the PUBLIC DOMAIN; you may copy it freely and use
--- it for any purpose whatsoever.
-
-
-
-
-
-
-
--- -----------------------------------------------------------------------------
--- The input type
-
-{-# LINE 29 "templates/wrappers.hs" #-}
-
-{-# LINE 45 "templates/wrappers.hs" #-}
-
--- -----------------------------------------------------------------------------
--- Token positions
-
--- `Posn' records the location of a token in the input text. It has three
--- fields: the address (number of chacaters preceding the token), line number
--- and column of a token within the file. `start_pos' gives the position of the
--- start of the file and `eof_pos' a standard encoding for the end of file.
--- `move_pos' calculates the new position after traversing a given character,
--- assuming the usual eight character tab stops.
-
-{-# LINE 68 "templates/wrappers.hs" #-}
-
--- -----------------------------------------------------------------------------
--- Default monad
-
-{-# LINE 150 "templates/wrappers.hs" #-}
-
-
--- -----------------------------------------------------------------------------
--- Monad (with ByteString input)
-
-{-# LINE 233 "templates/wrappers.hs" #-}
-
-
--- -----------------------------------------------------------------------------
--- Basic wrapper
-
-
-type AlexInput = (Char,String)
-
-alexGetChar (_, []) = Nothing
-alexGetChar (_, c:cs) = Just (c, (c,cs))
-
-alexInputPrevChar (c,_) = c
-
--- alexScanTokens :: String -> [token]
-alexScanTokens str = go ('\n',str)
- where go inp@(_,str) =
- case alexScan inp 0 of
- AlexEOF -> []
- AlexError _ -> error "lexical error"
- AlexSkip inp' len -> go inp'
- AlexToken inp' len act -> act (take len str) : go inp'
-
-
-
--- -----------------------------------------------------------------------------
--- Basic wrapper, ByteString version
-
-{-# LINE 277 "templates/wrappers.hs" #-}
-
-
--- -----------------------------------------------------------------------------
--- Posn wrapper
-
--- Adds text positions to the basic model.
-
-{-# LINE 294 "templates/wrappers.hs" #-}
-
-
--- -----------------------------------------------------------------------------
--- Posn wrapper, ByteString version
-
-{-# LINE 309 "templates/wrappers.hs" #-}
-
-
--- -----------------------------------------------------------------------------
--- GScan wrapper
-
--- For compatibility with previous versions of Alex, and because we can.
-
-alex_base :: Array Int Int
-alex_base = listArray (0,313) [-8,-4,-3,-2,-26,21,1,0,2,3,4,0,110,0,0,-52,0,-46,0,-25,0,77,0,0,0,78,-63,39,-94,37,0,0,0,67,70,49,93,0,0,0,68,-24,43,-23,-41,0,0,0,82,9,52,38,-40,0,0,56,40,29,112,0,0,83,95,118,55,69,121,0,0,88,125,58,127,0,0,92,91,108,132,71,65,86,137,0,0,119,114,109,122,147,98,89,84,97,154,0,0,155,156,0,0,117,158,87,160,0,0,161,162,0,0,163,164,0,0,0,165,0,0,0,145,135,123,205,206,231,300,325,0,152,138,129,393,210,418,486,511,0,168,0,0,0,566,653,740,827,180,234,280,304,212,213,217,0,0,0,0,0,914,1028,309,1115,1202,1289,128,1376,1463,1550,1637,1724,1813,1902,1991,2078,2165,2252,2339,2426,2513,2600,2687,2774,2861,2948,3035,3122,3209,3296,3383,3470,3557,3644,3731,3818,3905,3992,4079,4166,4253,4340,4427,4514,4601,4688,4775,4862,4949,5036,5123,5210,5297,5384,5471,5558,5645,5732,5819,356,449,5906,5993,994,541,6080,6167,6242,642,6274,6361,6448,6535,6622,6709,6796,6883,6970,7057,7144,7231,7318,7393,729,7425,7512,7587,903,7619,7706,7793,7880,7967,8054,8141,8228,8315,8402,8489,8576,8663,8738,1017,8770,8857,1104,8932,1191,9007,1278,9082,1365,9157,1452,9232,1539,9307,9382,9392,9416,9446,1626,9478,9565,9640,1713,9672,9759,9836,6264,2067,9873,7414,2154,9948,0,7609,2241,9860,2328,0,8759,2415,10037,2502,0,10056,10079,10117,10140,0,0,0,0,0,0]
-
-alex_table :: Array Int Int
-alex_table = listArray (0,10395) [0,12,5,12,12,12,4,-1,-1,2,14,7,-1,-1,11,24,16,18,27,29,39,47,37,38,12,150,123,13,140,154,147,132,116,118,19,113,114,15,25,21,286,286,286,286,286,286,286,286,286,286,138,139,44,17,52,45,2,167,170,166,177,174,173,175,166,169,166,166,176,166,142,171,166,168,178,166,166,166,166,166,166,166,172,23,46,22,53,166,8,166,166,166,166,161,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,155,30,156,117,12,8,12,12,12,20,97,277,277,277,277,277,277,277,277,277,277,34,41,32,31,56,101,12,61,43,58,55,26,85,48,36,49,107,51,40,98,33,69,54,108,57,62,75,63,59,65,111,60,112,66,70,67,72,68,76,64,77,78,73,28,90,50,81,74,86,80,42,82,35,71,87,89,88,83,79,91,103,92,94,93,84,95,96,102,99,104,100,105,106,109,110,309,115,313,311,-1,-1,310,308,312,-1,141,-1,-1,311,313,137,153,312,0,157,310,0,0,0,313,0,0,0,119,119,-1,312,149,148,149,149,149,0,128,0,0,0,125,125,126,126,126,126,126,126,127,127,0,0,120,149,0,0,0,127,127,127,127,127,127,0,0,0,125,125,126,126,126,126,126,126,127,127,149,148,149,149,149,0,0,127,127,127,127,127,127,127,127,127,127,127,127,0,0,-1,0,149,149,148,149,149,149,160,0,160,160,160,0,0,0,0,0,127,127,127,127,127,127,121,-1,149,0,0,0,0,160,0,0,0,0,0,0,126,126,126,126,126,126,126,126,127,127,0,122,0,0,0,0,0,127,127,127,127,127,127,0,0,127,127,127,127,127,127,127,127,127,127,0,0,0,0,0,0,0,127,127,127,127,127,127,0,127,127,127,127,127,127,-1,217,217,217,217,217,217,217,217,217,217,164,0,0,0,0,0,0,0,127,127,127,127,127,127,-1,0,0,0,128,0,0,0,0,0,0,0,0,134,134,135,135,135,135,135,135,136,136,264,0,0,0,0,0,129,136,136,136,136,136,136,0,0,134,134,135,135,135,135,135,135,136,136,0,0,0,0,0,0,0,136,136,136,136,136,136,0,136,136,136,136,136,136,-1,218,218,218,218,218,218,218,218,218,218,0,0,0,0,0,0,0,0,136,136,136,136,136,136,-1,0,0,0,130,0,0,0,0,0,0,0,0,135,135,135,135,135,135,135,135,136,136,0,0,0,0,0,0,131,136,136,136,136,136,136,0,0,136,136,136,136,136,136,136,136,136,136,0,0,0,0,0,0,0,136,136,136,136,136,136,0,136,136,136,136,136,136,222,222,222,222,222,222,222,222,222,222,0,0,0,179,0,0,0,0,0,136,136,136,136,136,136,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,143,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,226,226,226,226,226,226,226,226,226,226,0,179,179,179,179,179,179,179,179,179,179,269,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,144,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,241,241,241,241,241,241,241,241,241,241,0,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,145,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,146,0,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,245,245,245,245,245,245,245,245,245,245,0,179,179,179,179,179,179,179,179,179,179,273,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,160,0,160,160,160,221,221,221,221,221,221,221,221,221,221,0,0,0,0,0,0,0,0,160,0,0,0,179,260,260,260,260,260,260,260,260,260,260,0,179,179,179,179,179,179,179,179,179,179,0,0,0,266,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,165,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,217,217,217,217,217,217,217,217,217,217,0,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,162,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,221,221,221,221,221,221,221,221,221,221,0,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,163,179,179,179,179,179,179,179,179,225,225,225,225,225,225,225,225,225,225,0,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,159,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,240,240,240,240,240,240,240,240,240,240,0,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,158,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,244,244,244,244,244,244,244,244,244,244,0,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,259,259,259,259,259,259,259,259,259,259,0,188,188,188,188,188,188,188,188,188,188,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,279,279,279,279,279,279,279,279,279,279,0,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,283,283,283,283,283,283,283,283,283,283,0,180,180,180,180,180,180,180,180,180,180,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,297,0,179,0,0,295,0,0,0,0,0,0,0,0,180,180,180,180,180,180,180,180,180,180,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,302,0,179,0,0,300,0,0,0,0,0,0,0,0,180,180,180,180,180,180,180,180,180,180,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,307,0,179,0,0,305,0,0,0,0,0,0,0,0,180,180,180,180,180,180,180,180,180,180,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,278,278,278,278,278,278,278,278,278,278,0,197,197,197,197,197,197,197,197,197,197,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,282,282,282,282,282,282,282,282,282,282,0,202,202,202,202,202,202,202,202,202,202,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,206,179,179,179,179,207,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,294,294,294,294,294,294,294,294,294,294,0,202,202,202,202,202,202,202,202,202,202,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,296,296,296,296,296,296,296,296,296,296,0,184,184,184,184,184,184,184,184,184,184,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,299,299,299,299,299,299,299,299,299,299,0,211,211,211,211,211,211,211,211,211,211,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,301,301,301,301,301,301,301,301,301,301,0,192,192,192,192,192,192,192,192,192,192,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,263,0,180,180,180,180,180,180,180,180,180,180,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,196,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,263,0,181,181,181,181,181,181,181,181,181,181,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,183,0,0,0,0,0,0,0,0,0,263,0,183,183,183,183,183,183,183,183,183,183,0,0,0,0,0,0,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,0,0,0,0,183,0,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,0,0,0,0,0,0,0,0,0,263,0,183,183,183,183,183,183,183,183,183,183,0,0,0,0,0,0,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,0,0,0,0,183,0,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,179,0,0,0,0,0,0,0,0,0,0,0,184,184,184,184,184,184,184,184,184,184,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,209,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,0,0,185,185,185,185,185,185,185,185,185,185,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,187,0,0,0,0,0,0,0,0,0,0,0,187,187,187,187,187,187,187,187,187,187,0,0,0,0,0,0,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,0,0,0,0,187,0,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,0,0,0,0,0,0,0,0,0,0,0,187,187,187,187,187,187,187,187,187,187,0,0,0,0,0,0,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,0,0,0,0,187,0,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,179,0,0,0,0,0,0,0,0,0,0,0,188,188,188,188,188,188,188,188,188,188,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,210,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,0,0,189,189,189,189,189,189,189,189,189,189,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,191,0,0,0,0,0,0,0,0,0,0,0,191,191,191,191,191,191,191,191,191,191,0,0,0,0,0,0,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,0,0,0,0,191,0,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,0,0,0,0,0,0,0,0,0,0,0,191,191,191,191,191,191,191,191,191,191,0,0,0,0,0,0,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,0,0,0,0,191,0,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,179,0,0,0,0,0,0,0,0,0,0,0,192,192,192,192,192,192,192,192,192,192,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,216,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,0,0,193,193,193,193,193,193,193,193,193,193,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,195,0,0,0,0,0,0,0,0,0,0,0,195,195,195,195,195,195,195,195,195,195,0,0,0,0,0,0,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,0,0,0,0,195,0,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,0,0,0,0,0,0,0,0,0,0,0,195,195,195,195,195,195,195,195,195,195,0,0,0,0,0,0,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,0,0,0,0,195,0,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,179,0,0,0,0,0,0,0,0,0,0,0,181,181,181,181,181,181,181,181,181,181,0,0,0,0,0,0,179,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,0,0,0,0,182,0,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,179,0,0,0,0,0,0,0,0,0,265,0,197,197,197,197,197,197,197,197,197,197,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,201,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,265,0,198,198,198,198,198,198,198,198,198,198,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,200,0,0,0,0,0,0,0,0,0,265,0,200,200,200,200,200,200,200,200,200,200,0,0,0,0,0,0,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,0,0,0,0,200,0,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,0,0,0,0,0,0,0,0,0,265,0,200,200,200,200,200,200,200,200,200,200,0,0,0,0,0,0,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,0,0,0,0,200,0,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,179,0,0,0,0,0,0,0,0,0,0,0,198,198,198,198,198,198,198,198,198,198,0,0,0,0,0,0,179,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,0,0,0,0,199,0,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,199,179,0,0,0,0,0,0,0,0,0,267,0,202,202,202,202,202,202,202,202,202,202,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,208,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,267,0,203,203,203,203,203,203,203,203,203,203,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,205,0,0,0,0,0,0,0,0,0,267,0,205,205,205,205,205,205,205,205,205,205,0,0,0,0,0,0,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,0,0,0,0,205,0,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,0,0,0,0,0,0,0,0,0,267,0,205,205,205,205,205,205,205,205,205,205,0,0,0,0,0,0,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,0,0,0,0,205,0,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,179,0,0,0,0,0,0,0,0,0,0,0,202,202,202,202,202,202,202,202,202,202,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,0,0,202,202,202,202,202,202,202,202,202,202,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,0,0,203,203,203,203,203,203,203,203,203,203,0,0,0,0,0,0,179,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,0,0,0,0,204,0,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,179,0,0,0,0,0,0,0,0,0,0,0,185,185,185,185,185,185,185,185,185,185,0,0,0,0,0,0,179,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,0,0,0,0,186,0,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,179,0,0,0,0,0,0,0,0,0,0,0,189,189,189,189,189,189,189,189,189,189,0,0,0,0,0,0,179,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,0,0,0,0,190,0,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,179,0,0,0,0,0,0,0,0,0,271,0,211,211,211,211,211,211,211,211,211,211,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,215,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,0,0,0,0,0,271,0,212,212,212,212,212,212,212,212,212,212,0,0,0,0,0,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,0,0,0,0,179,0,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,214,0,0,0,0,0,0,0,0,0,271,0,214,214,214,214,214,214,214,214,214,214,0,0,0,0,0,0,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,0,0,0,0,214,0,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,0,0,0,0,0,0,0,0,0,271,0,214,214,214,214,214,214,214,214,214,214,0,0,0,0,0,0,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,0,0,0,0,214,0,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,214,179,0,0,0,0,0,0,0,0,0,0,0,212,212,212,212,212,212,212,212,212,212,0,0,0,0,0,0,179,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,0,0,0,0,213,0,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,179,0,0,0,0,0,0,0,0,0,0,0,193,193,193,193,193,193,193,193,193,193,0,0,0,0,0,0,179,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,0,0,0,0,194,0,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,194,220,0,0,0,0,0,0,0,0,0,0,0,220,220,220,220,220,220,220,220,220,220,0,0,0,0,0,0,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,0,0,0,0,220,0,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,0,0,0,0,0,0,0,0,0,0,0,220,220,220,220,220,220,220,220,220,220,0,0,0,0,0,0,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,0,0,0,0,220,0,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,224,0,0,0,0,0,0,0,0,0,0,0,224,224,224,224,224,224,224,224,224,224,0,0,0,0,0,0,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,0,0,0,0,224,0,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,0,0,0,0,0,0,0,0,0,0,0,224,224,224,224,224,224,224,224,224,224,0,0,0,0,0,0,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,0,0,0,0,224,0,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225,0,0,0,0,0,0,0,288,0,288,228,269,278,278,278,278,278,278,278,278,278,278,228,228,228,228,228,228,228,228,228,228,0,0,0,0,0,268,228,228,228,228,228,229,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,0,0,0,0,228,0,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,0,0,0,0,0,0,0,0,0,0,0,228,228,228,228,228,228,228,228,228,228,0,0,0,0,0,0,228,228,228,228,228,229,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,0,0,0,0,228,0,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,0,0,0,0,0,0,0,0,0,0,0,232,232,232,232,232,232,232,232,232,232,0,0,0,0,0,0,228,228,228,228,228,229,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,0,0,0,0,228,0,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,239,0,0,0,0,0,0,0,0,0,0,0,233,233,233,233,233,233,233,233,233,233,0,0,0,0,0,0,239,239,239,239,239,231,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,0,0,0,0,239,0,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,0,0,0,0,0,0,0,0,0,0,0,233,233,233,233,233,233,233,233,233,233,0,0,0,0,0,0,239,239,239,239,239,231,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,0,0,0,0,239,0,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,228,0,0,0,0,0,0,0,0,0,0,0,232,232,232,232,232,232,232,232,232,232,0,0,0,0,0,0,228,228,228,228,228,229,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,0,0,0,0,234,0,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,239,0,0,0,0,0,0,0,0,0,0,0,233,233,233,233,233,233,233,233,233,233,0,0,0,0,0,0,239,239,239,239,239,231,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,0,0,0,0,235,0,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,228,0,0,0,0,0,0,0,0,0,0,0,236,236,236,236,236,236,236,236,236,236,0,0,0,0,0,0,228,238,238,238,238,230,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,0,0,0,0,238,0,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,239,0,0,0,0,0,0,0,0,0,0,0,237,237,237,237,237,237,237,237,237,237,0,0,0,0,0,0,239,238,238,238,238,230,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,0,0,0,0,238,0,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,238,228,0,0,0,0,0,0,0,0,0,0,0,236,236,236,236,236,236,236,236,236,236,0,0,0,0,0,0,228,228,228,228,228,229,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,0,0,0,0,228,0,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,239,0,0,0,0,0,0,0,0,0,0,0,237,237,237,237,237,237,237,237,237,237,0,0,0,0,0,0,239,239,239,239,239,231,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,0,0,0,0,239,0,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,0,0,0,0,0,0,0,0,0,0,0,239,239,239,239,239,239,239,239,239,239,0,0,0,0,0,0,239,239,239,239,239,231,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,0,0,0,0,239,0,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,0,0,0,0,0,0,0,0,0,0,0,239,239,239,239,239,239,239,239,239,239,0,0,0,0,0,0,239,239,239,239,239,231,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,0,0,0,0,239,0,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,239,240,240,240,240,240,240,240,240,240,240,0,0,0,0,0,0,291,0,291,0,243,282,282,282,282,282,282,282,282,282,282,0,243,243,243,243,243,243,243,243,243,243,0,0,0,0,0,270,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,0,0,0,0,243,0,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,0,0,0,0,0,0,0,0,0,0,0,243,243,243,243,243,243,243,243,243,243,0,0,0,0,0,0,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,0,0,0,0,243,0,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,244,0,0,0,293,0,0,0,0,0,0,247,273,294,294,294,294,294,294,294,294,294,294,247,247,247,247,247,247,247,247,247,247,0,0,0,0,0,272,247,247,247,247,247,248,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,0,0,0,0,247,0,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,0,0,0,0,0,0,0,0,0,0,0,247,247,247,247,247,247,247,247,247,247,0,0,0,0,0,0,247,247,247,247,247,248,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,0,0,0,0,247,0,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,0,0,0,0,0,0,0,0,0,0,0,251,251,251,251,251,251,251,251,251,251,0,0,0,0,0,0,247,247,247,247,247,248,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,0,0,0,0,247,0,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,258,0,0,0,0,0,0,0,0,0,0,0,252,252,252,252,252,252,252,252,252,252,0,0,0,0,0,0,258,258,258,258,258,250,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,0,0,0,0,258,0,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,0,0,0,0,0,0,0,0,0,0,0,252,252,252,252,252,252,252,252,252,252,0,0,0,0,0,0,258,258,258,258,258,250,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,0,0,0,0,258,0,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,247,0,0,0,0,0,0,0,0,0,0,0,251,251,251,251,251,251,251,251,251,251,0,0,0,0,0,0,247,247,247,247,247,248,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,0,0,0,0,253,0,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,258,0,0,0,0,0,0,0,0,0,0,0,252,252,252,252,252,252,252,252,252,252,0,0,0,0,0,0,258,258,258,258,258,250,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,0,0,0,0,254,0,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,247,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,247,257,257,257,257,249,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,0,0,0,0,257,0,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,258,0,0,0,0,0,0,0,0,0,0,0,256,256,256,256,256,256,256,256,256,256,0,0,0,0,0,0,258,257,257,257,257,249,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,0,0,0,0,257,0,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,257,247,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,247,247,247,247,247,248,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,0,0,0,0,247,0,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,258,0,0,0,0,0,0,0,0,0,0,0,256,256,256,256,256,256,256,256,256,256,0,0,0,0,0,0,258,258,258,258,258,250,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,0,0,0,0,258,0,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,0,0,0,0,0,0,0,0,0,0,0,258,258,258,258,258,258,258,258,258,258,0,0,0,0,0,0,258,258,258,258,258,250,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,0,0,0,0,258,0,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,0,0,0,0,0,0,0,0,0,0,0,258,258,258,258,258,258,258,258,258,258,0,0,0,0,0,0,258,258,258,258,258,250,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,0,0,0,0,258,0,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,259,259,259,259,259,259,259,259,259,259,0,0,298,0,0,0,0,0,0,0,262,299,299,299,299,299,299,299,299,299,299,0,262,262,262,262,262,262,262,262,262,262,0,0,0,0,0,274,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,0,0,0,0,262,0,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,0,0,0,0,0,0,0,0,0,0,0,262,262,262,262,262,262,262,262,262,262,0,0,0,0,0,0,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,0,0,0,0,262,0,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,262,218,218,218,218,218,218,218,218,218,218,0,0,0,0,0,0,0,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,0,0,0,0,219,0,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,219,222,222,222,222,222,222,222,222,222,222,0,0,0,0,0,0,0,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,0,0,0,0,223,0,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,226,226,226,226,226,226,226,226,226,226,0,0,0,0,0,0,0,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,0,0,0,0,227,0,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,227,241,241,241,241,241,241,241,241,241,241,0,0,0,0,0,0,0,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,0,0,0,0,242,0,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,242,245,245,245,245,245,245,245,245,245,245,0,0,0,0,0,0,0,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,0,0,0,0,246,0,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,246,260,260,260,260,260,260,260,260,260,260,0,0,0,0,0,0,0,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,0,0,0,0,261,0,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,276,276,276,276,276,276,276,276,276,276,276,276,276,276,276,276,276,276,276,276,287,287,0,0,0,0,0,0,0,0,287,287,0,0,277,277,277,277,277,277,277,277,277,277,0,0,0,289,0,0,0,0,287,287,287,287,0,289,0,0,0,0,287,287,278,278,278,278,278,278,278,278,278,278,0,0,0,0,0,0,0,289,0,0,281,0,287,287,0,0,0,0,0,0,0,0,281,281,281,281,281,281,281,281,281,281,0,0,0,0,0,289,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,0,0,0,0,281,0,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,0,0,0,0,0,0,0,0,0,0,0,281,281,281,281,281,281,281,281,281,281,0,0,0,0,0,0,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,0,0,0,0,281,0,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,282,282,282,282,282,282,282,282,282,282,0,0,0,0,0,0,0,0,0,0,285,0,0,0,0,0,0,0,0,0,0,0,285,285,285,285,285,285,285,285,285,285,0,0,0,0,0,292,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,0,0,0,0,285,0,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,0,0,0,0,0,0,0,0,0,0,0,285,285,285,285,285,285,285,285,285,285,0,0,0,0,0,0,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,0,0,0,0,285,0,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,275,0,286,286,286,286,286,286,286,286,286,286,293,0,0,0,0,0,0,0,0,0,290,290,0,0,296,296,296,296,296,296,296,296,296,296,0,0,0,279,279,279,279,279,279,279,279,279,279,0,0,0,0,0,290,290,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,0,0,0,0,280,0,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,283,283,283,283,283,283,283,283,283,283,0,0,0,0,0,0,0,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,0,0,0,0,284,0,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,298,0,0,0,0,0,0,0,0,0,0,0,0,0,301,301,301,301,301,301,301,301,301,301,303,0,0,0,0,0,0,0,0,304,304,304,304,304,304,304,304,304,304,0,0,0,0,0,0,0,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,0,0,0,0,0,0,0,304,304,304,304,304,304,0,303,0,304,304,304,304,304,304,0,0,0,0,0,0,306,306,306,306,306,306,306,306,306,306,0,304,304,304,304,304,304,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,0,0,0,0,0,0,0,306,306,306,306,306,306,0,0,0,306,306,306,306,306,306,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,306,306,306,306,306,306,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
-
-alex_check :: Array Int Int
-alex_check = listArray (0,10395) [-1,9,10,11,12,13,10,10,10,35,62,10,10,10,10,61,62,42,81,113,61,61,46,46,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,46,35,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,46,46,46,46,95,67,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,46,125,41,9,99,11,12,13,47,86,48,49,50,51,52,53,54,55,56,57,69,69,61,46,84,71,32,65,101,116,79,69,70,71,101,69,84,101,76,118,78,79,46,116,111,78,84,68,46,110,84,46,116,100,82,46,114,46,82,97,85,69,46,101,102,103,117,46,65,114,108,101,110,111,76,69,83,46,116,97,103,108,101,115,46,46,46,86,46,118,46,46,46,46,46,66,47,90,79,10,10,79,66,90,10,41,10,10,79,90,58,10,90,-1,102,79,-1,-1,-1,90,-1,-1,-1,34,34,10,90,9,10,11,12,13,-1,39,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,34,32,-1,-1,-1,65,66,67,68,69,70,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,9,10,11,12,13,-1,-1,65,66,67,68,69,70,97,98,99,100,101,102,-1,-1,10,-1,32,9,10,11,12,13,9,-1,11,12,13,-1,-1,-1,-1,-1,97,98,99,100,101,102,34,10,32,-1,-1,-1,-1,32,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,34,-1,-1,-1,-1,-1,65,66,67,68,69,70,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,-1,97,98,99,100,101,102,10,48,49,50,51,52,53,54,55,56,57,105,-1,-1,-1,-1,-1,-1,-1,97,98,99,100,101,102,10,-1,-1,-1,39,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,95,-1,-1,-1,-1,-1,39,65,66,67,68,69,70,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,-1,97,98,99,100,101,102,10,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,-1,97,98,99,100,101,102,10,-1,-1,-1,39,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,39,65,66,67,68,69,70,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,-1,97,98,99,100,101,102,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,36,-1,-1,-1,-1,-1,97,98,99,100,101,102,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,69,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,40,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,69,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,9,-1,11,12,13,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,-1,32,-1,-1,-1,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,95,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,34,-1,36,-1,-1,39,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,34,-1,36,-1,-1,39,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,34,-1,36,-1,-1,39,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,43,-1,45,36,69,48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,95,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,43,-1,45,-1,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,95,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,39,-1,-1,-1,-1,-1,-1,36,69,48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,95,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,39,-1,-1,-1,-1,-1,-1,-1,36,48,49,50,51,52,53,54,55,56,57,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,95,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54,55,56,57,68,69,-1,-1,-1,-1,-1,-1,-1,-1,68,69,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,95,-1,-1,-1,-1,100,101,68,69,-1,95,-1,-1,-1,-1,100,101,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,95,-1,-1,36,-1,100,101,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,95,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,95,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,46,-1,48,49,50,51,52,53,54,55,56,57,34,-1,-1,-1,-1,-1,-1,-1,-1,-1,68,69,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,100,101,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,34,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,39,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,-1,34,-1,97,98,99,100,101,102,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,97,98,99,100,101,102,65,66,67,68,69,70,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,-1,-1,-1,97,98,99,100,101,102,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,97,98,99,100,101,102,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]
-
-alex_deflt :: Array Int Int
-alex_deflt = listArray (0,313) [-1,-1,3,3,-1,-1,-1,-1,9,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,124,124,124,124,124,-1,-1,-1,-1,133,133,133,133,133,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,151,151,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]
-
-alex_accept = listArray (0::Int,313) [[],[],[(AlexAccPred (alex_action_0) (alexRightContext 6))],[(AlexAccPred (alex_action_0) (alexRightContext 6))],[],[(AlexAcc (alex_action_2))],[],[(AlexAccSkip)],[(AlexAccPred (alex_action_1) (alexRightContext 10))],[(AlexAccPred (alex_action_1) (alexRightContext 10))],[],[(AlexAccSkip)],[(AlexAccSkip)],[(AlexAcc (alex_action_4))],[(AlexAcc (alex_action_5))],[(AlexAcc (alex_action_25))],[(AlexAcc (alex_action_6))],[(AlexAcc (alex_action_31))],[(AlexAcc (alex_action_7))],[(AlexAcc (alex_action_22))],[(AlexAcc (alex_action_8))],[(AlexAcc (alex_action_23))],[(AlexAcc (alex_action_9))],[(AlexAcc (alex_action_9))],[(AlexAcc (alex_action_9))],[(AlexAcc (alex_action_35))],[],[],[],[],[(AlexAcc (alex_action_10))],[(AlexAcc (alex_action_10))],[(AlexAcc (alex_action_10))],[],[],[],[],[(AlexAcc (alex_action_11))],[(AlexAcc (alex_action_11))],[(AlexAcc (alex_action_11))],[],[],[],[],[(AlexAcc (alex_action_20))],[(AlexAcc (alex_action_12))],[(AlexAcc (alex_action_12))],[(AlexAcc (alex_action_12))],[],[],[],[],[(AlexAcc (alex_action_21))],[(AlexAcc (alex_action_13))],[(AlexAcc (alex_action_13))],[],[],[],[],[(AlexAcc (alex_action_14))],[(AlexAcc (alex_action_14))],[],[],[],[],[],[],[(AlexAcc (alex_action_15))],[(AlexAcc (alex_action_15))],[],[],[],[],[(AlexAcc (alex_action_16))],[(AlexAcc (alex_action_16))],[],[],[],[],[],[],[],[],[(AlexAcc (alex_action_17))],[(AlexAcc (alex_action_17))],[],[],[],[],[],[],[],[],[],[],[(AlexAcc (alex_action_18))],[(AlexAcc (alex_action_18))],[],[],[(AlexAcc (alex_action_19))],[(AlexAcc (alex_action_19))],[],[],[],[],[(AlexAcc (alex_action_20))],[(AlexAcc (alex_action_20))],[],[],[(AlexAcc (alex_action_21))],[(AlexAcc (alex_action_21))],[],[],[(AlexAcc (alex_action_24))],[(AlexAcc (alex_action_26))],[(AlexAcc (alex_action_27))],[(AlexAcc (alex_action_29))],[(AlexAcc (alex_action_28))],[(AlexAcc (alex_action_30))],[(AlexAcc (alex_action_32))],[(AlexAcc (alex_action_32))],[(AlexAcc (alex_action_32))],[(AlexAcc (alex_action_32))],[],[],[],[],[],[(AlexAcc (alex_action_33))],[(AlexAcc (alex_action_33))],[(AlexAcc (alex_action_33))],[(AlexAcc (alex_action_33))],[(AlexAcc (alex_action_34))],[],[],[],[],[(AlexAcc (alex_action_36))],[(AlexAcc (alex_action_37))],[(AlexAcc (alex_action_38))],[(AlexAcc (alex_action_39))],[(AlexAcc (alex_action_40))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[],[(AlexAccSkip)],[(AlexAccSkip)],[],[(AlexAccSkipPred (alexRightContext 152))],[(AlexAccSkipPred (alexRightContext 152))],[],[(AlexAccSkip)],[(AlexAcc (alex_action_44))],[(AlexAcc (alex_action_45))],[(AlexAcc (alex_action_46))],[(AlexAcc (alex_action_47))],[(AlexAcc (alex_action_47))],[(AlexAcc (alex_action_48))],[],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_48))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[(AlexAcc (alex_action_49))],[],[],[],[],[],[],[],[],[],[],[],[],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_50))],[(AlexAcc (alex_action_57))],[],[],[],[],[],[],[(AlexAcc (alex_action_51))],[],[],[],[],[(AlexAcc (alex_action_52))],[],[],[],[],[(AlexAcc (alex_action_53))],[],[],[],[],[(AlexAcc (alex_action_54))],[(AlexAcc (alex_action_54))],[(AlexAcc (alex_action_55))],[(AlexAcc (alex_action_55))],[(AlexAcc (alex_action_56))],[(AlexAcc (alex_action_56))]]
-{-# LINE 126 "Lexer.x" #-}
-
--- Each action has type :: String -> Token
-
-
-instance Copointed Token where copoint = gcopoint
-
--- The token type:
-data Token l = Key String l | OpPower l | OpMul l | OpDiv l | OpAdd l | OpSub l | OpConcat l
- | OpEQ l | OpNE l | OpLT l | OpLE l | OpGT l | OpGE l | OpLG l
- | OpNOT l | OpAND l | OpOR l | OpXOR l | OpEQV l | OpNEQV l
- | BinConst String l | OctConst String l | HexConst String l
- | ID String l | Num String l | Comma l | Bang l | Percent l
- | LParen l | RParen l | LArrCon l | RArrCon l | OpEquals l | RealConst String l | StopParamStart l
- | SingleQuote l | StrConst String l | Period l | Colon l | ColonColon l | SemiColon l
- | DataEditDest String l | Arrow l | MArrow l | TrueConst l | FalseConst l | Dollar l
- | Hash l | LBrace l | RBrace l | NewLine l | TokEOF l | Text String l
- deriving (Eq,Show,Generic1)
-
--- all reserved keywords, names are matched against these to see
--- if they are keywords or IDs
-keywords :: [String]
-keywords = ["allocate", "allocatable","assign",
- "assignment","automatic","backspace","block","call", "case",
- "character","close","common","complex","contains","continue","cycle",
- "data","deallocate","default","dimension","do",
- "double","elemental","else","elseif","elsewhere","end", "enddo", "endif", "endfile","entry",
- "equivalence","exit","external",
- "forall","format","function","goto","iolength",
- "if","implicit","in","include","inout","integer","intent","interface",
- "intrinsic","inquire","kind","len","logical","module",
- "namelist","none","nullify",
- "only","open","operator","optional","out","parameter",
- "pause","pointer","precision","print","private","procedure",
- "program","public","pure","real","read","recursive","result",
- "return","rewind","save","select","sequence","sometype","sqrt","stat",
- "stop","subroutine","target","to","then","type",
- "use","volatile","where","write"]
-
-{- old keywords, many will be removed
-keywords :: [String]
-keywords = ["access","action","advance","allocate","allocatable","assign",
- "assignment","automatic","backspace","blank","block","call","case",
- "character","close","common","complex","contains","continue","cycle",
- "data","deallocate","default","delim","dimension","direct","do",
- "double","elemental","else","elseif","elsewhere","end", "enddo", "endif", "endfile","entry",
- "eor","err","equivalence","exist","exit","external","file","fmt",
- "forall","form","format","formatted","function","goto","iostat","iolength",
- "if","implicit","in","inout","integer","intent","interface",
- "intrinsic","inquire","kind","len","logical","module","number",
- "named","nml","nextrec","namelist","none","nullify","null()",
- "only","open","opened","operator","optional","out","pad","parameter",
- "pause","pointer","position","precision","print","private","procedure",
- "program","pure","real","read","readwrite","rec","recl","recursive","result",
- "return","rewind","save","select","sequence","sequential","sometype","stat",
- "status","stop","subroutine","target","to","then","type","unformatted",
- "unit","use","volatile","where","write"]
--}
-
-lexer :: (Token SrcLoc -> P a) -> P a
-lexer = runL lexer'
-
-lexer' :: Lex a (Token SrcLoc)
-lexer' = do s <- getInput
- startToken
- l <- getSrcLocLex
- case alexScan ('\0',s) 0 of
- AlexEOF -> return $ TokEOF l
- AlexError (c,s') -> fail ("unrecognizable token: " ++ show c)
- AlexSkip (_,s') len -> (discard len) >> lexer'
- AlexToken (_,s') len act -> do let tok = act (take len s)
- if (tok l) == (NewLine l)
- then lexNewline >> (return $ tok l)
- else (discard len) >> (return $ tok l)
-
-alex_action_0 = \s -> Text s
-alex_action_1 = \s -> NewLine
-alex_action_2 = \s -> NewLine
-alex_action_4 = \s -> Hash
-alex_action_5 = \s -> MArrow
-alex_action_6 = \s -> Arrow
-alex_action_7 = \s -> OpPower
-alex_action_8 = \s -> OpConcat
-alex_action_9 = \s -> OpEQ
-alex_action_10 = \s -> OpNE
-alex_action_11 = \s -> OpLE
-alex_action_12 = \s -> OpGE
-alex_action_13 = \s -> OpNOT
-alex_action_14 = \s -> OpAND
-alex_action_15 = \s -> OpOR
-alex_action_16 = \s -> TrueConst
-alex_action_17 = \s -> FalseConst
-alex_action_18 = \s -> OpEQV
-alex_action_19 = \s -> OpNEQV
-alex_action_20 = \s -> OpLT
-alex_action_21 = \s -> OpGT
-alex_action_22 = \s -> OpMul
-alex_action_23 = \s -> OpDiv
-alex_action_24 = \s -> OpAdd
-alex_action_25 = \s -> OpSub
-alex_action_26 = \s -> Comma
-alex_action_27 = \s -> LArrCon
-alex_action_28 = \s -> RArrCon
-alex_action_29 = \s -> LParen
-alex_action_30 = \s -> RParen
-alex_action_31 = \s -> OpEquals
-alex_action_32 = \s -> StrConst s
-alex_action_33 = \s -> StrConst s
-alex_action_34 = \s -> SingleQuote
-alex_action_35 = \s -> Period
-alex_action_36 = \s -> ColonColon
-alex_action_37 = \s -> Colon
-alex_action_38 = \s -> SemiColon
-alex_action_39 = \s -> Dollar
-alex_action_40 = \s -> Key "null"
-alex_action_44 = \s -> Percent
-alex_action_45 = \s -> LBrace
-alex_action_46 = \s -> RBrace
-alex_action_47 = \s -> Key "elseif"
-alex_action_48 = \s -> if elem (map toLower s) keywords
- then Key (map toLower s)
- else ID s
-alex_action_49 = \s -> DataEditDest s
-alex_action_50 = \s -> Num s
-alex_action_51 = \s -> BinConst s
-alex_action_52 = \s -> OctConst s
-alex_action_53 = \s -> HexConst s
-alex_action_54 = \s -> BinConst s
-alex_action_55 = \s -> OctConst s
-alex_action_56 = \s -> HexConst s
-alex_action_57 = \s -> Num s
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "<built-in>" #-}
-{-# LINE 1 "<command-line>" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
--- -----------------------------------------------------------------------------
--- ALEX TEMPLATE
---
--- This code is in the PUBLIC DOMAIN; you may copy it freely and use
--- it for any purpose whatsoever.
-
--- -----------------------------------------------------------------------------
--- INTERNALS and main scanner engine
-
-{-# LINE 35 "templates/GenericTemplate.hs" #-}
-
-{-# LINE 45 "templates/GenericTemplate.hs" #-}
-
-{-# LINE 66 "templates/GenericTemplate.hs" #-}
-alexIndexInt16OffAddr arr off = arr ! off
-
-
-{-# LINE 87 "templates/GenericTemplate.hs" #-}
-alexIndexInt32OffAddr arr off = arr ! off
-
-
-{-# LINE 98 "templates/GenericTemplate.hs" #-}
-quickIndex arr i = arr ! i
-
-
--- -----------------------------------------------------------------------------
--- Main lexing routines
-
-data AlexReturn a
- = AlexEOF
- | AlexError !AlexInput
- | AlexSkip !AlexInput !Int
- | AlexToken !AlexInput !Int a
-
--- alexScan :: AlexInput -> StartCode -> AlexReturn a
-alexScan input (sc)
- = alexScanUser undefined input (sc)
-
-alexScanUser user input (sc)
- = case alex_scan_tkn user input (0) input sc AlexNone of
- (AlexNone, input') ->
- case alexGetChar input of
- Nothing ->
-
-
-
- AlexEOF
- Just _ ->
-
-
-
- AlexError input'
-
- (AlexLastSkip input len, _) ->
-
-
-
- AlexSkip input len
-
- (AlexLastAcc k input len, _) ->
-
-
-
- AlexToken input len k
-
-
--- Push the input through the DFA, remembering the most recent accepting
--- state it encountered.
-
-alex_scan_tkn user orig_input len input s last_acc =
- input `seq` -- strict in the input
- let
- new_acc = check_accs (alex_accept `quickIndex` (s))
- in
- new_acc `seq`
- case alexGetChar input of
- Nothing -> (new_acc, input)
- Just (c, new_input) ->
-
-
-
- let
- base = alexIndexInt32OffAddr alex_base s
- (ord_c) = ord c
- offset = (base + ord_c)
- check = alexIndexInt16OffAddr alex_check offset
-
- new_s = if (offset >= (0)) && (check == ord_c)
- then alexIndexInt16OffAddr alex_table offset
- else alexIndexInt16OffAddr alex_deflt s
- in
- case new_s of
- (-1) -> (new_acc, input)
- -- on an error, we want to keep the input *before* the
- -- character that failed, not after.
- _ -> alex_scan_tkn user orig_input (len + (1))
- new_input new_s new_acc
-
- where
- check_accs [] = last_acc
- check_accs (AlexAcc a : _) = AlexLastAcc a input (len)
- check_accs (AlexAccSkip : _) = AlexLastSkip input (len)
- check_accs (AlexAccPred a pred : rest)
- | pred user orig_input (len) input
- = AlexLastAcc a input (len)
- check_accs (AlexAccSkipPred pred : rest)
- | pred user orig_input (len) input
- = AlexLastSkip input (len)
- check_accs (_ : rest) = check_accs rest
-
-data AlexLastAcc a
- = AlexNone
- | AlexLastAcc a !AlexInput !Int
- | AlexLastSkip !AlexInput !Int
-
-data AlexAcc a user
- = AlexAcc a
- | AlexAccSkip
- | AlexAccPred a (AlexAccPred user)
- | AlexAccSkipPred (AlexAccPred user)
-
-type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool
-
--- -----------------------------------------------------------------------------
--- Predicates on a rule
-
-alexAndPred p1 p2 user in1 len in2
- = p1 user in1 len in2 && p2 user in1 len in2
-
---alexPrevCharIsPred :: Char -> AlexAccPred _
-alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input
-
---alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _
-alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input
-
---alexRightContext :: Int -> AlexAccPred _
-alexRightContext (sc) user _ _ input =
- case alex_scan_tkn user input (0) input sc AlexNone of
- (AlexNone, _) -> False
- _ -> True
- -- TODO: there's no need to find the longest
- -- match when checking the right context, just
- -- the first match will do.
-
--- used by wrappers
-iUnbox (i) = i
View
61 src/Language/Fortran/Lexer.x
@@ -1,21 +1,10 @@
{
-
-{-# LANGUAGE DeriveGeneric #-}
-
module Language.Fortran.Lexer where
import Data.Char
-import Debug.Trace
-
import Language.Fortran
-
-import Language.Haskell.Syntax (SrcLoc)
import Language.Haskell.ParseMonad
-import Generics.Deriving.Base hiding (P)
-import Generics.Deriving.Copoint
-
-
}
%wrapper "basic"
@@ -96,6 +85,8 @@ tokens :-
"=" { \s -> OpEquals }
\"(. # \")*\" { \s -> StrConst s }
\'(. # \')*\' { \s -> StrConst s }
+ "Z"\'(. # \')*\' { \s -> LitConst 'z' s }
+ "z"\'(. # \')*\' { \s -> LitConst 'z' s }
\' { \s -> SingleQuote }
\. { \s -> Period }
"::" { \s -> ColonColon }
@@ -104,7 +95,7 @@ tokens :-
"$" { \s -> Dollar }
"NULL()" { \s -> Key "null" }
"&" ; -- ignore & anywhere
- "&"$white*\n ; -- ignore & and spaces followed by '\n' (i.e. line sep)
+ "&"$white*\n { \s -> NewLineAmp } -- ; -- ignore & and spaces followed by '\n' (i.e. line sep)
"!".*$ ;
"%" { \s -> Percent }
"{" { \s -> LBrace }
@@ -125,21 +116,19 @@ tokens :-
{
-- Each action has type :: String -> Token
-
-
-instance Copointed Token where copoint = gcopoint
+
-- The token type:
-data Token l = Key String l | OpPower l | OpMul l | OpDiv l | OpAdd l | OpSub l | OpConcat l
- | OpEQ l | OpNE l | OpLT l | OpLE l | OpGT l | OpGE l | OpLG l
- | OpNOT l | OpAND l | OpOR l | OpXOR l | OpEQV l | OpNEQV l
- | BinConst String l | OctConst String l | HexConst String l
- | ID String l | Num String l | Comma l | Bang l | Percent l
- | LParen l | RParen l | LArrCon l | RArrCon l | OpEquals l | RealConst String l | StopParamStart l
- | SingleQuote l | StrConst String l | Period l | Colon l | ColonColon l | SemiColon l
- | DataEditDest String l | Arrow l | MArrow l | TrueConst l | FalseConst l | Dollar l
- | Hash l | LBrace l | RBrace l | NewLine l | TokEOF l | Text String l
- deriving (Eq,Show,Generic1)
+data Token = Key String | LitConst Char String | OpPower | OpMul | OpDiv | OpAdd | OpSub | OpConcat
+ | OpEQ | OpNE | OpLT | OpLE | OpGT | OpGE | OpLG
+ | OpNOT | OpAND | OpOR | OpXOR | OpEQV | OpNEQV
+ | BinConst String | OctConst String | HexConst String
+ | ID String | Num String | Comma | Bang | Percent
+ | LParen | RParen | LArrCon | RArrCon | OpEquals | RealConst String | StopParamStart
+ | SingleQuote | StrConst String | Period | Colon | ColonColon | SemiColon
+ | DataEditDest String | Arrow | MArrow | TrueConst | FalseConst | Dollar
+ | Hash | LBrace | RBrace | NewLine | TokEOF | Text String | NewLineAmp
+ deriving (Eq,Show)
-- all reserved keywords, names are matched against these to see
-- if they are keywords or IDs
@@ -181,19 +170,19 @@ keywords = ["access","action","advance","allocate","allocatable","assign",
"unit","use","volatile","where","write"]
-}
-lexer :: (Token SrcLoc -> P a) -> P a
+lexer :: (Token -> P a) -> P a
lexer = runL lexer'
-lexer' :: Lex a (Token SrcLoc)
+lexer' :: Lex a Token
lexer' = do s <- getInput
startToken
- l <- getSrcLocLex
- case alexScan ('\0',s) 0 of
- AlexEOF -> return $ TokEOF l
- AlexError (c,s') -> fail ("unrecognizable token: " ++ show c)
- AlexSkip (_,s') len -> (discard len) >> lexer'
- AlexToken (_,s') len act -> do let tok = act (take len s)
- if (tok l) == (NewLine l)
- then lexNewline >> (return $ tok l)
- else (discard len) >> (return $ tok l)
+ case alexScan ('\0',[],s) 0 of
+ AlexEOF -> return TokEOF
+ AlexError (c,b,s') -> fail ("unrecognizable token: " ++ show c)
+ AlexSkip (_,b,s') len -> (discard len) >> lexer'
+ AlexToken (_,b,s') len act -> do let tok = act (take len s)
+ case tok of
+ NewLine -> lexNewline >> (return tok)
+ NewLineAmp -> (discard len) >> lexNewline >> lexer'
+ _ -> (discard len) >> (return tok)
}
View
11,794 src/Language/Fortran/Parser.hs
0 additions, 11,794 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1,335 src/Language/Fortran/Parser.y
@@ -1,182 +1,182 @@
{
- {-# LANGUAGE QuasiQuotes #-}
- {-# LANGUAGE TypeSynonymInstances #-}
- {-# LANGUAGE FlexibleInstances #-}
-
module Language.Fortran.Parser where
import Language.Fortran
-import Language.Haskell.Syntax (SrcLoc,srcLine,srcColumn)
+import Language.Haskell.Syntax (SrcLoc(..))
import Language.Haskell.ParseMonad
import Language.Fortran.Lexer
import Data.Char (toLower)
--- import GHC.Exts
-
-import Debug.Trace
}
%name parser
-%tokentype { Token SrcLoc }
+%tokentype { Token }
%monad { P } { >>= } { return }
-%lexer { lexer } { TokEOF l }
+%lexer { lexer } { TokEOF }
%token
- '=>' { Arrow l }
- '**' { OpPower l }
- '//' { OpConcat l }
- '==' { OpEQ l }
- '/=' { OpNE l }
- '<=' { OpLE l }
- '>=' { OpGE l }
- '.NOT.' { OpNOT l }
- '.AND.' { OpAND l }
- '.OR.' { OpOR l }
- '.TRUE.' { TrueConst l }
- '.FALSE.' { FalseConst l }
--- '.EQV.' { OpEQV l }
--- '.NEGV.' { OpNEQV l }
- '<' { OpLT l }
- '>' { OpGT l }
- '*' { OpMul l }
- '/' { OpDiv l }
- '+' { OpAdd l }
- '-' { OpSub l }
- ',' { Comma l }
- '(' { LParen l }
- ')' { RParen l }
- '=' { OpEquals l }
--- '\'' { SingleQuote l }
--- '\"' { DoubleQuote l }
- '.' { Period l }
- '::' { ColonColon l }
- ':' { Colon l }
- ';' { SemiColon l }
- '#' { Hash l }
- '{' { LBrace l }
- '}' { RBrace l }
- '(/' { LArrCon l }
- '/)' { RArrCon l }
--- OBSOLETE '!' { Bang l }
- '%' { Percent l }
- '$' { Dollar l }
- -- OBSOLETE '!{' { StopParamStart l }
-'\n' { NewLine l }
- ALLOCATE { Key "allocate" l }
- ALLOCATABLE { Key "allocatable" l }
--- ASSIGN { Key "Assign" l }
- ASSIGNMENT { Key "assignment" l }
--- AUTOMATIC { Key "automatic" l }
- BACKSPACE { Key "backspace" l }
- BLOCK { Key "block" l }
- CALL { Key "call" l }
--- CASE { Key "case" l }
- CHARACTER { Key "character" l }
- CLOSE { Key "close" l }
- COMMON { Key "common" l }
- COMPLEX { Key "complex" l }
- CONTAINS { Key "contains" l }
- CONTINUE { Key "continue" l }
- CYCLE { Key "cycle" l }
- DATA { Key "data" l }
- DEALLOCATE { Key "deallocate" l }
--- DEFAULT { Key "default" l }
- DIMENSION { Key "dimension" l }
- DO { Key "do" l }
--- DOUBLE { Key "double" l }
- ELEMENTAL { Key "elemental" l }
- ELSE { Key "else" l }
- ELSEIF { Key "elseif" l }
--- ELSEWHERE { Key "elsewhere" l }
- END { Key "end" l }
- ENDIF { Key "endif" l }
- ENDDO { Key "enddo" l }
- ENDFILE { Key "endfile" l }
--- ENTRY { Key "entry" l }
- EQUIVALENCE { Key "equivalence" l }
- EXIT { Key "exit" l }
- EXTERNAL { Key "external" l }
- FORALL { Key "forall" l }
- FOREACH { Key "foreach" l }
--- FORMAT { Key "format" l }
- FUNCTION { Key "function" l }
- GOTO { Key "goto" l }
- IOLENGTH { Key "iolength" l }
- IF { Key "if" l }
- IMPLICIT { Key "implicit" l }
- IN { Key "in" l }
- INCLUDE { Key "include" l }
- INOUT { Key "inout" l }
- INTEGER { Key "integer" l }
- INTENT { Key "intent" l }
- INTERFACE { Key "interface" l }
- INTRINSIC { Key "intrinsic" l }
- INQUIRE { Key "inquire" l }
- KIND { Key "kind" l }
- LEN { Key "len" l }
- LOGICAL { Key "logical" l }
- MODULE { Key "module" l }
- NAMELIST { Key "namelist" l }
- NONE { Key "none" l }
- NULLIFY { Key "nullify" l }
- NULL { Key "null" l }
--- ONLY { Key "only" l }
- OPEN { Key "open" l }
- OPERATOR { Key "operator" l }
- OPTIONAL { Key "optional" l }
- OUT { Key "out" l }
- PARAMETER { Key "parameter" l }
--- PAUSE { Key "pause" l }
- POINTER { Key "pointer" l }
--- PRECISION { Key "precision" l }
- PRINT { Key "print" l }
- PRIVATE { Key "private" l }
- PROCEDURE { Key "procedure" l }
- PROGRAM { Key "program" l }
- PURE { Key "pure" l }
- PUBLIC { Key "public" l }
- REAL { Key "real" l }
- READ { Key "read" l }
- RECURSIVE { Key "recursive" l }
- RESULT { Key "result" l }
- RETURN { Key "return" l }
- REWIND { Key "rewind" l }
- SAVE { Key "save" l }
--- SELECT { Key "select" l }
- SEQUENCE { Key "sequence" l }
--- SIZE { Key "size" l }
- SOMETYPE { Key "sometype" l }
- SQRT { Key "sqrt" l }
- STAT { Key "stat" l }
- STOP { Key "stop" l }
- STR { StrConst $$ l }
- SUBROUTINE { Key "subroutine" l }
- TARGET { Key "target" l }
--- TO { Key "to" l }
- THEN { Key "then" l }
- TYPE { Key "type" l }
--- UNFORMATED { Key "unformatted" l }
- USE { Key "use" l }
- VOLATILE { Key "volatile" l }
- WHERE { Key "where" l }
- WRITE { Key "write" l }
- ID { ID $$ l }
- NUM { Num $$ l }
- TEXT { Text $$ l }
+ '=>' { Arrow }
+ '**' { OpPower }
+ '//' { OpConcat }
+ '==' { OpEQ }
+ '/=' { OpNE }
+ '<=' { OpLE }
+ '>=' { OpGE }
+ '.NOT.' { OpNOT }
+ '.AND.' { OpAND }
+ '.OR.' { OpOR }
+ '.TRUE.' { TrueConst }
+ '.FALSE.' { FalseConst }
+-- '.EQV.' { OpEQV }
+-- '.NEGV.' { OpNEQV }
+ '<' { OpLT }
+ '>' { OpGT }
+ '*' { OpMul }
+ '/' { OpDiv }
+ '+' { OpAdd }
+ '-' { OpSub }
+ ',' { Comma }
+ '(' { LParen }
+ ')' { RParen }
+ '=' { OpEquals }
+-- '\'' { SingleQuote }
+-- '\"' { DoubleQuote }
+ '.' { Period }
+ '::' { ColonColon }
+ ':' { Colon }
+ ';' { SemiColon }
+ '#' { Hash }
+ '{' { LBrace }
+ '}' { RBrace }
+ '(/' { LArrCon }
+ '/)' { RArrCon }
+--'b' { LitMark $$ }
+--'B' { LitMark $$ }
+--'z' { LitMark $$ }
+--'Z' { LitMark $$ }
+--'o' { LitMark $$ }
+--'O' { LitMark $$ }
+-- OBSOLETE '!' { Bang }
+ '%' { Percent }
+ '$' { Dollar }
+ -- OBSOLETE '!{' { StopParamStart }
+'\n' { NewLine }
+ ALLOCATE { Key "allocate" }
+ ALLOCATABLE { Key "allocatable" }
+ ASSIGN { Key "Assign" }
+ ASSIGNMENT { Key "assignment" }
+-- AUTOMATIC { Key "automatic" }
+ BACKSPACE { Key "backspace" }
+ BLOCK { Key "block" }
+ CALL { Key "call" }
+-- CASE { Key "case" }
+ CHARACTER { Key "character" }
+ CLOSE { Key "close" }
+ COMMON { Key "common" }
+ COMPLEX { Key "complex" }
+ CONTAINS { Key "contains" }
+ CONTINUE { Key "continue" }
+ CYCLE { Key "cycle" }
+ DATA { Key "data" }
+ DEALLOCATE { Key "deallocate" }
+-- DEFAULT { Key "default" }
+ DIMENSION { Key "dimension" }
+ DO { Key "do" }
+-- DOUBLE { Key "double" }
+ ELEMENTAL { Key "elemental" }
+ ELSE { Key "else" }
+ ELSEIF { Key "elseif" }
+-- ELSEWHERE { Key "elsewhere" }
+ END { Key "end" }
+ ENDIF { Key "endif" }
+ ENDDO { Key "enddo" }
+ ENDFILE { Key "endfile" }
+-- ENTRY { Key "entry" }
+ EQUIVALENCE { Key "equivalence" }
+ EXIT { Key "exit" }
+ EXTERNAL { Key "external" }
+ FORALL { Key "forall" }
+ FOREACH { Key "foreach" }
+-- FORMAT { Key "format" }
+ FUNCTION { Key "function" }
+ GOTO { Key "goto" }
+ IOLENGTH { Key "iolength" }
+ IF { Key "if" }
+ IMPLICIT { Key "implicit" }
+ IN { Key "in" }
+ INCLUDE { Key "include" }
+ INOUT { Key "inout" }
+ INTEGER { Key "integer" }
+ INTENT { Key "intent" }
+ INTERFACE { Key "interface" }
+ INTRINSIC { Key "intrinsic" }
+ INQUIRE { Key "inquire" }
+ KIND { Key "kind" }
+ LEN { Key "len" }
+ LOGICAL { Key "logical" }
+ MODULE { Key "module" }
+ NAMELIST { Key "namelist" }
+ NONE { Key "none" }
+ NULLIFY { Key "nullify" }
+ NULL { Key "null" }
+-- ONLY { Key "only" }
+ OPEN { Key "open" }
+ OPERATOR { Key "operator" }
+ OPTIONAL { Key "optional" }
+ OUT { Key "out" }
+ PARAMETER { Key "parameter" }
+-- PAUSE { Key "pause" }
+ POINTER { Key "pointer" }
+-- PRECISION { Key "precision" }
+ PRINT { Key "print" }
+ PRIVATE { Key "private" }
+ PROCEDURE { Key "procedure" }
+ PROGRAM { Key "program" }
+ PURE { Key "pure" }
+ PUBLIC { Key "public" }
+ REAL { Key "real" }
+ READ { Key "read" }
+ RECURSIVE { Key "recursive" }
+ RESULT { Key "result" }
+ RETURN { Key "return" }
+ REWIND { Key "rewind" }
+ SAVE { Key "save" }
+-- SELECT { Key "select" }
+ SEQUENCE { Key "sequence" }
+-- SIZE { Key "size" }
+ SOMETYPE { Key "sometype" }
+ SQRT { Key "sqrt" }
+ STAT { Key "stat" }
+ STOP { Key "stop" }
+ STR { StrConst $$ }
+ ZLIT { LitConst 'z' $$ }
+ SUBROUTINE { Key "subroutine" }
+ TARGET { Key "target" }
+-- TO { Key "to" }
+ THEN { Key "then" }
+ TYPE { Key "type" }
+-- UNFORMATED { Key "unformatted" }
+ USE { Key "use" }
+ VOLATILE { Key "volatile" }
+ WHERE { Key "where" }
+ WRITE { Key "write" }
+ ID { ID $$ }
+ NUM { Num $$ }
+ TEXT { Text $$ }
%%
-executable_program :: { [Program A0] }
+executable_program :: { Program A0 }
executable_program
: program_unit_list { $1 }
-program_unit_list :: { [Program A0] }
+program_unit_list :: { Program A0 }
program_unit_list
: program_unit_list newline0 program_unit { $1++[$3] }
| {- empty -} { [] }
-program_unit :: { Program A0 }
+program_unit :: { ProgUnit A0 }
program_unit
: main_program { $1 }
| external_subprogram { $1 }
@@ -185,33 +185,33 @@ program_unit
plist :: { [String] }
plist
- : plist ',' id2 { $1++[$3] }
- | id2 { [$1] }
+ : plist ',' id2 { $1++[$3] }
+ | id2 { [$1] }
vlist :: { [Expr A0] }
vlist
- : variable ',' vlist { $1:$3 }
- | variable { [$1] }
+ : variable ',' vlist { $1:$3 }
+ | variable { [$1] }
newline :: {}
-newline : '\n' newline {}
- | '\n' {}
+newline : '\n' newline0 {}
newline0 :: {}
-newline0 : newline {}
+newline0 : newline {}
| {- empty -} {}
-main_program :: { Program A0 }
+main_program :: { ProgUnit A0 }
main_program
- : program_stmt use_stmt_list implicit_part specification_part_top execution_part module_subprogram_part end_program_stmt newline0
- {% do { s <- srcSpanFrom (fst $1);
- name <- cmpNames (fst $1) $7 "program";
- return (Main s name (snd $1) (Block s $2 $3 $4 $5) $6); } }
+ : srcloc program_stmt use_stmt_list implicit_part srcloc specification_part_top execution_part module_subprogram_part end_program_stmt newline0
+ {% do { s <- getSrcSpan $1;
+ s' <- getSrcSpan $5;
+ name <- cmpNames (fst $2) $9 "program";
+ return (Main () s name (snd $2) (Block () $3 $4 s' $6 $7) $8); } }
program_stmt :: { (SubName A0, Arg A0) }
program_stmt
: PROGRAM subname args_p newline { ($2, $3) }
- | PROGRAM subname newline {% (srcSpanFrom $1) >>= (\l -> return $ ($2, (Arg l (NullArg l)))) }
+ | PROGRAM subname srcloc newline { ($2, (Arg () (NullArg ())) ($3, $3)) }
end_program_stmt :: { String }
end_program_stmt
@@ -220,29 +220,22 @@ end_program_stmt
| END { "" }
implicit_part :: { Implicit A0 }
-implicit_part : IMPLICIT NONE newline {% (srcSpanFrom $1) >>= (return . ImplicitNone) }
- | {- empty -} {% srcSpanNull >>= (return . ImplicitNull) }
-
---args
--- : args ',' id2 { }
--- | args { }
---end_program_stmt :: { String }
--- : END { "" }
--- | END PROGRAM { "" }
--- | END PROGRAM id2 { $3 }
+implicit_part
+ : IMPLICIT NONE newline { ImplicitNone () }
+ | {- empty -} { ImplicitNull () }
-
-external_subprogram :: { Program A0}
+external_subprogram :: { ProgUnit A0}
external_subprogram
- : function_subprogram { $1 }
- | subroutine_subprogram { $1 }
+ : function_subprogram { $1 }
+ | subroutine_subprogram { $1 }
-subroutine_subprogram :: { Program A0 }
+subroutine_subprogram :: { ProgUnit A0 }
subroutine_subprogram
- : subroutine_stmt use_stmt_list implicit_part specification_part_top execution_part end_subroutine_stmt newline0
- {% do { s <- srcSpanFrom (fst3 $1);
- name <- cmpNames (fst3 $1) $6 "subroutine";
- return (Sub s (trd3 $1) name (snd3 $1) (Block s $2 $3 $4 $5)); } }
+ : srcloc subroutine_stmt use_stmt_list implicit_part srcloc specification_part_top execution_part end_subroutine_stmt newline0
+ {% do { s <- getSrcSpan $1;
+ s' <- getSrcSpan $5;
+ name <- cmpNames (fst3 $2) $8 "subroutine";
+ return (Sub () s (trd3 $2) name (snd3 $2) (Block () $3 $4 s' $6 $7)); } }
end_subroutine_stmt :: { String }
end_subroutine_stmt
@@ -256,36 +249,37 @@ end_function_stmt
| END FUNCTION { "" }
| END { "" }
-function_subprogram :: { Program A0 }
+function_subprogram :: { ProgUnit A0 }
function_subprogram
- : function_stmt use_stmt_list implicit_part specification_part_top execution_part end_function_stmt newline0 {% do { s <- srcSpanFrom (fst3 $1);
- name <- cmpNames (fst3 $1) $6 "function";
- return (Function s (trd3 $1) name (snd3 $1) (Block s $2 $3 $4 $5)); } }
+: srcloc function_stmt use_stmt_list implicit_part srcloc specification_part_top execution_part end_function_stmt newline0 {% do { s <- getSrcSpan $1;
+ s' <- getSrcSpan $5;
+ name <- cmpNames (fst3 $2) $8 "function";
+ return (Function () s (trd3 $2) name (snd3 $2) (Block () $3 $4 s' $6 $7)); } }
-block_data :: { Program A0 }
+block_data :: { ProgUnit A0 }
block_data
- : block_data_stmt use_stmt_list implicit_part specification_part_top end_block_data_stmt
- {% do { s <- srcSpanFrom $1;
- name <- cmpNames $1 $5 "block data";
- return (BlockData s name $2 $3 $4); } }
+ : srcloc block_data_stmt use_stmt_list implicit_part specification_part_top end_block_data_stmt
+ {% do { s <- getSrcSpan $1;
+ name <- cmpNames $2 $6 "block data";
+ return (BlockData () s name $3 $4 $5); } }
block_data_stmt :: { SubName A0 }
block_data_stmt
: BLOCK DATA subname { $3 }
- | BLOCK DATA {% do { s <- srcSpanFrom $1;
- return $ NullSubName s; } }
+| BLOCK DATA { NullSubName () }
end_block_data_stmt :: { String }
end_block_data_stmt
- : END BLOCK DATA id2 { $4 }
- | END BLOCK DATA { "" }
- | END { "" }
+ : END BLOCK DATA id2 { $4 }
+ | END BLOCK DATA { "" }
+ | END { "" }
-module :: { Program A0 }
+module :: { ProgUnit A0 }
module
- : module_stmt use_stmt_list implicit_part specification_part_top module_subprogram_part end_module_stmt {% do { s <- srcSpanFrom $1;
- name <- cmpNames $1 $6 "module";
- return (Module s name $2 $3 $4 $5); } }
+ : srcloc module_stmt use_stmt_list implicit_part specification_part_top module_subprogram_part end_module_stmt
+ {% do { s <- getSrcSpan $1;
+ name <- cmpNames $2 $7 "module";
+ return (Module ()s name $3 $4 $5 $6); } }
module_stmt :: { SubName A0 }
module_stmt
@@ -297,39 +291,45 @@ end_module_stmt
| END MODULE { "" }
| END { "" }
-module_subprogram_part :: { [Program A0] }
+module_subprogram_part :: { Program A0 }
module_subprogram_part
: CONTAINS newline internal_subprogram_list { $3 }
| {- empty -} { [] }
-internal_subprogram_list :: { [Program A0] }
+internal_subprogram_list :: { Program A0 }
internal_subprogram_list
: internal_subprogram_list internal_subprogram newline0 { $1++[$2] }
| {- empty -} { [] }
-internal_subprogram :: { Program A0 }
+internal_subprogram :: { ProgUnit A0 }
internal_subprogram
: subroutine_subprogram { $1 }
| function_subprogram { $1 }
-use_stmt_list :: { [String] }
+use_stmt_list :: { Uses A0 }
use_stmt_list
- : use_stmt_list use_stmt { $2:$1 }
- | {- empty -} { [] }
+: use_stmt_list use_stmt { Use () $2 $1 () }
+| {- empty -} { UseNil () }
-use_stmt :: { String }
+use_stmt :: { (String, Renames) }
use_stmt
- : USE id2 newline { $2 }
+: USE id2 newline { ($2, []) }
+| USE id2 ',' renames newline { ($2, $4) }
+
+renames :: { [(Variable, Variable)] }
+: id2 '=>' id2 { [($1, $3)] }
+ | renames ',' renames { $1 ++ $3 }
+
-- [DO: Allows the specification part of a module to be empty]
specification_part_top :: { Decl A0 }
specification_part_top
: specification_part { $1 }
- | {- empty -} {% srcSpanNull >>= (return . NullDecl) }
+ | {- empty -} {% getSrcSpanNull >>= (\s -> return $ NullDecl () s)}
specification_part :: { Decl A0 }
specification_part
- : declaration_construct_l specification_part {% srcSpanFromL $1 (\s -> DSeq s $1 $2) }
+ : declaration_construct_l specification_part { DSeq () $1 $2 }
| declaration_construct_l { $1 }
@@ -342,36 +342,38 @@ declaration_construct_p
: declaration_construct { $1 }
| specification_stmt { $1 }
| derived_type_def { $1 }
- | TEXT {% srcSpan l >>= (\s -> return $ TextDecl s $1) }
+ | TEXT { TextDecl () $1 }
+
+-- Not sure about the ArrayT outputs here, think this may be a bug
declaration_construct :: { Decl A0 }
declaration_construct
- : type_spec_p attr_spec_list '::' entity_decl_list {% srcSpanFromL (fst3 $1) (\s ->
- if isEmpty (fst $2)
- then Decl s $4 ((BaseType s (fst3 $1) (snd $2) (snd3 $1) (trd3 $1)))
- else Decl s $4 ((ArrayT s (fst $2) (fst3 $1) (snd $2) (snd3 $1) (trd3 $1)))) }
- | type_spec_p attr_spec_list entity_decl_list {% srcSpanFromL (fst3 $1) (\s ->
- if isEmpty (fst $2)
- then Decl s $3 ((BaseType s (fst3 $1) (snd $2) (snd3 $1) (trd3 $1)))
- else Decl s $3 ((ArrayT s (fst $2) (fst3 $1) (snd $2) (snd3 $1) (trd3 $1)))) }
+ : srcloc type_spec_p attr_spec_list '::' entity_decl_list
+ {% (getSrcSpan $1) >>= (\s -> return $ if isEmpty (fst $3)
+ then Decl () s $5 ((BaseType () (fst3 $2) (snd $3) (snd3 $2) (trd3 $2)))
+ else Decl () s $5 ((ArrayT () (fst $3) (fst3 $2) (snd $3) (snd3 $2) (trd3 $2)))) }
+ | srcloc type_spec_p attr_spec_list entity_decl_list
+ {% (getSrcSpan $1) >>= (\s -> return $ if isEmpty (fst $3)
+ then Decl () s $4 ((BaseType () (fst3 $2) (snd $3) (snd3 $2) (trd3 $2)))
+ else Decl () s $4 ((ArrayT () (fst $3) (fst3 $2) (snd $3) (snd3 $2) (trd3 $2)))) }
| interface_block { $1 }
| include_stmt { $1 }
+
attr_spec_list :: {([(Expr A0, Expr A0)],[Attr A0])}
attr_spec_list
: attr_spec_list ',' attr_spec { (fst $1++fst $3,snd $1++snd $3) }
| {- empty -} { ([],[]) }
entity_decl_list :: { [(Expr A0, Expr A0)] }
entity_decl_list
- : entity_decl_list ',' entity_decl { $1++[$3] }
- | entity_decl { [$1] }
+: entity_decl ',' entity_decl_list { $1:$3 }
+| entity_decl { [$1] }
entity_decl :: { (Expr A0, Expr A0) }
entity_decl
- : ID '=' expr {% srcSpan l >>= (\s -> return $ (Var s [(VarName s $1,[])], $3)) }
- | variable {% srcSpanNull >>= (\s -> return ($1, NullExpr s)) } -- TODO too general need to eleminate ability to parse v%u type vars
--- | function_name [ '*' char_length ]
+ : srcloc ID '=' expr {% getSrcSpan $1 >>= (\s -> return $ (Var () s [(VarName () $2,[])], $4)) }
+ | variable {% getSrcSpanNull >>= (\s -> return $ ($1, NullExpr () s)) }
object_name :: { String }
object_name
@@ -383,54 +385,55 @@ type_spec_p
type_spec :: { (BaseType A0, Expr A0, Expr A0) }
type_spec
- : INTEGER kind_selector {% srcSpanFromL $1 (\s -> (Integer s, $2, ne s)) }
- | INTEGER '*' length_value {% srcSpanFromL $1 (\s -> (Integer s, $3,ne s)) }
- | INTEGER {% srcSpanFromL $1 (\l ->(Integer l,(ne l),ne l)) }
- | REAL kind_selector {% srcSpanFromL $1 (\l -> (Real l, $2, ne l)) }
- | REAL '*' length_value {% srcSpanFromL $1 (\l -> (Real l,$3,ne l)) }
- | REAL {% srcSpanFromL $1 (\l -> (Real l,(ne l),ne l)) }
- | SOMETYPE {% srcSpanFromL $1 (\l -> (SomeType l,(ne l),ne l)) }
--- | DOUBLE PRECISION kind_selector { (Double,$3,ne l) }
--- | DOUBLE PRECISION '*' length_value { (Double,$4,ne l) }
--- | DOUBLE PRECISION { (Double,ne l,ne l) }
- | COMPLEX kind_selector {% srcSpanFromL $1 (\l -> (Complex l,$2,ne l)) }
- | COMPLEX '*' length_value {% srcSpanFromL $1 (\l -> (Complex l,$3,ne l)) }
- | COMPLEX {% srcSpanFromL $1 (\l -> (Complex l,ne l,ne l)) }
- | CHARACTER char_selector {% srcSpanFromL $1 (\l -> (Character l,snd $2, fst $2)) }
- | CHARACTER {% srcSpanFromL $1 (\l -> (Character l,ne l,ne l)) }
- | LOGICAL kind_selector {% srcSpanFromL $1 (\l -> (Logical l,$2,ne l)) }
- | LOGICAL '*' length_value {% srcSpanFromL $1 (\l -> (Logical l,$3,ne l)) }
- | LOGICAL {% srcSpanFromL $1 (\l -> (Logical l,ne l,ne l)) }
- | TYPE '(' type_name ')' {% srcSpanFromL $1 (\l -> (DerivedType l $3,ne l,ne l)) }
+: INTEGER kind_selector {% getSrcSpanNull >>= (\s -> return $ (Integer (), $2, NullExpr () s)) }
+| INTEGER '*' length_value {% getSrcSpanNull >>= (\s -> return $ (Integer (), $3, NullExpr () s)) }
+| INTEGER {% getSrcSpanNull >>= (\s -> return $ (Integer (), NullExpr () s, NullExpr () s)) }
+| REAL kind_selector {% getSrcSpanNull >>= (\s -> return $ (Real (), $2, NullExpr () s)) }
+| REAL '*' length_value {% getSrcSpanNull >>= (\s -> return $ (Real (), $3, NullExpr () s)) }
+| REAL {% getSrcSpanNull >>= (\s -> return $ (Real (), NullExpr () s, NullExpr () s)) }
+| SOMETYPE {% getSrcSpanNull >>= (\s -> return $ (SomeType (), NullExpr () s, NullExpr () s)) }
+-- | DOUBLE PRECISION kind_selector { (Double (), $3, ne s)) }
+-- | DOUBLE PRECISION '*' length_value { (Double (), $4, ne s)) }
+-- | DOUBLE PRECISION { (Double (), ne s, ne s)) }
+| COMPLEX kind_selector {% getSrcSpanNull >>= (\s -> return $ (Complex (), $2, NullExpr () s)) }
+| COMPLEX '*' length_value {% getSrcSpanNull >>= (\s -> return $ (Complex (), $3, NullExpr () s)) }
+| COMPLEX {% getSrcSpanNull >>= (\s -> return $ (Complex (),NullExpr () s, NullExpr () s)) }
+| CHARACTER char_selector { (Character (), snd $2, fst $2) }
+| CHARACTER {% getSrcSpanNull >>= (\s -> return $ (Character (), NullExpr () s, NullExpr () s)) }
+| LOGICAL kind_selector {% getSrcSpanNull >>= (\s -> return $ (Logical (), $2, NullExpr () s)) }
+| LOGICAL '*' length_value {% getSrcSpanNull >>= (\s -> return $ (Logical (), $3, NullExpr () s)) }
+| LOGICAL {% getSrcSpanNull >>= (\s -> return $ (Logical (), NullExpr () s, NullExpr () s)) }
+| TYPE '(' type_name ')' {% getSrcSpanNull >>= (\s -> return $ (DerivedType () $3, NullExpr () s, NullExpr () s)) }
+
-- | POINTER '(' pointer_name ',' pointee_name ['(' array_spec ')' ] ')'
---[',' '(' pointer_name ',' pointee_name ['(' array_spec ')' ] ')' ] ...
+--[',' '(' pointer_name ',' pointee_name ['(' array_spec ')' ] ')' ]
-kind_selector :: { Expr A0}
+kind_selector :: { Expr A0 }
: '(' KIND '=' expr ')' { $4 }
| '(' expr ')' { $2 }
char_selector :: { (Expr A0, Expr A0) } -- (LEN, KIND)
char_selector
-: length_selector {% srcSpanNull >>= (\s -> return $ ($1, ne s)) }
+: length_selector {% getSrcSpanNull >>= (\s -> return $ ($1,NullExpr () s)) }
| '(' LEN '=' char_len_param_value ',' KIND '=' expr ')' { ($4,$8) }
| '(' char_len_param_value ',' KIND '=' expr ')' { ($2,$6) }
-| '(' char_len_param_value ',' expr ')' {% srcSpanNull >>= (\s -> return ($2, ne s)) }
+| '(' char_len_param_value ',' expr ')' {% getSrcSpanNull >>= (\s -> return $ ($2,NullExpr () s)) }
| '(' KIND '=' expr ',' LEN '=' char_len_param_value ')' { ($8,$4) }
-| '(' KIND '=' expr ')' {% srcSpanNull >>= (\s -> return (ne s, $4)) }
+| '(' KIND '=' expr ')' {% getSrcSpanNull >>= (\s -> return $ (NullExpr () s,$4)) }
length_selector :: { Expr A0 }
length_selector
-: '(' LEN '=' char_len_param_value ')' { $4 }
-| '(' char_len_param_value ')' { $2 }
+: '(' LEN '=' char_len_param_value ')' { $4 }
+| '(' char_len_param_value ')' { $2 }
char_len_param_value :: { Expr A0 }
char_len_param_value
- : specification_expr { $1 }
- | '*' {% srcSpanFromL $1 (\s -> Con s "*") }
+: specification_expr { $1 }
+| srcloc '*' {% getSrcSpan $1 >>= (\s -> return $ Con () s "*") }
length_value :: { Expr A0 }
length_value
- : NUM {% srcSpan l >>= (\s -> return $ Con s $1) }
+: srcloc NUM {% getSrcSpan $1 >>= (\s -> return $ Con () s $2) }
dim_spec :: { [(Expr A0, Expr A0)] }
dim_spec
@@ -439,23 +442,23 @@ dim_spec
attr_spec :: { ([(Expr A0, Expr A0)],[Attr A0]) }
attr_spec
- : dim_spec { ($1,[]) }
- | PARAMETER {% srcSpanFromL $1 (\s -> ([],[Parameter s])) }
- | access_spec { ([],[$1]) }
- | ALLOCATABLE {% srcSpanFromL $1 (\s -> ([],[Allocatable s ])) }
- | EXTERNAL {% srcSpanFromL $1 (\s -> ([],[External s])) }
- | INTENT '(' intent_spec ')' {% srcSpanFromL $1 (\s -> ([],[Intent s $3])) }
- | INTRINSIC {% srcSpanFromL $1 (\s -> ([],[Intrinsic s])) }
- | OPTIONAL {% srcSpanFromL $1 (\s -> ([],[Optional s])) }
- | POINTER {% srcSpanFromL $1 (\s -> ([],[Pointer s])) }
- | SAVE {% srcSpanFromL $1 (\s -> ([],[Save s])) }
- | TARGET {% srcSpanFromL $1 (\s -> ([],[Target s])) }
- | VOLATILE {% srcSpanFromL $1 (\s -> ([],[Volatile s])) }
+: dim_spec { ($1,[]) }
+| PARAMETER { ([],[Parameter ()]) }
+| access_spec { ([],[$1]) }
+| ALLOCATABLE { ([],[Allocatable ()]) }
+| EXTERNAL { ([],[External ()]) }
+| INTENT '(' intent_spec ')' { ([],[Intent () $3]) }
+| INTRINSIC { ([],[Intrinsic ()]) }
+| OPTIONAL { ([],[Optional ()]) }
+| POINTER { ([],[Pointer ()]) }
+| SAVE { ([],[Save ()]) }
+| TARGET { ([],[Target ()]) }
+| VOLATILE { ([],[Volatile ()]) }
access_spec :: { Attr A0 }
access_spec
- : PUBLIC {% srcSpanFromL $1 (\s -> Public s) }
- | PRIVATE {% srcSpanFromL $1 (\s -> Private s) }
+: PUBLIC { Public () }
+| PRIVATE { Private () }
array_spec :: { [(Expr A0, Expr A0)] }
array_spec
@@ -466,51 +469,53 @@ explicit_shape_spec_list :: { [Expr A0] }
explicit_shape_spec_list
: explicit_shape_spec_list ',' explicit_shape_spec {$1++[$3]}
| explicit_shape_spec {[$1]}
+
explicit_shape_spec :: { Expr A0 }
explicit_shape_spec
: expr { $1 }
| bound { $1 }
include_stmt :: { Decl A0 }
- : INCLUDE STR {% do { s1 <- srcSpanFrom $1;
- s2 <- srcSpan l;
- return $ Include s1 (Con s2 $2); } }
+: INCLUDE srcloc STR {% getSrcSpan $2 >>= (\s -> return $ Include () (Con () s $3)) }
specification_expr :: { Expr A0 }
specification_expr
: expr { $1 }
+
intent_spec :: { IntentAttr A0 }
intent_spec
- : IN {% srcSpanFromL $1 (\s -> In s) }
- | OUT {% srcSpanFromL $1 (\s -> Out s) }
- | INOUT {% srcSpanFromL $1 (\s -> InOut s) }
+: IN { In () }
+| OUT { Out () }
+| INOUT { InOut () }
specification_stmt :: { Decl A0 }
specification_stmt
: access_stmt { $1 }
-- | allocatable_stmt { $1 }
| common_stmt { $1 }
| data_stmt { $1 }
+ | equivalence_stmt { $1 }
-- | dimension_stmt { $1 }
| external_stmt { $1 }
-- | intent_stmt { $1 }
-- | intrinsic_stmt { $1 }
| namelist_stmt { $1 }
-- | optional_stmt { $1 }
-- | pointer_stmt { $1 }
--- | save_stmt { $1 }
+ | save_stmt { $1 }
-- | target_stmt { $1 }
+save_stmt :: { Decl A0 }
+ : SAVE { AccessStmt () (Save ()) [] }
+
common_stmt :: { Decl A0 }
- : COMMON '/' id2 '/' vlist {% srcSpanFromL $1 (\s -> Common s (Just $3) $5) }
- | COMMON vlist {% srcSpanFromL $1 (\s -> Common s Nothing $2) }
+: srcloc COMMON '/' id2 '/' vlist {% getSrcSpan $1 >>= (\s -> return $ Common () s (Just $4) $6) }
+| srcloc COMMON vlist {% getSrcSpan $1 >>= (\s -> return $ Common () s Nothing $3) }
interface_block :: { Decl A0 }
interface_block
- : interface_stmt interface_spec_list end_interface_stmt {% case $1 of
- Nothing -> srcSpanNull >>= (\s -> return $ Interface s $1 $2)
- Just y -> srcSpanFromL y (\s -> Interface s $1 $2) }
+: interface_stmt newline interface_spec_list newline end_interface_stmt { Interface () $1 $3 }
interface_stmt :: { Maybe (GSpec A0) }
interface_stmt
@@ -535,43 +540,42 @@ end_interface_stmt
interface_body :: { InterfaceSpec A0 }
interface_body
: function_stmt use_stmt_list implicit_part specification_part end_function_stmt
- {% do { s <- srcSpanFrom (fst3 $1);
- name <- cmpNames (fst3 $1) $5 "interface declaration";
- return (FunctionInterface s name (snd3 $1) $2 $3 $4); }}
+ {% do { name <- cmpNames (fst3 $1) $5 "interface declaration";
+ return (FunctionInterface () name (snd3 $1) $2 $3 $4); }}
| function_stmt end_function_stmt
- {% do { s <- srcSpanFrom (fst3 $1);
- name <- cmpNames (fst3 $1) $2 "interface declaration";
- return (FunctionInterface s name (snd3 $1) [] (ImplicitNull s) (NullDecl s)); } }
+ {% do { name <- cmpNames (fst3 $1) $2 "interface declaration";
+ s <- getSrcSpanNull;
+ return (FunctionInterface () name (snd3 $1) (UseNil ()) (ImplicitNull ()) (NullDecl () s)); } }
| subroutine_stmt use_stmt_list implicit_part specification_part end_subroutine_stmt
- {% do { s <- srcSpanFrom (fst3 $1);
- name <- cmpNames (fst3 $1) $5 "interface declaration";
- return (SubroutineInterface s name (snd3 $1) $2 $3 $4); } }
+ {% do { name <- cmpNames (fst3 $1) $5 "interface declaration";
+ return (SubroutineInterface () name (snd3 $1) $2 $3 $4); } }
+
| subroutine_stmt end_subroutine_stmt
- {% do { s <- srcSpanFrom (fst3 $1);
- name <- cmpNames (fst3 $1) $2 "interface declaration";
- return (SubroutineInterface s name (snd3 $1) [] (ImplicitNull s) (NullDecl s)); }}
+ {% do { name <- cmpNames (fst3 $1) $2 "interface declaration";
+ s <- getSrcSpanNull;
+ return (SubroutineInterface () name (snd3 $1) (UseNil ()) (ImplicitNull ()) (NullDecl () s)); }}
module_procedure_stmt :: { InterfaceSpec A0 }
module_procedure_stmt
- : MODULE PROCEDURE sub_name_list {% srcSpanFromL $1 (\s -> ModuleProcedure s $3 ) }
+: MODULE PROCEDURE sub_name_list { ModuleProcedure () $3 }
sub_name_list :: { [SubName A0 ] }
sub_name_list
- : sub_name_list ',' sub_name { $1++[$3] }
- | sub_name { [$1] }
+ : sub_name_list ',' sub_name { $1++[$3] }
+ | sub_name { [$1] }
sub_name :: { SubName A0 }
sub_name
- : ID {% srcSpan l >>= (\s -> return $ SubName s $1) }
+ : ID { SubName () $1 }
derived_type_def :: { Decl A0 }
derived_type_def
- : derived_type_stmt private_sequence_stmt component_def_stmt_list end_type_stmt
- {% do { s <- srcSpanFrom (fst $1);
- name <- cmpNames (fst $1) $4 "derived type name";
- return (DerivedTypeDef s name (snd $1) $2 $3); } }
+ : srcloc derived_type_stmt private_sequence_stmt component_def_stmt_list end_type_stmt
+ {% do { sp <- getSrcSpan $1;
+ name <- cmpNames (fst $2) $5 "derived type name";
+ return (DerivedTypeDef () sp name (snd $2) $3 $4); } }
derived_type_stmt :: { (SubName A0, [Attr A0]) }
derived_type_stmt
@@ -587,19 +591,15 @@ end_type_stmt
type_name :: { SubName A0 }
type_name
- : ID {% srcSpan l >>= (\s -> return $ SubName s $1) }
+: ID { SubName () $1 }
private_sequence_stmt :: { [Attr A0] }
private_sequence_stmt
- : PRIVATE SEQUENCE {% do { s1 <- srcSpanFrom $1;
- s2 <- srcSpanFrom $2;
- return [Private s1, Sequence s2]; } }
- | SEQUENCE PRIVATE {% do { s1 <- srcSpanFrom $1;
- s2 <- srcSpanFrom $2;
- return [Sequence s1, Private s2]; } }
- | PRIVATE {% srcSpanFromL $1 (\s -> [Private s]) }
- | SEQUENCE {% srcSpanFromL $1 (\s -> [Sequence s]) }
- | {- empty -} { [] }
+: PRIVATE SEQUENCE { [Private (), Sequence ()] }
+| SEQUENCE PRIVATE { [Sequence (), Private ()] }
+| PRIVATE { [Private ()] }
+| SEQUENCE { [Sequence ()] }
+| {- empty -} { [] }
component_def_stmt_list :: { [Decl A0 ] }
component_def_stmt_list
@@ -608,10 +608,11 @@ component_def_stmt_list
component_def_stmt :: { Decl A0 }
component_def_stmt
- : type_spec_p component_attr_spec_list '::' entity_decl_list
- {% srcSpanFromL (fst3 $1) (\s -> if isEmpty (fst $2)
- then Decl s $4 ((BaseType s (fst3 $1) (snd $2) (snd3 $1) (trd3 $1)))
- else Decl s $4 ((ArrayT s (fst $2) (fst3 $1) (snd $2) (snd3 $1) (trd3 $1)))) }
+ : srcloc type_spec_p component_attr_spec_list '::' entity_decl_list
+ {% (getSrcSpan $1) >>= (\s -> return $
+ if isEmpty (fst $3)
+ then Decl () s $5 ((BaseType () (fst3 $2) (snd $3) (snd3 $2) (trd3 $2)))
+ else Decl () s $5 ((ArrayT () (fst $3) (fst3 $2) (snd $3) (snd3 $2) (trd3 $2)))) }
component_attr_spec_list :: {([(Expr A0, Expr A0)],[Attr A0])}
component_attr_spec_list
@@ -620,14 +621,14 @@ component_attr_spec_list
component_attr_spec :: { ([(Expr A0, Expr A0)],[Attr A0]) }
component_attr_spec
- : POINTER {% srcSpanFromL $1 (\s -> ([],[Pointer s])) }
- | dim_spec { ($1,[]) }
+: POINTER { ([],[Pointer ()]) }
+| dim_spec { ($1,[]) }
access_stmt :: { Decl A0 }
access_stmt
- : access_spec '::' access_id_list {% srcSpanFromL $1 (\s -> AccessStmt s $1 $3) }
- | access_spec access_id_list {% srcSpanFromL $1 (\s -> AccessStmt s $1 $2) }
- | access_spec {% srcSpanFromL $1 (\s -> AccessStmt s $1 []) }
+: access_spec '::' access_id_list { AccessStmt () $1 $3 }
+| access_spec access_id_list { AccessStmt () $1 $2 }
+| access_spec { AccessStmt () $1 [] }
access_id_list :: { [GSpec A0] }
access_id_list
@@ -640,13 +641,13 @@ access_id
generic_spec :: { GSpec A0 }
generic_spec
-: ID {% srcSpan l >>= (\s -> return $ GName s (Var s [(VarName s $1,[])])) }
- | OPERATOR '('