1#!/usr/bin/env python 2# -*- coding: utf-8 -*- 3# 4# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) 5# 6# SPDX-License-Identifier: BSD-2-Clause 7# 8 9# xsymbol.py 10# 11# Author: Andrew Boyton, NICTA 12# Based on code by Timothy Bourke, NICTA 13# 14 15import isasymbols 16from __future__ import print_function 17import os 18import sys 19 20# Make isasymbols importable. 21sys.path.append(os.path.join(os.path.dirname(__file__), '../pysymbols')) 22 23translator = isasymbols.make_translator(os.path.join(os.path.dirname(__file__), 24 '../../isabelle/etc/symbols')) 25 26if len(sys.argv) > 1: 27 f = open(sys.argv[1], 'r') 28else: 29 f = sys.stdin 30 31data = f.read() 32print(translator.encode(data).encode('utf-8'), end='') 33