view anagram/agcore/rproc.h @ 24:a4899cdfc2d6 default tip

Obfuscate the regexps to strip off the IBM compiler's copyright banners. I don't want bots scanning github to think they're real copyright notices because that could cause real problems.
author David A. Holland
date Mon, 13 Jun 2022 00:40:23 -0400
parents 13d2b8934445
children
line wrap: on
line source

/*
 * AnaGram, A System for Syntax Directed Programming
 * Copyright 1993-2002 Parsifal Software. All Rights Reserved.
 * See the file COPYING for license and usage terms.
 *
 * rproc.h
 */

#ifndef RPROC_H
#define RPROC_H

#include "register.h"

struct CSegment {
  unsigned char *begin;
  unsigned char *end;
  int line;

  // this is in pgg24.syn and moving it would make an ugly mess
  CSegment();

  int length() { return end - begin; }
  int operator < (const CSegment &s) const { return begin < s.begin; }
};

struct ProcedureDescriptor;

class Procedure : public ObjectRegister<ProcedureDescriptor> {
public:
  Procedure() {}
  Procedure(const int x);
  //Procedure(const Procedure &t) : ObjectRegister<ProcedureDescriptor>(t) {}
  Procedure(const CSegment &t);
  static const int first;
  static void reset();
  int operator < (const Procedure p) const;
};

struct ProcedureDescriptor {
  int cast;
  //int n_params;
  //unsigned cast_index;
  //int auto_proc;
  int alias;
  int line, col;
  int form_number;
  CSegment cSegment;
  //int *args;
  int macro_flag : 1;
  int value_flag : 1;

  ProcedureDescriptor();
  ProcedureDescriptor(const CSegment &);
  int operator < (const ProcedureDescriptor &d) const {
    return cSegment.begin < d.cSegment.begin;
  }
};


#endif /* RPROC_H */